• I’m sure there must be a simple solution…..The JQuery I have written in the header is completely ignored. The page acts as if it is not there. All I am trying to do is to have a simple rollover effect on the images present.

    So guess my basic qestion is…how do I get the Header and Footer Scripts plugin to work?

    What have I missed?

    This is the Jquery:

    <script type=”text/javascript”>

    jQuery( document ).ready( function( $ ) {
    $(‘#gallery img’).each(function() {
    var imgFile = $(this).attr(‘…./blog/wp-content/uploads/_images/unknown.jpg’);
    var preloadImage = new Image();
    var imgExt = /(\.\w{3,4}$)/;
    preloadImage.src = imgFile.replace(imgExt, ‘_h$1’);
    $(this).hover (
    function() {
    $(this).attr(‘src’, preloadImage.src);
    },
    function() {
    $(this).attr(‘src’, imgFile);
    }
    ); // end hover
    }); // end each
    }); // end ready
    </script>`

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘JQuery in header ignored’ is closed to new replies.