jquery - JavaScript Scroll Script - Fires in test, not on dev site -
jquery - JavaScript Scroll Script - Fires in test, not on dev site -
my script replace logo upon scroll works here in test 'http://jsfiddle.net/timsalabim/opek5mtz/`
<!-- logo scroll --> var img = document.queryselector('.logo_h__img img'); // element img.dataset.orig = img.src; // dataset document.addeventlistener('scroll', function (e) { // add together event listener if (document.body.scrolltop > 0) { // check scroll position img.src = img.dataset.scroll; // set scroll image } else { img.src = img.dataset.orig; // set original image } }); it not work when implemented same way in website, think have tested correctly , firing too....
i set script in site in <head> </head> tags located in header.php file (wordpress website) within these tags:
<script type="text/javascript"> </script> i didn't forget add together section image tag:
data-scroll="http://" is possible navigation set in way logo nested next doesn't recognise scroll?
**** update **** here dev site: http://dev.greenlabit.com.au/test/
i tried other js , got work! stopped functioning when fixed navigation bar in use.
thank of help.
javascript jquery html css content-management-system
Comments
Post a Comment