Question

ok im really a beginner when it comes to this but im trying to get this JS

$(document).ready(function(){
setTimeout(function(){
$("div.left-col-wrap-outer").fadeOut("slow", function () {
$("div.left-col-wrap-outer").remove();
  });

}, 9000);


});

to stop the animation/fade out after 9 seconds with a mouseover then to restart the 9 sec timer on mouseoff.

Any help really appeciated

Was it helpful?

Solution

$(document).ready(function(e){
   $("div.left-col-wrap-outer").mouseleave(function(e){
       $("div.left-col-wrap-outer").fadeOut("slow");
});
});

do you want this?

OTHER TIPS

This should do the trick

$(document).ready(function() {
    var fade = setTimeout(function(){
        $("div.left-col-wrap-outer").fadeOut("slow", function () {
                $("div.left-col-wrap-outer").remove();
        });
    }, 9000);
    $("div.left-col-wrap-outer").mouseout(function() {
        fade = setTimeout(function(){
            $("div.left-col-wrap-outer").fadeOut("slow", function () {
                    $("div.left-col-wrap-outer").remove();
            });
        }, 9000);
    });

    $("div.left-col-wrap-outer").mouseover(function() {
        clearTimeout(fade);
    });
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top