iGalerie

Vous n'êtes pas identifié(e).

Annonce

Un message d'erreur qui s'affiche ? Un mot de passe oublié ? L'ajout de fichier qui ne marche pas ?
Pensez d'abord à lire la FAQ, vous y trouverez probablement une solution à votre problème.

#1 13-11-2023 11:41:21

Knut
Membre
Lieu : Norway
Inscription : 27-12-2013
Messages : 75
Site Web

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

#2 13-11-2023 12:42:26

David
Développeur d'iGalerie
Inscription : 12-05-2006
Messages : 4 341
Site Web

Re : head.tpl.php

Hi,

No need for Javascript. Try this code in "Theme options" / "CSS code" :

@media (max-width: 1500px)
{
   #mmenucontainer{display:none!important}
}

Hors ligne

#3 13-11-2023 13:06:57

Knut
Membre
Lieu : Norway
Inscription : 27-12-2013
Messages : 75
Site Web

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

#4 13-11-2023 13:19:39

David
Développeur d'iGalerie
Inscription : 12-05-2006
Messages : 4 341
Site Web

Re : head.tpl.php

With this code it will work better:

@media (max-width: 1500px)
{
   .mmenucontainer{display:none!important}
}

Hors ligne

#5 13-11-2023 19:22:16

Knut
Membre
Lieu : Norway
Inscription : 27-12-2013
Messages : 75
Site Web

Re : head.tpl.php

Thank you David, this works perfectly.
Very much appreciated.
Knut

Hors ligne

Pied de page des forums