开发者

IE and JavaScript (jQuery) problems

开发者 https://www.devze.com 2023-03-10 04:52 出处:网络
I have a page that has mul开发者_JS百科tiple tabs that toggle the display of hidden elements. It uses the following js:

I have a page that has mul开发者_JS百科tiple tabs that toggle the display of hidden elements. It uses the following js:

$('document').ready(function() {

// Profile Tabs
$('ul.profile_tabs li').click(function(){
    var type = $(this).attr('type');

    $('.content-profile-title').css('display', 'none');
    $('.content-profile-display').css('display', 'none');

    $('#content-profile-title-'+type).css('display', 'block');
    $('#content-profile-display-'+type).css('display', 'block');

});
});

It grabs the type attribute of the ul element, and unhides the element with the corresponding ID.

Its working fine in FF and other browsers, just not IE! I get the following console message: "Object doesn't support this property or method" I've tried other methods like show/hide fadeIn/fadeOut..

Any help would be muchly apreciated :)


Don't use attributes to hold data. But if you have to, try something like title which is available to most elements.

0

精彩评论

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