Tagged: x
-
AuthorPosts
-
July 25, 2016 at 2:40 am #1101466
TimParticipantHi X,
I have used some code to change the logo on scroll. When you first enter the page (http://comhsc-siiksaare.savviihq.com/product/graco-husky-205-membraanpomp/). You see the first logo, on scroll it changes to second. This works fine. Without the topbar activated, when scrolling to top, it changes back to the first logo. With the topbar activated, it does not.
You guys have a clue what might causing this?
The code used:
jQuery(function($) { $(window).scroll(function() { var scrollPos = $(window).scrollTop(), width = $(window).width(); if($(".x-navbar").hasClass("x-navbar-fixed-top") && scrollPos > 25 && width > 200) { $(".x-navbar-fixed-top .x-brand img").attr("src","http://comhsc-siiksaare.savviihq.com/wp-content/uploads/2016/07/hsc-pumps-graco-specialist-beeld3.svg"); } else { $(".x-navbar-fixed-top .x-brand img").attr("src","http://comhsc-siiksaare.savviihq.com/wp-content/uploads/2016/07/hsc-pumps-graco-specialist-logo-w.svg"); } }); });Cheers!
July 25, 2016 at 2:57 am #1101488
RupokMemberHi there,
Let’s update the code a bit :
jQuery(function($) { $(window).scroll(function() { var scrollPos = $(window).scrollTop(), width = $(window).width(); if($(".x-navbar").hasClass("darknavbar") && scrollPos > 25 && width > 200) { $(".x-navbar .x-brand img").attr("src","http://comhsc-siiksaare.savviihq.com/wp-content/uploads/2016/07/hsc-pumps-graco-specialist-beeld3.svg"); } else { $(".x-navbar .x-brand img").attr("src","http://comhsc-siiksaare.savviihq.com/wp-content/uploads/2016/07/hsc-pumps-graco-specialist-logo-w.svg"); } }); });Hope this helps.
Cheers!
July 25, 2016 at 4:35 am #1101585
TimParticipantHi Rupok,
Works like a charm. Thanks so much:)
Have a great day!
Cheers!
July 25, 2016 at 5:48 am #1101625
ChristianModeratorYou’re welcome. Glad we could help. 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1101466 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
