Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding jQuery script for background image animation


  • nickharambee
    Participant

    @nickharambee

    Hi,

    I am trying to add a jQuery script to my page. I am using the Buddypress default theme which seems to have the latest version of jQuery included.

    I am then wanting to include a backgroundPosition.js script and a small script that handles an animation on my navigation items:

    
    var $j = jQuery.noConflict();
    
    $j(function() {
    $j(".bottom").hover( function () {
    $j(this).animate( {
    backgroundPosition : '0px 35px'}
    , 300); }
    , function () {
    $j(this).animate( {
    backgroundPosition : '0px 0px'}
    , 600); }
    );
    }
    );
    

    At the moment I have included the backgroundPosition script after wp_head(); in my header.php as follows:

    and then I have the above script below this. jQuery and the backgroundPosition script are successfully included on the page, but I see no animation, as I do when I use this script on non-Wordpress pages.

    Could someone advise as to the best way of getting this to work?

    Thanks,

    Nick

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding jQuery script for background image animation’ is closed to new replies.
Skip to toolbar