//header HTML var headerHtmls='
' + '
' + '
' + '
' + '' + '
' + '
' + '
' + '' + '
' + '
' + '<
' + '
'; //footer HTML var footHtmls='
' + '
' + '
' + ' ' + '
' + '
' + ' ' + '
' + '
' + ' ' + '
' + '
' + ' ' + '
' + '
' + '
' + ' '; $('#header').html(headerHtmls); $('#footer').html(footHtmls); /** *弹窗切换 **/ $(document).delegate('#nav li','click',function () { var _index = $(this).index(); // debugger console.log(_index); console.log( $('#nav>li').eq(_index)) console.log( $('#nav>li').eq(_index).siblings().html()) $('#nav>li').eq(_index).addClass('current').siblings().removeClass('current'); });