我有36行的小代码:
var rightClass;
var activeSlide;
var locked = false;
$(document).ready(function(){
$('.menu .slideItDown').on('mouseenter', function(){
$('.submenu').slideToggle(1000);
});
$(".plan_ico").addClass('active');
$('.getIt').on('mouseover.show', showInfo);
});
function showInfo(){
activeSlide = $(".getIt.active");
rightClass = $(this).data('show');
if( activeSlide.data('show') != rightClass ) {
if (locked == false){
locked = true;
$(activeSlide).toggleClass('active');
$(activeSlide.data('show')).slideToggle(1000);
$(this).toggleClass('active');
$(rightClass).slideToggle(function(){
locked = false;
});
}
}
}
所有这一切都是“滑动”一些div并在我将鼠标悬停在某些列表上时切换它们:
<!-- <ul>
<li class= 'plan_ico getIt' data-show='.plan'><img src="images/plan_ico.png" width="151" height="150" />
<h1>Plan</h1>
</li>
<li class= 'design_ico getIt' data-show='.design'><img src="images/design_ico.png" width="151" height="150" />
<h1>Diseño</h1>
</li>
<li class= 'build_ico getIt' data-show='.build'><img src="images/build_ico.png" width="151" height="150" />
<h1>Desarrollo</h1>
</li>
<li class= 'launch_ico getIt' data-show='.launch'><img src="images/launch_ico.png" width="151" height="150" />
<h1>Lanzamiento</h1>
</li>
</ul> -->
由于某些原因它在ie7或以上不起作用我有什么不对吗?在Chrome,狐狸,野生动物园和歌剧中顺利运作......我真的很想让它在IE中运作。
(我想知道html5数据属性是否会弄乱我的代码......)