var jq=jQuery.noConflict(); jq(document).ready(function(){ jq(".green .cnt li:odd,.green .cnt dd:odd,.green .cnt dt:odd").addClass("odd"); jq("#latwg .cnt li:nth-child(even),#latgame .cnt dd:nth-child(even)").removeClass("odd"); jq("#map ol li:even").addClass("odd"); jq("#latest tr:nth-child(odd)").addClass("odd"); jq(".slist dl:odd").addClass("odd"); jq("#latest tr td:nth-child(1)").addClass("num"); jq("#latest tr td:nth-child(5)").addClass("date"); jq("#latest tr td:nth-child(6)").addClass("size"); jq("#latest tr td:nth-child(7)").addClass("dtimes"); jq("#atcside li").click(function(){ jq("#atcside li").removeClass("on"); jq(this).addClass("on"); jq("#atcside .cnt").hide(); jq("#atcside .cnt:eq("+jq(this).index()+")").show(); }) jq("#abtrank li").click(function(){ jq("#abtrank li").removeClass("on"); jq(this).addClass("on"); jq("#abtrank .cnt").hide(); jq("#abtrank .cnt:eq("+jq(this).index()+")").show(); }) jq("#abtranks li").click(function(){ jq("#abtranks li").removeClass("on"); jq(this).addClass("on"); jq("#abtranks .cnt").hide(); jq("#abtranks .cnt:eq("+jq(this).index()+")").show(); }) jq(".csort:odd h1").addClass("orange"); //文章页“更多分类”按钮 jq("#btnmore").hover(function(){ jq(this).children("dl").show(); },function(){ jq(this).children("dl").hide(); }) //测试效果,输入搜索文字,动态显示搜索结果 jq("#srch input:text").keyup(function(){ jq("#otpt").show(); }) jq(document).click(function(){ jq("#otpt").hide(); }) //测试效果结束 //首页专用 jq("#mix h2 li").click(function(){ jq("#mix h2 li").removeClass("on"); jq(this).addClass("on"); jq("#mix .bd").hide(); jq("#mix .bd:eq("+jq(this).index()+")").show(); }); jq("#antrio_list h2 li").click(function(){ jq("#antrio_list h2 li").removeClass("on"); jq(this).addClass("on"); jq("#antrio_list .bd").hide(); jq("#antrio_list .bd:eq("+jq(this).index()+")").show(); }) jq("#adidx li").click(function(){ jq("#adidx li").removeClass("on"); jq(this).addClass("on"); jq("#adidx .az").hide(); jq("#adidx .az:eq("+jq(this).index()+")").show(); }) jq("#hotsort h2 li").click(function(){ jq("#hotsort h2 li").removeClass("on"); jq(this).addClass("on"); jq("#hotsort .bd").hide(); jq("#hotsort .bd:eq("+jq(this).index()+")").show(); }) jq("#latgame .cnt dd:nth-child(4n+3),#latgame .cnt dd:nth-child(4n+4)").addClass("odd"); jq('#latgame .cnt li').css("float",'none'); jq('#atctt h2').click(function(){ showandhide(jq(this),"#atcbd"); }); jq('.history').mouseleave(function(){ jq('.history .list').hide(); jq('.history .a').css({ backgroundPosition:'0 30px' }); }); jq('.history').mouseover(function(){ jq('.history .list').show(); jq('.history .a').css({ backgroundPosition:'0 0' }); }); jq(".enew_tab a").each(function(i){ jq(this).attr('index',i); }) jq(".enew_tab a").click(function(){ var obj=jq("#latwg ul"); var num=jq(this).attr('index'); obj.hide(); obj.eq(num).show(); jq(".enew_tab a").removeClass('cur'); jq(this).addClass('cur'); }); jq(".game_class p").click(function(){ jq(this).parent().find('p').removeClass('selected'); jq(this).parent().parent().find('dl').hide(); jq(this).parent().parent().find('dl').eq(jq(this).attr('dl')).show(); jq(this).addClass('selected'); }); jq('.gameclass_nav p').click(function(){//首页热门游戏 jq('.gameclass_nav p').removeClass('selected'); jq(this).addClass('selected'); jq('#hotgame .bd').hide(); jq('.news_game').hide(); jq('.abc').hide(); jq('#hotgame .bd').eq(jq(this).index()).show(); jq('.news_game').eq(jq(this).index()).show(); jq('.abc').eq(jq(this).index()).show(); //jq('#sort').attr('val',jq(this).index()); //var li=jq('#sort li'),a=jq('#sort a'); // li.removeClass('on'); //a.removeClass('red'); //li.eq(0).addClass('on'); //a.eq(0).addClass('red'); //jq('#hotgame .bd').eq(jq('#sort').attr('val')).find('li').hide(); //jq('#hotgame .bd').eq(jq('#sort').attr('val')).find('li').eq(0).show(); }); jq('#antriod').hover(function(){ jq('.antriodClass').show(); },function(){ jq('.antriodClass').hide(); }); jq('.timeclass a').click(function(){ var obj=jq('.timeclass'); var pic=obj.parent().find('.pic'); obj.find('a').removeClass('selected'); jq(this).addClass('selected'); pic.hide(); pic.eq(jq(this).index()).show(); }); /*jq('#sort li').mouseover(function(){//abcdefg分类 jq('#sort li').removeClass('on'); jq('#sort a').removeClass('red'); jq(this).addClass('on'); jq(this).find('a').addClass('red'); jq('#hotgame .bd').eq(jq('#sort').attr('val')).find('li').hide(); jq('#hotgame .bd').eq(jq('#sort').attr('val')).find('li').eq(jq(this).index()).show(); });*/ //验证码刷新 jq("#reloadimg").click(function(){ var url = jq(this).attr('src'); url = url + '&rand='+Math.random(); jq(this).attr('src', url); }); jq("#reloadimg2").click(function(){ var url = jq(this).attr('src'); url = url + '&rand='+Math.random(); jq(this).attr('src', url); }); jq("#reloadimg3").click(function(){ var url = jq(this).attr('src'); url = url + '&rand='+Math.random(); jq(this).attr('src', url); }); //发布页 jq("#pub h2 li").click(function(){ jq("#pub h2 li").removeClass("on"); jq(this).addClass("on"); jq("#pub .bd").hide(); jq("#pub .bd:eq("+jq(this).index()+")").show(); }) //jq("input[name='em1']").click(function(){alert("投票成功!")}); jq(".sbm,.cls").hover(function(){jq(this).addClass("hv")},function(){jq(this).removeClass("hv")}); jq(".sbm,.cls").mousedown(function(){jq(this).addClass("down")}); jq(".sbm,.cls").mouseup(function(){jq(this).removeClass("down")}); jq(".sbm,.cls").mouseout(function(){jq(this).removeClass("down")}); jq(".slist dt .renqi").hover( function(){ jq(this).html('人气'); },function(){ jq(this).html(jq(this).attr('title')); } ); jq(".renqi3").live('mouseover', function(){ jq(this).html('人气'); }); jq(".renqi3").live('mouseout', function(){ jq(this).html(jq(this).attr('title')); }); //下载页 gamepic('#game_pic','#l','#r'); //上传页 jq('#set_time').click(function(){ var myDate = new Date(); var time=myDate.getFullYear()+"-"+(myDate.getMonth()+1)+"-"+myDate.getDate()+" "+myDate.getHours()+":"+myDate.getMinutes(); jq('#inputTime').val(time); }) if (jq('#set_time').val()) { var myDate = new Date(); var time=myDate.getFullYear()+"-"+(myDate.getMonth()+1)+"-"+myDate.getDate()+" "+myDate.getHours()+":"+myDate.getMinutes(); jq('#inputTime').val(time); } jq('#windows_true').click(function(){ jq('.windows_num').slideDown(500); }); jq('#windows_false').click(function(){ jq('.windows_num').slideUp(500); }) jq('#user,#try').click(function(){ jq('.empower').slideDown(500); }); jq('#free').click(function(){ jq('.empower').slideUp(500); }); point(); if(-[1,]){ HTMLElement.prototype.click = function(){//ff模拟鼠标点击事件 var evt = this.ownerDocument.createEvent('MouseEvents'); evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null); this.dispatchEvent(evt); } } }); function add(){ var str='