Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2017-07-24 18:29:27

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Pop-up box and Scroll to top conflict

Hi,

From the Backlight Tips & Tricks» Pangolin pop up boxes post:
http://community.theturninggate.net/vie … hp?id=7774

And the page test:
http://pangolin.barbeephoto.com/?page=pop-up

It works perfectly thank you!

The only problem I have is that with the "Scroll to Top script", when you close the Help pop-up, the screen darkens until you clic somewhere on the screen.

example, clic on "Aide" button:
http://www.phototheque.nicolaslogerot.f … /?q=Arbois

Nico

Offline

#2 2017-07-24 22:34:36

tomowensphoto
Member
From: Suffolk
Registered: 2012-11-21
Posts: 321
Website

Re: Pop-up box and Scroll to top conflict

Hi Nico,
Rod updated his Tips & Tricks page. See this on styling your popup boxes: http://ttg-tips-and-tricks.barbeephoto. … pup-boxes/
It works OK for me.

Last edited by tomowensphoto (2017-07-24 22:35:13)


Regards,
TomO
Just a simple photographer
Live site at http://tomowens.openpoint.co.uk/

Offline

#3 2017-07-24 22:35:49

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Pop-up box and Scroll to top conflict

you could try placing the "scroll to top" script in the ttg_scripts hook rather than the footer.
http://community.theturninggate.net/vie … hp?id=7894


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#4 2017-07-24 22:51:56

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Pop-up box and Scroll to top conflict

No Rod, don't works, here is my script for scroll to top:

<?php function ttg_scripts( $style, $path ) { 
    echo '
    <script src="http://www.phototheque.nicolaslogerot.fr/backlight/publisher/resource.php?template=26&extension=js&name=scripts"></script>
    <a href="#top" class="btn-scroll-to-top" title="Top of page" ><i class="fa fa-arrow-up fa-lg"></i></a>
<script>
    $(document).ready(function() {
        $(".btn-scroll-to-top").click(function() {
            $("html, body").animate({ scrollTop: 0 }, "slow");
            return false;
        });
        $(window).scroll(function() {
            if ($(this).scrollTop() > 200) {
                $(".btn-scroll-to-top").fadeIn();
            } else {
                $(".btn-scroll-to-top").fadeOut();
            }
        });
    });
    </script>
    ';
}
?>

And my pop-up code:

<h2>Recherche de photos</h2>
<p>Utilisez le formulaire ci-dessous pour rechercher des images. Cliquez sur le bouton Aide pour obtenir des conseils sur la recherche.</p>
<button data-fancybox data-src="#popup">Aide</button>
<p></p>
<div id="popup" style="display:none;"> 
<h2 class="popup-title"> Aide à la recherche d'images</h2><p>La recherche accepte les termes requis et les termes omis, et par défaut le comportement "OR".</p> 

<p>Avec le comportement "OR", la recherche de "Vallée de la Loue" renverrait tous les coups pour "Vallée" ou "Loue".</p>  
<p>Pour exiger un terme, utilisez "+" (plus); Cela renverrait les images de la Vallée de la Loue et exclurait les images de la Montagne de la Loue</p>

<pre class="code">Vallée +loue</pre>

<p>Pour omettre un terme, utilisez "-" (moins); Cela renverrait toutes les images de Bonlieu, à l'exclusion des images du Lac de Bonlieu:</p>

<pre class="code">Bonlieu -Lac</pre>

<p>Pour rechercher une chaîne de mots comme s'il s'agissait d'un terme unique, enveloppez-le en guillemets simples ou doubles:</p>

<pre class="code">"Lac de Bonlieu"</pre>

<p>Pour exiger ou omettre une chaîne de mots, ajoutez le signe "+" ou "-" entre guillemets. Cela ne produirait que des images de l'église d'Arbois:</p>

<pre class="code"> vigne "+église d'Arbois"</pre>

<p></p></div>

Offline

#5 2017-07-24 23:42:42

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Pop-up box and Scroll to top conflict

Just to be clear, the popup overlay doesn't remain after the popup is closed if you're not using the scroll to top script?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#6 2017-07-24 23:44:33

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Pop-up box and Scroll to top conflict

Yes that's exactly that.

If I disable Scroll to Top script, all is ok

Offline

#7 2017-07-25 00:09:52

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Pop-up box and Scroll to top conflict

Hmm... I've got it working on my test site: http://pangolin.barbeephoto.com/pop-up/

Your code is including a call to the jQuery script. Is there a reason you have that in the phplugins function? It is already getting called earlier in the page so you don't need to call it again.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#8 2017-07-25 00:14:27

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Pop-up box and Scroll to top conflict

Yes because otherwise the Scroll to Top icon does not appear

Offline

#9 2017-07-25 00:17:51

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Pop-up box and Scroll to top conflict

I'm not positive, but I don't think calling the jQuery library twice is a good idea.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#10 2017-07-25 00:23:09

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Pop-up box and Scroll to top conflict

Yes, I'm aware of it, but if I do not call the script, the scroll to top does not appear. So the conflict probably comes from here!

Offline

#11 2017-07-25 00:31:22

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Pop-up box and Scroll to top conflict

well, there's a conflict somewhere. The jQuery you're calling in the ttg_footer_bottom hook looks like it's from the Okapi version of Backlight. The jQuery being called by the page is a longer file and includes Fancybox scripting for the cart. That's probably the Pangolin version.

Can you try removing that call to jQuery that you've placed in footer. Otherwise it's hard to troubleshoot.

Better yet, remove that call and change the hook to ttg_scripts. That way it will be easier to compare my working example with yours.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#12 2017-07-25 00:33:28

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Pop-up box and Scroll to top conflict

Ok thanks Rod,
Everything you asked me and did

Offline

#13 2017-07-25 00:36:11

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Pop-up box and Scroll to top conflict

Now it's work!!

The other time I put ttg_scripts but not deleted the script!

Thanks!

Offline

#14 2017-07-25 00:47:30

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Pop-up box and Scroll to top conflict

great! Glad it's working now.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#15 2017-07-25 00:49:56

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Pop-up box and Scroll to top conflict

Ouch ! Thank you so much for being here Rod!

Offline

Board footer

Powered by FluxBB