//* ====== 设置单位尺寸 ====== */ $.fn.initSet = function(x,y){ var win = $(this); w_rem = win.width() / x, h_rem = win.height() / y; if(h_rem > w_rem){ rem = h_rem; }else{ rem = w_rem; } $('head').append(''); return rem; }; /* 根据当前栏目的标题条高度,重定位下方内容区域距离顶条的高度,避免被遮挡 */ var relayout = function(){ var titleArr = $('.main > .content .titleBar'); var contentArr = $('.main > .content .content'); for(var i=0;i\n'; $.each(data,function(i,o){ html += ' [' + (i+1) + ']' + o.name + '\n' + ' \n'; $.each(o.value,function(j,p){ console.log('zoom = ' + p.zoom + ' , p.url = ' + p.url + ' , p.name = ' + p.name); html += ' [' + (i+1) + '-' + (j<9?'0'+(j+1):(j+1)) + ']' + p.name + '\n'; }); html += ' \n' + ' \n'; }); html += ' \n' + ''; $(this).append(html); $('.doc').on('click',function(e){ var dom = $(this), li = dom.parents('li').eq(0), list = dom.parents('.treeList').eq(0).find('.leafItem'); if(!li.hasClass('active')){ list.removeClass('active'); li.addClass('active'); $('#docWrap').attr('src',dom.attr('title')).parents('.iframeWrap').eq(0).attr('class','iframeWrap ' + dom.attr('zoom')) } }); };