$grid.find( 'div.bb-bookblock' ).each( function( i )
{
var $bookBlock = $(this),
$nav = $bookBlock.next(),
$navNext = $nav.find('.bb-nav-next'),
$navPrev = $nav.find('.bb-nav-prev'),
$navFirst = $nav.find('.bb-nav-first'),
$navLast = $nav.find('.bb-nav-last'),
$playStop = $nav.find('.bb-nav-play-stop'),
isPlaying = false,
autoplayTimer = null,
bb = $bookBlock.bookblock(
{
speed : 600,
shadows : false
});
});
.each 函数内的所有变量是否仅在循环内具有作用域?例如 autoPlayTimer 将是 setInterval 的结果。我想确保我没有覆盖变量。看起来它工作正常,但我想确保我理解$().each