Jump to content
GIGN Forum

Jquery


*jancis38*
 Share

Recommended Posts

Kādām jaizskatās jQuery skripta rindiņām, lai refrešotu noteiktu div'u ik pēc, piemēram, 30 sekundēm (būtu jauki ar fadeIn un fadeOut effektiem)?

EDIT: Es pats varu tikai tik tālu tikt:

<script>
setInterval(function()
{
    $("#sidebar_left").fadeOut("slow").fadeIn("slow");
}, 10000);
</script>

Edited by *jancis38*
Link to comment
Share on other sites

callbackus jāizmanto, lai viss notiktu smuki pēc kārtas...

<script type="text/javascript">
    var timeout = 30000;
    var reload = function(){
        $("#sidebar_left").fadeOut("slow", function(){
            $(this).load("mans/super/links.php", function(){
                $(this).fadeIn("slow", function(){
                    setTimeout(reload, timeout);
                });
            });
        })
    }
    $(function(){
        setTimeout(reload, timeout);
    });
</script>

Edited by X ID
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...