var curindex; var win = $(window); $(document).ready(function () { //$('#navlist li a').hover(function(){ // if(!$(this).hasclass('nav-btn')){ // $(this).addclass('hover'); // $('#expandzone').slideup(function () { // $(this).removeclass('active'); // $('#navlist .hover').removeclass('hover'); // }); // } // },function(){$(this).removeclass('hover');}) //$.each($('#navlist .nav-btn'), function (index, obj2) { // $(this).bind("mouseover", function () { // if (!$(this).hasclass('hover')) { // $('#navlist .nav-btn').removeclass('hover'); // $(this).addclass('hover'); // curindex = index; // var device = $(this).data('device'); // $(device).addclass('item-active').siblings().removeclass('item-active'); // $('#expandzone').delay(1000).slidedown().addclass('active'); // } // }) //}) // $('.wc-r').click(function(){ // $(this).hide().parent().children('.wc-t').slidedown(); // }); // $('.wc-t').click(function(){ // $(this).hide().parent().children('.wc-r').slidedown(); // }); // $('.slidebar .close').click(function(){ // $(this).parent('.slidebar li').stop().slideup(); // if($(this).parent('.slidebar li').siblings().is(':hidden')){ // $(this).parents('.slide-right').stop().slideup(); // } // }); //产品下拉、上缩 $('.newxmlistbtn').mousedown(function () { if ($(this).prev().height() == 282) { $(this).addclass('newxmlistbtncur').removeclass('newxmlistbtn'); $(this).prev().css('height', 'auto'); } else { $(this).removeclass('newxmlistbtncur').addclass('newxmlistbtn'); $(this).prev().css('height', '277'); } }); //产品标题二级下拉、上缩 $('.sort-list li').hover(function () { //$(this).addclass('hover').children("ul").stop(true, true).slidedown(); if ($(this).hasclass("hover")) { $(this).addclass('on').children("ul").stop(true, true).slidedown(); } else { $('.sort-list li.hover').addclass("hoverother"); $(this).addclass('on').children("ul").stop(true, true).slidedown(); } }, function () { //$(this).removeclass('hover').children("ul").stop(true, true).slideup(); if ($(this).hasclass("hover")) { $(this).removeclass('on').children("ul").stop(true, true).slideup(); } else { $('.sort-list li.hover').removeclass("hoverother"); $(this).removeclass('on').children("ul").stop(true, true).slideup(); } }); $(".sort-whole").bind("mouseover", function () { if ($(this).parent("li").hasclass("hover")) { $(this).parent("li").addclass("on"); $(this).show(); } else { $('.sort-list li.hover').addclass("hoverother"); $(this).parent("li").addclass("on"); $(this).show(); } }); $(window).scroll(function () { if ($(window).scrolltop() >= 150) { $('#actgotop').fadein(300); } else { $('#actgotop').hide(); } }); $('#actgotop').click(function () { $('html,body').animate({ scrolltop: '0px' }, 800); }); hanlerup(); bind(); history(); }); $(document).ready(function(){ $(".sernavlist2>li").click( function(){ var self = $(this); if(!self.closest('.sernavlist2 li').hasclass("hover")){ $('.sernavlist2 li').find('.xbox').stop().slideup(); $('.sernavlist2 li').removeclass("hover"); self.closest('.sernavlist2 li').addclass('hover').find('.xbox').stop().slidedown(); } else{ var self = $(this); self.closest('.sernavlist2 li').removeclass('hover').find('.xbox').stop().slideup(); } }); $(window).scroll(function () { var $this = $(this); var targettop2 = $(this).scrolltop(); if (targettop2 > 460) { $('#bgbai').show(); $(".sort-list").addclass("fixed"); $(".kongbai").removeclass("hidden"); } else { $(".sort-list").removeclass("fixed"); $(".kongbai").addclass("hidden"); $('#bgbai').hide(); } }) }); function history(){ if (!$('#slidepic')[0]) return; var i = 0, p = $('#slidepic ul'), plist = $('#slidepic ul li'), len = plist.length; var eleprev = $('#prev'), elenext = $('#next'); //var firstclick = false; var w = 155, num = 7; p.css('width',w*len); if (len <= num) elenext.addclass('gray'); function prev(){ if (eleprev.hasclass('gray')) { //alert('已经是第一张了'); return; } p.animate({ marginleft:-(--i) * w },500); if (i < len - num) { elenext.removeclass('gray'); } if (i == 0) { eleprev.addclass('gray'); } } function next(){ if (elenext.hasclass('gray')) { //alert('已经是最后一张了'); return; } //p.css('margin-left',-(++i) * w); p.animate({ marginleft:-(++i) * w },500); if (i != 0) { eleprev.removeclass('gray'); } if (i == len - num) { elenext.addclass('gray'); } } eleprev.bind('click',prev); elenext.bind('click',next); plist.each(function(n,v){ $(this).click(function(){ if(n-i == 2){ next(); } if(n-i == 0){ prev() } $('#slidepic ul li.cur').removeclass('cur'); }) }); } function bind(){ $('#expandzone').bind('mouseover', function() { $('#navlist .nav-btn').eq(curindex).addclass('hover'); }); $('#expandzone').bind('mouseleave', function() { $('#expandzone').slideup(function () { $(this).removeclass('active'); $('#navlist .hover').removeclass('hover'); }); }); } function hanlerup(){ $(".hrlist li h2").click( function () { var self = $(this); if (!self.hasclass("hover")) { $('.hrlist li').find('.htxt').stop().slideup(500); $(".hrlist li h2").removeclass("hover"); $(".hrlist li h2 b").text("查看职位"); self.addclass('hover'); self.find('b').text("收起职位"); self.closest('.hrlist li').find('.hrtxt').stop().slidedown(500); } else { self = $(this); self.removeclass('hover'); self.find("b").text("查看职位"); self.closest('.hrlist li').find('.hrtxt').stop().slideup(500); } }); } function showdiv(n, title, nodecode) { $('#popdiv' + n).fadein(); $('#bg').fadein(); $("#txtzhiwei").val(title); $("#txtnode").val(nodecode); } function closediv(n) { $('#popdiv' + n).fadeout(); $('#bg').hide(); }