在www链接上需要href div名称

时间:2013-07-22 15:45:17

标签: jquery http html navigation href

我需要我的链接看起来像www.name.com/#/welcome,欢迎成为同一页面的div。我做了一个看起来像这样的jquery:

(function($) {
    $.fn.Tab = function() {
        return this.each(function() {
            $(".menu-nav li").click(function() {

    $("#container").fadeIn('fast');
            $(".menu-nav li").removeClass('current');
    $('#home').removeClass('current');
            $(this).addClass("current");
            $(".tab_content").hide();
            var selected_tab = $(this).find("a").attr("href");
    var name_tab = $(this).find("a").attr("alt");
            $(selected_tab).fadeIn();
    $(document).attr('title', 'My Title | ' + name_tab);
            return false;
        });
        $('#home').addClass('current');
    $("#container").fadeOut('fast');
    $(".menu-nav li").removeClass('current');

    });
};
        $(function() {
            $(".menu-nav").Tab();
        });
})(jQuery);

我真的不想改变这段代码。此外,如果有人导航到我的链接,看起来像www.name.com/#/welcome,我想打开'id =“welcome”'div!

0 个答案:

没有答案