Toggle not have error but not run
I am using toggle() for 'slideshow pack information of travelle' check code here:
HTML:
www2.mappaturismo.com.br
JAVASCRIPT:
function rota() {
$(".col-a div.row-a-dois:last").toggle(
function(){ $(this).fadeIn("slow") }, function(){ $(this).fadeOut("slow") }
);
$(".col-a div.row-a-tres:last").toggle(
function(){ $(this).fadeIn("slow") }, function(){ $(this).fadeOut("slow") }
);
$(".col-a div.row-a-dois:first").toggle(
function(){ $(this).fadeIn("slow") }, function(){ $(this).fadeOut("slow") }
);
$(".col-a div.row-a-tres:first").toggle(
funct开发者_StackOverflow社区ion(){ $(this).fadeIn("slow") }, function(){ $(this).fadeOut("slow") }
);
}
$(function() {
setInterval( "rota()", 5000 );
});
I think you have misunderstood what the jQuery "toggle()" function does. It does not make things happen right away. Instead, it binds event handlers to your elements.
Therefore, calling "toggle()" over and over again like that is pointless.
I'm not sure what it is that you want to happen on your page, so it's hard to say what your code should look like.
精彩评论