$(document).ready(function() { $('.menu li').hover(function() { $(this).find(".m_nav").show(); }, function() { $(this).find(".m_nav").hide(); }); $('.menu li').hover(function() { $(this).find(".bb_nav").toggle(10); }); $('.yhzc').hover(function() { //$(this).toggleClass("open"); }); $('.khzc').hover(function() { //$(this).toggleClass("open"); }); /*$('.dropdown-toggle').click(function() { $(this).parent().toggleClass("open"); });*/ $(".dropdown-toggle").click(function(e){ e.stopPropagation(); $(".dropdown").toggleClass("open"); }); $(document).click(function(){ if(!$(".dropdown").is("open")){ $(".dropdown").removeClass("open"); } }); }); function on_delete() { return confirm('确定要退出吗?'); } function colse_a(){ $('#yyBox').removeAttr("style").removeClass().hide(); } function colse_b(){ $('#yyBox2').removeAttr("style").removeClass().hide();; } /*让IE支持placeholder属性 */ jQuery.fn.placeholder = function(){ var i = document.createElement('input'), placeholdersupport = 'placeholder' in i; if(!placeholdersupport){ var inputs = jQuery(this); inputs.each(function(){ var input = jQuery(this), text = input.attr('placeholder'), pdl = 0, height = input.outerHeight(), width = input.outerWidth(), placeholder = jQuery(''+text+''); try{ pdl = input.css('padding-left').match(/\d*/i)[0] * 1; }catch(e){ pdl = 5; } placeholder.css({'margin-left': -(width-pdl),'height':height,'line-height':height+"px",'position':'absolute', 'color': "#cecfc9", 'font-size' : "14px"}); placeholder.click(function(){ input.focus(); }); if(input.val() != ""){ placeholder.css({display:'none'}); }else{ placeholder.css({display:'inline'}); } placeholder.insertAfter(input); input.keyup(function(e){ if(jQuery(this).val() != ""){ placeholder.css({display:'none'}); }else{ placeholder.css({display:'inline'}); } }); }); } return this; }; /* $(function () { var $placeholder = $('input[placeholder]'); if ($placeholder.length > 0) { var attrPh = $placeholder.attr('placeholder'); $placeholder.attr('value', attrPh) .bind('focus', function () { var $this = $(this); if ($this.val() === attrPh) $this.val('').css('color', '#171207'); }).bind('blur', function () { var $this = $(this); if ($this.val() === '') $this.val(attrPh).css('color', '#333'); }); } });*/ /*左右滚动*/ function xMarquee(obj,fx,temp,speed){ obj = document.getElementById(obj); var xh = obj.innerHTML; var sid = 'xScroll_'+Math.floor(Math.random()*10000); var neh = ''; var fc ; if(fx==""||fx=="right"||fx==null){ neh = '
'+xh+'
'; obj.innerHTML = '
'+neh+neh+'
'; fc = document.getElementById(sid).childNodes; if(fc[0].offsetWidth<=obj.offsetWidth){obj.innerHTML = xh;return;} document.getElementById(sid).style.width = fc[0].offsetWidth*2+'px'; }else if(fx=="up"||fx=="down"){ neh = '
'+xh+'
'; obj.innerHTML = '
'+neh+neh+'
'; fc = document.getElementById(sid).childNodes; if(fc[0].offsetHeight<=obj.offsetHeight){obj.innerHTML = xh;return;} document.getElementById(sid).style.height = fc[0].offsetHeight*2+'px'; } var t = 0; if(fx==''||typeof fx == undefined||fx==null){fx = "left";} if(temp==''||typeof temp == undefined||temp==null){temp = 1;} if(speed==''||typeof speed == undefined||speed==null){speed = 50;} if(fx=="right"){obj.scrollLeft = fc[0].offsetWidth*2;t = fc[0].offsetWidth;} if(fx=="down"){obj.scrollTop = fc[0].offsetHeight*2;t = fc[0].offsetHeight;} var dos = function(speed){ if(fx=="left"){ t=t+temp; if(obj.scrollLeft>=fc[0].offsetWidth){ t = temp+3; obj.scrollLeft=temp+3; }else{ obj.scrollLeft=t; } } if(fx=="right"){ t=t-temp; if(obj.scrollLeft<=0){ t = fc[0].offsetWidth+3; obj.scrollLeft=fc[0].offsetWidth+3; }else{ obj.scrollLeft=t; } } if(fx=="up"){ t=t+temp; if(obj.scrollTop>=fc[0].offsetHeight){ t = temp+3; obj.scrollTop=temp+3; }else{ obj.scrollTop=t; } } if(fx=="down"){ t=t-temp; if(obj.scrollTop<=0){ t = fc[0].offsetHeight-3; obj.scrollTop=fc[0].offsetHeight-3; }else{ obj.scrollTop=t; } } } var s = window.setInterval(function(){dos(speed)},speed); var over = function(){ window.clearInterval(s); } var out = function(){ s = window.setInterval(function(){dos(speed)},speed); } try{ obj.addEventListener('mouseover',over,false); obj.addEventListener('mouseout',out,false); }catch(e){ //ie obj.attachEvent('onmouseover',over); obj.attachEvent('onmouseout',out); } } window.onload = function(){ xMarquee('xMarquee'); xMarquee('xMarquee2','right'); xMarquee('xMarquee3','up'); xMarquee('xMarquee4','down'); xMarquee('xMarquee5'); xMarquee('xMarquee6','right'); xMarquee('xMarquee7','up'); xMarquee('xMarquee8','down'); }