JS菜单无法自动隐藏.求助!!! 本帖最后由 walunwine 于 2012-12-04 17:11:51 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你这个什么框架?自己改下面的模型给suggestions添加mouseout事件,启动计时器10s后自动隐藏,再次移动进入suggestions时清除计时器var timer,span=10*1000;suggestions.onmouseout=function(){ timer=setTimeout(function(){/*suggestions隐藏的代码*/},span);}suggestions.onmouseover=function(){clearTimeout(timer);} 这个是SHOPEX系统下的一个插件,所以应该是属于Mootools框架下的吧.我对JS不是很了解.<script> $ES('#suggestions').setStyle('display','block'); //弹出图层的样式 $ES('#suggestions').fade('hide'); //默认图层隐藏 function lookup(inputString) { if(inputString.length == 0) { //如果INPUT内为0时自动隐藏 $ES('#suggestions').fade('out'); //如果INPUT内为0时自动隐藏 //jQuery('#suggestions').fadeOut(); // Hide the suggestions box } else { var req = new Request({ //这个变量是导入数据通过searchapi这个接口 method: 'post', url: 'plugins/widgets/livingsearch/searchapi.php', data: { 'queryString' : inputString , 'lsIsCache': '<{$setting.lsIsCache}>', 'lsCacheTime':'<{$setting.lsCacheTime}>', 'lsIsCatalog':'<{$setting.lsIsCatalog}>', 'lsIsGoodname':'<{$setting.lsIsGoodname}>', 'lsIsGoodprice':'<{$setting.lsIsGoodprice}>' }, onComplete: function(response) { $ES('#suggestions').set('html',response); //您刚才回复的MOUSEOUT应该是添加到什么地方呢? } }).send(); $ES('#suggestions').fade('in'); // Show the suggestions box } } </script>谢谢您的回复 版主你好。还劳烦你帮我看一下。刚在淘宝上找了一圈号称修改JS的.没有说可以的.要不就漫天喊价.我的是SHOPEX系统 是属于MOOTOOLS框架的.现在只是想鼠标留在下拉菜单上就不隐藏.如果鼠标离开就隐藏.9987542c.ysb148b.84684.net这个是测试站首页左侧的一个红叉的地方就是问题所在.麻烦了.谢谢 问题已经解决.从外面引入了一个JS文件替换掉了$ES('.spotToogleDisplay').each(function(item,index){ item.addEvents({ 'mouseleave':function(){ this.fade('out'); $ES('.topbtn a')[index].set('class',oriClass[index]); }, 'mouseenter':function(){ //$ES('.topbtn a')[index].set('class',oriClass[index]+'_over'); } }); }); html中网址加密问题 JS如何获取指定对象下面的表单元素的值 javascript+css弹出层特效 请教下window的这个属性--ONREQUEST 启动tomcat没问题,可一打开jsp页面就出现下面的错误 webgame 世界地图 在表格重.怎样得到光标所选中的行的ID? 利用window.open时,对于程序运行的后台操作 js检查网址的有效性 如何给带参数的IMG src做变量 如何实现隐藏div同时去掉input属性? 关于jquery ui 的dialog使用问题
var timer,span=10*1000;
suggestions.onmouseout=function(){
timer=setTimeout(function(){/*suggestions隐藏的代码*/},span);
}
suggestions.onmouseover=function(){clearTimeout(timer);}
这个是SHOPEX系统下的一个插件,所以应该是属于Mootools框架下的吧.我对JS不是很了解.
<script>
$ES('#suggestions').setStyle('display','block'); //弹出图层的样式
$ES('#suggestions').fade('hide'); //默认图层隐藏
function lookup(inputString) {
if(inputString.length == 0) { //如果INPUT内为0时自动隐藏
$ES('#suggestions').fade('out'); //如果INPUT内为0时自动隐藏
//jQuery('#suggestions').fadeOut(); // Hide the suggestions box
} else {
var req = new Request({ //这个变量是导入数据通过searchapi这个接口
method: 'post',
url: 'plugins/widgets/livingsearch/searchapi.php',
data: { 'queryString' : inputString ,
'lsIsCache': '<{$setting.lsIsCache}>',
'lsCacheTime':'<{$setting.lsCacheTime}>',
'lsIsCatalog':'<{$setting.lsIsCatalog}>',
'lsIsGoodname':'<{$setting.lsIsGoodname}>',
'lsIsGoodprice':'<{$setting.lsIsGoodprice}>'
},
onComplete: function(response) {
$ES('#suggestions').set('html',response); //您刚才回复的MOUSEOUT应该是添加到什么地方呢?
}
}).send();
$ES('#suggestions').fade('in'); // Show the suggestions box
}
}
</script>
谢谢您的回复
版主你好。还劳烦你帮我看一下。刚在淘宝上找了一圈号称修改JS的.没有说可以的.要不就漫天喊价.
我的是SHOPEX系统 是属于MOOTOOLS框架的.
现在只是想鼠标留在下拉菜单上就不隐藏.如果鼠标离开就隐藏.
9987542c.ysb148b.84684.net这个是测试站首页左侧的一个红叉的地方就是问题所在.
麻烦了.谢谢
问题已经解决.从外面引入了一个JS文件替换掉了
$ES('.spotToogleDisplay').each(function(item,index){
item.addEvents({
'mouseleave':function(){
this.fade('out');
$ES('.topbtn a')[index].set('class',oriClass[index]);
},
'mouseenter':function(){
//$ES('.topbtn a')[index].set('class',oriClass[index]+'_over');
}
});
});