开发者

Hover and custom attribute isn't working on IE8

Hover and custom attribute isn't working for me at all on IE8, not even in compatibility mode. I have the following code(fiddle) which is working in mozilla, opera, safari, and chrome, but not IE8.

HTML

<ul>
    <li class="aniRunmated" bxTab="home_pane">Home</li>
    <li class="animated" bxTab="news_pane">News</li>
    <li class="animated" bxTab="project_pane">Project Outline</li>
    <li class="animated" bxTab="gallery_pane">Gallery</li>
    <li class="animated" bxTab="downloads_pane">Downloads</li>
    <li class="animated" bxTab="links_pane">Links</li>
</ul>

    <div id="home_pane" class="tabbed">Home</div>
    <div id="news_pane" class="tabbed">News</div>
    <div id="project_pane" class="tabbed">Project</div>
    <div id="gallery_pane" class="tabbed">Gallery</div>
    <div id="downloads_pane" class="tabbed">Downloads</div>
    <div id="links_pane" class="tabbed">Links</div> 

jQuery

$('li.animated').hover(function(){
        $(this)开发者_运维百科.addClass('active');
    },function(){;
        $(this).removeClass('active');
});

$('[bxTab]').click(function(){
        $('.tabbed').css('display','none');
        $('#'+$(this).attr('bxTab')).css('display','block');
}); 

I've tried usign different versions of jquery, 1.3.2 and 1.4.2 and nothing seems to work


$('li.animated').hover(function(){
        $(this).addClass('active');
    },function(){
        $(this).removeClass('active');
});

$('[bxTab]').click(function(){
        $('.tabbed').css('display','none');
        $('#'+$(this).attr('bxTab')).css('display','block');
}); 

There was additional semicolen remved. Thanks for the tip.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜