islogin=0; function checkcookie(){ if(document.cookie.indexof('qr_u=')>=0){ islogin=1; return true; } return false; } checkcookie(); $(function(){ // drop-down $(".drop-down").hover(function(){ $(this).find(".drop-title").addclass("drop-title-hover"); $(this).find(".drop-box").show(); },function(){ $(this).find(".drop-title").removeclass("drop-title-hover"); $(this).find(".drop-box").hide(); }); }); $(document).ready(function(){ // ui-input $(".ui-input").focus(function(){ $(this).addclass("ui-input-focus"); }).hover(function(){ $(this).addclass("ui-input-hover"); },function(){ $(this).removeclass("ui-input-hover"); }); $(".ui-input").blur(function(){ $(this).removeclass("ui-input-focus"); }); // ui-form-placeholder $(".ui-form-placeholder").each(function(){ var _label = $(this).find(".ui-label"); var _input = $(this).find(".ui-input"); var _text = $(this).find(".ui-input").val(); if (_text != ""){ _label.hide(); } _label.css("z-index","3"); _label.click(function(){ $(this).hide(); _input.focus(); }); _input.focus(function(){ _label.hide(); }); }); // ui-button $(".ui-button").hover(function(){ $(this).addclass("ui-button-hover"); },function(){ $(this).removeclass("ui-button-hover"); }); // close-his $(".close-his").click(function(){ $(this).parents(".drop-box").hide(); }); // show-tipinfo $(".show-tipinfo a").hover(function(){ $(this).parent().parent().find(".tipinfo").show(); },function(){ $(this).parent().parent().find(".tipinfo").hide(); }); $("#wish").trigger('click'); // timeinfo $(".timeinfo").hover(function(){ $(this).addclass("timeinfo-active"); },function(){ $(this).removeclass("timeinfo-active"); }); // date list jquery $(".date-list").each(function(){ $lis = $(this).find("li:last").index(); if($lis > 5){ $(this).addclass("date-long"); } }); }); // tab menu js common function settab(name,cursel,n){ for(i=1;i<=n;i++){ var menu=document.getelementbyid(name+i); var con=document.getelementbyid("con_"+name+"_"+i); menu.classname=i==cursel?"current":""; con.style.display=i==cursel?"block":"none"; } } function checkcookie(){ if(document.cookie.indexof('baient_pro=')>=0){ islogin=1; return true; } return false; } checkcookie(); $(document).ready(function(){ // baby time step a tips $(".play-mode-list a").each(function(j,div){ $(this).click(function(){ //$("html,body").animate({scrolltop:$("#"+listid).offset().top}, 500); //我要平滑 if ($(this).parent().hasclass("current") ){ return; } var txt=$(this).attr("title").split('-'); $(".detail-pic .text").text(txt[1]); var listid=$(this).attr("id")+'-list'; if(listid !='bdhd-pl-list' && listid!='qvod-pl-list'){ $('#'+listid+' .txt').text('( 无需安装任何插件,即可快速播放 )'); } $(this).parent().nextall().removeclass("current"); $(this).parent().prevall().removeclass("current"); $(this).parent().addclass("current") $('.play-list-box').hide().css("opacity",0); $('.play-list-box:eq('+j+')').show().animate({"opacity":"1"},1200); }); }); //order $('#detail-list .order a').click(function(){ if($(this).hasclass('asc')){ $(this).removeclass('asc').addclass('desc').text('降序'); }else{ $(this).removeclass('desc').addclass('asc').text('升序'); } var a=$('.play-list-box:eq('+$(this).attr('data')+') .play-list'); var b=$('.play-list-box:eq('+$(this).attr('data')+') .play-list a'); a.html(b.get().reverse()); }); }); function intval(v) { v = parseint(v); return isnan(v) ? 0 : v; } // 获取元素信息 function getpos(e) { var l = 0; var t = 0; var w = intval(e.style.width); var h = intval(e.style.height); var wb = e.offsetwidth; var hb = e.offsetheight; while (e.offsetparent) { l += e.offsetleft + (e.currentstyle?intval(e.currentstyle.borderleftwidth):0); t += e.offsettop + (e.currentstyle?intval(e.currentstyle.bordertopwidth):0); e = e.offsetparent; } l += e.offsetleft + (e.currentstyle?intval(e.currentstyle.borderleftwidth):0); t += e.offsettop + (e.currentstyle?intval(e.currentstyle.bordertopwidth):0); return {x:l, y:t, w:w, h:h, wb:wb, hb:hb}; } // 获取滚动条信息 function getscroll() { var t, l, w, h; if (document.documentelement && document.documentelement.scrolltop) { t = document.documentelement.scrolltop; l = document.documentelement.scrollleft; w = document.documentelement.scrollwidth; h = document.documentelement.scrollheight; } else if (document.body) { t = document.body.scrolltop; l = document.body.scrollleft; w = document.body.scrollwidth; h = document.body.scrollheight; } return { t: t, l: l, w: w, h: h }; } // 锚点(anchor)间平滑跳转 function scroller(el, duration) { if(typeof el != 'object') { el = document.getelementbyid(el); } if(!el) return; var z = this; z.el = el; z.p = getpos(el); z.s = getscroll(); z.clear = function() { window.clearinterval(z.timer);z.timer=null }; z.t=(new date).gettime(); z.step = function() { var t = (new date).gettime(); var p = (t - z.t) / duration; if (t >= duration + z.t) { z.clear(); window.settimeout(function(){z.scroll(z.p.y, z.p.x)},13); } else { st = ((-math.cos(p*math.pi)/2) + 0.5) * (z.p.y-z.s.t) + z.s.t; sl = ((-math.cos(p*math.pi)/2) + 0.5) * (z.p.x-z.s.l) + z.s.l; z.scroll(st, sl); } }; z.scroll = function (t, l){window.scrollto(l, t)}; z.timer = window.setinterval(function(){z.step();},13); }