Hirdetés

Keresés

Új hozzászólás Aktív témák

  • Jim-Y
    veterán

    Van az alábbi jQuery kódom, amivel azt szeretném elérni, hogy egy header osztályba tartozó div-nek megváltoztassa a háttér képét az animate() eseménnyel, de valamiért nem működik. Vetnétek rá egy kukkantást:
    $(document).ready(function(){
    var x = 1;
    function bgEffect(){
    if(x==1){
    $("div.header").animate(function(){
    'background-image' : 'url(img/bg_02.jpg)'
    },"slow");
    } else if(x==2){
    $("div.header").animate(function(){
    'background-image' : 'url(img/bg_03.jpg)'
    },"slow");
    } else if(x==3){
    $("div.header").animate(function(){
    'background-image' : 'url(img/bg_01.jpg)'
    },"slow");
    }
    window.setInterval("bgEffect()",1000);
    }
    bgEffect();
    });

    All animated properties should be animated to a single numeric value, except as noted below; most properties that are non-numeric cannot be animated using basic jQuery functionality (For example, width, height, or left can be animated but background-color cannot be,

Új hozzászólás Aktív témák