js Dom className(ie6下的诡异)
时间:2010-12-21 来源:chesihui
解决办法:设置固定的高度,如
1、html
<ul class="doc"> <li class="btn-wrap"> <button type="submit" class="sbm"> <span id="look"></span>查看适合的保险</button> </li> </ul>
2、css
.sbm span{left:0px;top:0px;position:absolute;width:100%;background:url(http://img01.taobaocdn.com/tps/i1/T10a0VXdREXXXXXXXX-112-44.png) left top no-repeat;} .sbm:hover span{background-position:0 -24px}
3、js
<script> YUI().use('node', function(Y){ if(Y.UA.ie === 6){ Y.one('.sbm span').on('mouseover',function(e){ //e.target.addClass('shover'); document.getElementById('look').className = 'sss'; }) Y.one('.sbm span').on('mouseout',function(e){ e.target.removeClass('shover'); }); } }) </script>
DEMO:http://files.cnblogs.com/cheche/test.rar
相关阅读 更多 +