我制作这个剧本但是我有一些问题...如果我把鼠标第一次不能正常工作但是如果我移除鼠标而我再次使用它...希望有人可以帮我解决这个问题
我的剧本:
function wideDropdown(obj_array) {
$.each(obj_array, function(key, value) {
eval(key + '=' + '\'' + value + '\'');
});
$(div_class).attr('style', "height: "+div_height);
var count = 0;
$(div_class+', '+div_id).mouseenter(function(){
count++;
$(div_class).show();
$(div_id).attr('class', "Buttons_Hover");
$(div_id).attr('style', "color: #bdc7f3");
}).mouseleave(function(){
count--;
if (!count) {
$(div_class).hide();
$(div_id).attr('class', "Buttons");
$(div_id).attr('style', "color: #8a9ef3");
}
});
}
// ------------------------ Menu Videos
$("#Menu_Videos").hover(function(){
var obj_array = {
"div_id": "#Menu_Videos",
"div_class": ".wideDropdown_Menu_Videos",
"div_height": "140px"
};
wideDropdown(obj_array);
});
// ------------------------ Live Data Videos
$("#Menu_Live_Data").hover(function(){
var obj_array = {
"div_id": "#Menu_Live_Data",
"div_class": ".wideDropdown_Menu_Live_Data",
"div_height": "600px"
};
wideDropdown(obj_array);
});