如题,代码在火狐 Google浏览器下都没有问题,只是在IE下没有反应 html 代码<div class="cjy-top"><span class="cjy-tit fn-left"></span><span class="cjy-tab fn-left"><a id="class1" href="javascript:void(0)" class="cur">1</a><a id="class2" href="javascript:void(0)" href="">2</a><a id="class3" href="javascript:void(0)" href="">3</a><a id="class4" href="javascript:void(0)" href="">4</a><a id="class5" href="javascript:void(0)" href="">5</a><a id="class6" href="javascript:void(0)" href="">6</a><a id="class7" href="javascript:void(0)" href="">7</a></span>js 代码<script type="text/javascript">$(function(){$('.cjy-tab a').mouseover(function(){var Id=$(this).attr("id");$('.cjy-tab a').each(function(){if(Id==$(this).attr("id")){$("#"+Id).removeClass("").addClass("cur");$("#lineList"+Id.replace("class","")).show();}else{$("#"+$(this).attr("id")).removeClass("cur").addClass("");$("#lineList"+$(this).attr("id").replace("class","")).hide();}}) })$('.gny-tab a').mouseover(function(){var Id=$(this).attr("id");$('.gny-tab a').each(function(){if(Id==$(this).attr("id")){$("#"+Id).removeClass("").addClass("cur");$("#lineList"+Id.replace("class","")).show();}else{$("#"+$(this).attr("id")).removeClass("cur").addClass("");$("#lineList"+$(this).attr("id").replace("class","")).hide();}}) })})//gny-tab</script>
3 回答
慕慕森
TA贡献1856条经验 获得超17个赞
<script type="text/javascript">
$(document).ready(function(){//加上这个
$(document).click(function(){
alert('this is work');
});
});
</script>
慕码人8056858
TA贡献1803条经验 获得超6个赞
写法有问题要这样写
12345 | $( function (){ $(document).click( function (){ alert( 'this is work' ); }); }); |
添加回答
举报
0/150
提交
取消