Vous n'êtes pas identifié(e).
- Discussions : Actives | Sans réponse
Annonce
Pensez d'abord à lire la FAQ, vous y trouverez probablement une solution à votre problème.
Pages : 1
#1 13-11-2023 11:41:21
head.tpl.php
Hi,
There is a great function in the album to run template/default/custom/head.tpl.php in album 'head' section.
I want to use this file to run the same menu-javascript as in our main website (https://www.varteig-historielag.no/Felles/index.html) incorporated with the album.
And it works well for large screens. But for mobile and below screen.width < 'some pixel value' I want the menu/javascript not to load.
I am not great with php and javascript language so I ask for help.
How to I run head.tpl_.php code so my javascript lines are omitted/disregarded with screen.width below a set value like 1500 pixler.
I would appreciate input/suggestions from you.
Link to a bakcup album where the javascript menu works for large screens.
https://varteig-historielag.no/VHiGalerie3_/
My current head.tpl.php file in the backup album:
<!DOCTYPE html>
<html lang="nb">
<head>
<meta charset="utf-8">
</head>
<body>
<div>
<script type="text/javascript" src="https://www.varteig-historielag.no/MilonicH_FloatIGal/milonic_src.js"></script>
<script type="text/javascript" src="https://www.varteig-historielag.no/MilonicH_FloatIGal/mmenudom.js"></script>
<script type="text/javascript" src="https://www.varteig-historielag.no/MilonicH_FloatIGal/menu_data.js"></script>
<SCRIPT language=Javascript src="https://www.varteig-historielag.no/MilonicSiteIndex/mm_siteIndex.js" type=text/javascript></SCRIPT>
<noscript><a href="https://www.varteig-historielag.no/">JavaScript DHTML Menu Powered by Milonic</a></noscript>
<noscript><a href=https://www.varteig-historielag.no/>JavaScript DHTML menu is only visible when JavaScript is enabled</a></noscript>
</div>
</body>
</html>
Knut
Hors ligne
#3 13-11-2023 13:06:57
Re : head.tpl.php
Thank you David,
As far as I can see this works great for album max with 1500 and for mobile menu appear or dissaperar. when I test this the this extermal menu stays on all the time.
My issue is I have a javascript exernal menu which is not album menu. I run this from head.tpl.php and I want this menu to disappear below a screen width value.
Knut
Hors ligne
Pages : 1