我在 Firefox 中收到此错误:TypeError: $("#main-CNTR").on is not a function。而且这段代码根本不起作用:
$(document).ready(function(){
$('#main-CNTR').on('mouseenter','.social_span',function(){
alert("INSIDE");
});
$('#main-CNTR').on('mouseleave','.social_span',function(){
alert("OUTSIDE");
});
});
HTML部分是这个
<span class="social_span"></span>
<div class="row clearfix" style="display:none;">
<ul class="social-buttons cf">
<li>1</li>
</ul>
</div>
在鼠标进入跨度时,应显示一条消息并显示下一个 div。显然 div#main-CNTR 是主要内容容器 div 并且 HTML 片段在页面中重复了几次。
live 方法可以正常工作,但在 ie8 中不行。
$('.social_span').live('mouseenter',function(){
alert("INSIDE");
});
$('.social_span + .row').live('mouseleave',function(){
alert("OUTSIDE");
});
谁能帮我?谢谢!
<script type="text/javascript" src="/js/libs/modernizr-2.5.3.min.js"></script>
<script type="text/javascript" src="/js/jQuery/engine/core8.js"></script>
<script type="text/javascript" src="/js/jQuery/engine/ui.js"></script>
<script type="text/javascript" src="/js/jQuery/plugin/jquery.tools.min.js"></script>
<script type="text/javascript" src="/js/jQuery/plugin/jquery.easing.js"></script>
<script type="text/javascript" src="/js/jQuery/plugin/jquery.lavalamp.min.js"></script>
<script type="text/javascript" src="/js/jQuery/plugin/jquery.fancybox.js"></script>
<script type="text/javascript" src="/js/jQuery/plugin/jquery.li-scroller.js"></script>
<script type="text/javascript" src="/js/jQuery/plugin/jquery.reflection.js"></script>
<script type="text/javascript" src="/js/jQuery/plugin/jquery.jcarousel.min.js"></script>
<script type="text/javascript" src="/js/jQuery/plugin/jquery.selectbox.js"></script>