嗨我有一个问题(不完全是问题,我已经解决了它,但它至少非常有趣)与IE(7-8)手机Opera和其他浏览器的jquery选择器的差异bahaviour .. 这里是我的榜样jquery选择器的问题和效率
<div id="galleryEl"><link href="http://designclub.cz/plugins/content/plugin_jw_sig/sig.css" rel="stylesheet" type="text/css">
<style type="text/css">.sig_cont {width:30px;height:20px;}</style>
<script type="text/javascript" src="http://designclub.cz/plugins/content/plugin_jw_sig/mootools.js"></script>
<script type="text/javascript" src="http://designclub.cz/plugins/content/plugin_jw_sig/slimbox.js"></script>
<div class="sig"><div class="sig_cont"><div class="sig_thumb"><a href="http://designclub.cz/images/stories/hp/hp-falper.jpg" rel="lightbox[sig0]" title="<b>hp-falper.jpg</b>" alt="hp-falper.jpg" target="_blank"><img src="http://designclub.cz/plugins/content/plugin_jw_sig/showthumb.php?img=hp/hp-falper.jpg&width=0&height=0&quality=0">
对不起格式:)
的问题是following..When我主要的现代浏览器很好用.. 但在IE(7-9)(6使用这个选择jQuery("#galleryEl .sig_thumb a").eq(index);
(指数确实是一个整数) ia没有测试过)它不是。当我查看IE开发者控制台时,它看起来像结果对象是某种简单的dom对象???我真的不确定,对js不熟练,但它似乎是这样:) 当我改变jQuery(".sig_thumb a").eq(index);
它选择正确的dom元素..标记是如此奇怪,因为它是一个joomla插件,我用它动态地创建背景幻灯片accroding文件夹结构..所以没有人知道从哪里出现这种奇怪的行为? 第二个问题..我真的想使它高效,所以在这种情况下哪种选择器是最好的选择?我知道当选择id时,jQuery使用js native方法,在tagName等情况下也是如此,但我真的不知道如果这个选择器(是否更好地使用id-tag-class-someOtherStuff或id-class-someOtherStuff,id-someOtherStuff(在id和结果对象之间有很多其他DOM元素}) 感谢您的帮助
由于这是point..I不知道为什么,是有可能的,也许很奇怪,我的Joomla配置?但同样的ID是真的有两次..: )第一个元素是空的,因此是纯DOM对象:D – simekadam 2011-04-29 13:22:23