window.onload = function(){ $('.clicknum').each(function(i){ var url="[!--news.url--]e/public/ViewClick?&down=0&nojs=1&classid="+$(this).attr("data-class")+"&id="+$(this).attr("data-id"); $(this).load(url); }); } //文档加载完后执行,load函数,动态加载点击数
3秒后跳转
setTimeout(function(){window.location = '/e/member/cp/'; }, 3000);
$('li').filter(function(index){return /love/.test($(this).attr('id'));}).css('background-color', 'red'); //filter匿名函数筛选 $('li').filter(function(index){return $('p',this).length==1;}).css('background-color', 'red'); $('li').filter(function(index){return index%4;}).css('background-color', 'red');
$(function(){
var jhcpath=window.location.pathname.replaceAll('/','');
$('div.left').find("a[href*="+jhcpath+"]").css("color", "#DC3125");
});