function autoimg(){ var imgwidth=$('.imgauto').width(), //设定初始值 width=100, height=100, bili=width/height, nn=imgwidth/bili; // if (imghight>nn){ $('.imgauto').attr("height",nn+"px"); // $('.imgauto').attr("width",nn*bili+"px"); // } } function tbox(){ //h = $(window).height(); var t = $(document).scrolltop(); if(t > 150){ $(".tbox").fadein(300); }else{ $(".tbox").fadeout(300); } } function addfavorite(){ var title = window.parent.document.title; var url = window.parent.location; var ua = navigator.useragent.tolowercase(); if (ua.indexof("msie 8") > -1) { external.addtofavoritesbar(url, title, ''); //ie8 } else { try { window.external.addfavorite(url, title); } catch (e) { try { window.sidebar.addpanel(title, url, ""); //firefox } catch (e) { alert("加入收藏失败,请使用ctrl+d进行添加"); } } } return false; } function sethome(url) { if (document.all) { document.body.style.behavior = 'url(#default#homepage)'; document.body.sethomepage(url); } else { alert("操作失败,请您手动在浏览器里设置!"); } } $(function(){ $('.tab-tle .tab-item').bind('mouseenter mouseleave',function(){ $('.tab-tle .tab-item .data_detail').hide(); $(this).find(".data_detail").show(); $(this).siblings().removeclass('cur').end().addclass('cur'); $(this).parent().next('.tab-tcon').find('.tab-item').hide().eq($(this).index()).show(); }).eq(0).trigger('mouseenter'); $(".prolist ul li").bind('mouseover',function(){ $(this).find(".img-l").stop(true).animate({right:0}); }).bind('mouseout',function(){ $(this).find(".img-l").stop(true).animate({right:-500}); }); /*$("#main-nav li").hover(function(){ var $submenu=$(this).find(".sub-menu"); if($submenu.length){ $(this).find(".m1").toggleclass("mover"); $submenu.toggle(); } });*/ var $submenu; $("#main-nav .nav-item").hover(function(){ $submenu=$(this).find(".sub-menu"); if($submenu.length){ $(this).find(".m1").addclass("mover"); $submenu.show(); } },function(){ if($submenu.length){ $(this).find(".m1").removeclass("mover"); $submenu.hide(); } }); $("#gotop").click(function(){ $(document).scrolltop(0); }) $(window).scroll(function(e){ tbox(); }) $("#keywords").focus(function(e){ $("#keywords_prompt").hide(); }).blur(function(e){$("#keywords_prompt").show();}); });