/********************************************* * 自定义 ********************************************/ (function(){ // 首页产品 $('#icase ') var $id = $('#icase'), $list = $id.find('.list'), $tip = $id.find('.tip'), $prev = $id.find('.prev'), $next = $id.find('.next'), t, _width = ($id.find('.main').width() - 2)*.4444, _interval = 7000, _speed = 800, _index = 0, _size = $list.children('*').length; $list.append($list.html()) .width(2*(_width + 2)*_size) .children('*').width(_width); if($tip.length){ var _html = ''; for(var i=0; i<_size; i++){ if(i==0){ _html += '
  • '; }else{ _html += '
  • '; } } $tip.html(_html); } function _resize(){ _width = ($id.find('.main').width() - 2)*.4444; $list.width(2 * (_width + 2) * _size) .css({'left': - (_width + 2) * _index}) .children('*').width(_width); t = setInterval(function(){ _index ++; _next(); }, _interval); } function _prev(){ if(_index < 0){ $list.css({'left': -(_size) * (_width + 2)}); _index = _size - 1; } $list.stop(false, false).animate({'left': -_index * (_width + 2)}, _speed, 'easeInOutExpo'); $tip.children('*').eq(_index).addClass('current').siblings().removeClass('current'); } function _next(){ if(_index > _size){ $list.css({'left': 0}); _index = 1; } $list.stop(false, false).animate({'left': -_index * (_width + 2)}, _speed, 'easeInOutExpo'); $tip.children('*').eq(_index).addClass('current').siblings().removeClass('current'); } $tip.children('*').click(function(){ _index = $(this).index(); _next(); }) $prev.bind('click', function(){ _index --; _prev(); }) $next.bind('click', function(){ _index ++; _next(); }) $id.hover( function(){ clearInterval(t); }, function(){ t = setInterval(function(){ _index ++; _next(); }, _interval); } ) $(window).bind('resize', function(){ _width = $id.find('.main').width()*.25; clearInterval(t); _resize(); }) t = setInterval(function(){ _index ++; _next(); }, _interval); })(); (function(){ $('#searcher .button').bind({ 'click': function(){ $(this).parent().addClass('active'); } }) // 首页图片 $('#iphoto').scroller({ 'offset': 15, 'number': 1 }) })(); $(function(){ //悬浮 $(".jing_pointer").bind('click', function(){ if($(this).hasClass('active')){ $(this).removeClass('active').siblings().show(); }else{ $(this).addClass('active').siblings().hide(); } }); $('.btop').click(function(){ $('html, body').stop().animate({'scrollTop': 0}, 200); }) $('.itop').click(function(){ $('html, body').stop().animate({'scrollTop': 0}, 200); }) $('.sso').bind('click', function(){ if($(this).siblings('.searcher').is(':hidden')){ $(this).siblings('.searcher').slideDown(300);// 超链接跳转 }else{ $(this).siblings('.searcher').slideUp(300); } }) // 详情页定位 $('.relink a').each(function(){ $(this).attr({'href': $(this).attr('href') + '#location'}); }) }); (function(){ $(".nav li").each(function() { if(!$(this).find("a").length){ $(this).children(".subNav").remove(); } }) $(".nav li").hover( function(){ $(this).children(".subNav").stop().slideDown(300); }, function(){ $(this).children(".subNav").stop().slideUp(300); } ) $("#inav").hover( function(){ $(this).children(".drop").stop().slideDown(300); }, function(){ $(this).children(".drop").stop().slideUp(300); } ) $('#menu dd').each(function(){ if(!$(this).find('.drop li').length){ $(this).find('.drop').remove(); } }) $('#menu dd').hover( function(){ $(this).addClass('active'); $(this).children('.drop').stop().slideDown(200); }, function(){ $(this).removeClass('active'); if(!$(this).hasClass('current')){ $(this).children('.drop').stop().slideUp(200); } } ) }()); (function(){ var $toolbar = $('#toolbar'); $toolbar.find('.code a').bind({ 'mouseenter': function(){ $(this).next().stop().show(200); }, 'mouseleave': function(){ $(this).next().stop().hide(200); } }) $toolbar.find('.tel a').bind({ 'mouseenter': function(){ $(this).next().stop().animate({'width': 162}, 200); }, 'mouseleave': function(){ $(this).next().stop().animate({'width': 0}, 200); } }) $toolbar.find('.close').bind({ 'click': function(){ $toolbar.children('.pointer').show(300).next().hide(); } }) $toolbar.find('.pointer').bind({ 'click': function(){ $toolbar.children('.inner').show(300).prev().hide(); } }) }());