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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -