How build a global function to have the recent background-Positions for continue animation after cha

Posted by andi on Stack Overflow See other posts from Stack Overflow or by andi
Published on 2010-04-28T11:33:17Z Indexed on 2010/04/28 11:43 UTC
Read the original article Hit count: 373

Try to find a global function, to get and to put the backgroundPosition-values, but I feel a bit confused. Here is the function:

  function global_backgroundPosition_Menu(num){
        $('#Navigation_1')
            .css({
              backgroundPosition: num + "px 0"
                })
    }

/////////////////// An here I want to call and put the function:

if ($('#Navigation_1 li.leistungen.active').length != 0){

        global_backgroundPosition_Menu();
        $('#Navigation_1')
        .css({
          backgroundImage: "url(images/background/menu_highlight_hg.png)",
          backgroundRepeat: "no-repeat",
            })
        .animate({
          backgroundPosition: "30px 0"
            })
        global_backgroundPosition_Menu(30)
      };

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about variables