com/my/?type=typelastmodify',
'success': function(msg){
nav.find('li[rel]').each(function(i, n){
var r = $(n).attr('rel');
if(typeof(visit[r]) != 'undefined' && typeof(msg[r]) != 'undefined' && parseInt(visit[r]) < parseInt(msg[r])) $(n).find('a').append('<i class="new"></i>');
if(typeof(visit[r]) == 'undefined' && typeof(msg[r]) != 'undefined') visit[r] = parseInt(msg[r]);
});
cookie(ckn, JSON.stringify(visit), {'path': '/', 'domain': 'diyiapp.com', 'expires': '365'});
}
});*/
}

function initPager(){
var ct = $('*[datalist]');
var next = ct.find('.next');
var len = parseInt(ct.attr('datalist'));
if(ct.children().length >= len) {
next.show().find('a').text('鐐瑰嚮鍔犺浇鏇村鍐呭').click(function(){
var n = $(this);
//window.open(n.attr('href'));return;
if(n.attr('loadding') == '1') return false;
n.text('鍔犺浇涓紝璇风◢鍊...').attr('loadding', '1');
$.ajax({
'type': 'GET',
'url': n.attr('href'),
'success': function(html){
var evt = html.match(/(_czc.push\([^\)]+_trackEvent[^\)]+\))/g);
html = $(html);
data = html.find('*[datalist] li[class!=next]');
if(data.length > 0) {
_czc.push(['_trackPageview', n.attr('href').substring(7 + window.location.host.length)]);
if(evt != null) eval(evt[0]);
}
initLazyload('u', data);
next.before(data);
n.text('鐐瑰嚮鍔犺浇鏇村鍐呭').removeAttr('loadding').attr('href', html.find('*[datalist] li.next a').attr('href'));
if(data.length < len) n.hide();
initD();initSize();
win.trigger('scroll');
}
});
return false;
});
}
}

function initHeadpic(){
var root = $('section.headpic');
var pic = root.find('img');
if(pic.length > 0) {
var count = function(){
var w = parseInt(pic.attr('relwidth'));
var h = parseInt(pic.attr('relheight'));
var s = w / h;
var rw = root.width();
if(rw > w) {
root.css({'height': h});
pic.css({'margin': 'auto'});
}
else if(w < 1280) {
var hh = parseInt(rw / s);
root.css({'height': hh});
pic.css({'width': rw});
}
else {
var sw = parseInt((rw - 320) / (w - 320) * (w - 1280) + 1280);
var ss = sw / h;
var hh = rw / ss;
var m = -(hh * s - rw) / 2;
root.css({'height': parseInt(hh)});
pic.css({'margin': '0 ' + parseInt(m) + 'px'});
}
root.show();
}
count();
win.bind('resize', count);
}
}

function initUser(){
var r = $('header .func .login');
var uid = cookie('DIYIAPP_USER_UID');
var username = cookie('DIYIAPP_USER_NAME');
var hash = cookie('DIYIAPP_USER_HASH');
if(username != null && hash != null) {
r.addClass('user').css({'background': 'url(http://uc.diyiapp.com/avatar.php?uid=' + uid + '&size=small)','backgroundSize': '32px 32px'});
}
}

$(function(){
$('a').on('touchstart', function(){
$('a.hover').removeClass('hover');
$(this).addClass('hover');
}).on('touchend', function(){
$(this).removeClass('hover');
});
});




Prev |
Pg.: 1 ... 18 19 20 21 22 23


Back to home | File page

Subscribe | Register | Login | N