var pop_st,$h3= $('.ul_popelements h3');
$('.ul_popelements li:eq(6),.ul_popelements li:eq(7),.ul_popelements li:gt(15)').addClass('right');
window.h3over = function (indx) {
var obj = $h3.eq(indx),$li = obj.parent('li');
if ($('.ul_popelements div').queue().length<=1) {
$li.addClass('over').find('div').animate({'width':'202px','left':(($li.hasClass('right'))?'-192px':'0px')},'fast',function () {
$(this).addClass('over');
});
}
}
$h3.mouseenter(function (){
var indx = $h3.index($(this));
 pop_st = setTimeout('h3over('+indx+')',200);
}).mouseleave(function (){
clearTimeout(pop_st);
$(this).next('div').removeClass('over').animate({'width':'10px','left':'0'},'fast',function () {
$(this).parent('li').removeClass('over');
})
}); 各位大侠们,window.h3over这个是什么意思呢  还有这个 pop_st = setTimeout('h3over('+indx+')',200);新手,请大家多多指教。
在维斯诺看到的一段代码

解决方案 »

  1.   

    h3over是个全局变量,跟 var h3over = function(){xxx}
    是一样的,
    javascript中 全局变量属于全局(window对象)作用域
    就像window.alert()可以写成alertsetTimeout是一个定时器,第一个参数是执行的内容
      

  2.   

    setTimeout('h3over('+indx+')',200);
    表示每隔一段时间(第二个参数,毫秒值)执行一段命令(第一个参数值).
      

  3.   


    indow.h3over = function (indx) {}
    也就是相当于h3over()是个函数,然后indx是参数了?
      

  4.   

    是啊。跟 function h3over(index){} 类似