Tagged: x
-
AuthorPosts
-
April 22, 2016 at 5:17 am #895095
sendpireParticipantHey there,
I want to change my logo to a simpler version of it after the viewer scrolls, and when he scrolls back up it should change to the original logo again.
I already found a great thread in here with some Javascript code that I inserted and it changes the logo to a 2nd one after scrolling.
My problem is, that the logo stays as the 2nd one even if the viewer scrolls back to the top. Can I change that somehow?
April 22, 2016 at 5:17 am #895096
sendpireParticipantThis reply has been marked as private.April 22, 2016 at 8:35 pm #896129
FriechModeratorHi There,
Thanks for writing in! Please update your code to this.
jQuery(document).ready(function($) { $(window).scroll(function() { var scrollPos = $(window).scrollTop(); if (scrollPos > 200) { $('.x-brand img').attr('src','https://sendpwr.com/wp-content/uploads/2016/04/image-8-e1461319499834.png'); } else { $('.x-brand img').attr('src','https://sendpwr.com/wp-content/uploads/2016/04/white-logo-cut.png'); } }); });Hope it helps, Cheers!
April 23, 2016 at 7:53 am #896609
sendpireParticipantWorked awesome! Thanks 🙂
April 24, 2016 at 5:50 am #897324
ThaiModeratorGlad it worked 🙂
If you need anything else please let us know.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-895095 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
