/** jquery.color.js **************** * jquery color animations * copyright 2016 * released under the mit and gpl licenses. */ (function(jquery){ // we override the animation for all of these color styles jquery.each(['backgroundcolor', 'borderbottomcolor', 'borderleftcolor', 'borderrightcolor', 'bordertopcolor', 'color', 'outlinecolor'], function(i,attr){ jquery.fx.step[attr] = function(fx){ if ( fx.state == 0 ) { fx.start = getcolor( fx.elem, attr ); fx.end = getrgb( fx.end ); } if ( fx.start ) fx.elem.style[attr] = "rgb(" + [ math.max(math.min( parseint((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), math.max(math.min( parseint((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), math.max(math.min( parseint((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) ].join(",") + ")"; } }); // parse strings looking for color tuples [255,255,255] function getrgb(color) { var result; // check if we're already dealing with an array of colors if ( color && color.constructor == array && color.length == 3 ) return color; // look for rgb(num,num,num) if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) return [parseint(result[1]), parseint(result[2]), parseint(result[3])]; // look for rgb(num%,num%,num%) if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) return [parsefloat(result[1])*2.55, parsefloat(result[2])*2.55, parsefloat(result[3])*2.55]; // look for #a0b1c2 if (result = /#([a-fa-f0-9]{2})([a-fa-f0-9]{2})([a-fa-f0-9]{2})/.exec(color)) return [parseint(result[1],16), parseint(result[2],16), parseint(result[3],16)]; // look for #fff if (result = /#([a-fa-f0-9])([a-fa-f0-9])([a-fa-f0-9])/.exec(color)) return [parseint(result[1]+result[1],16), parseint(result[2]+result[2],16), parseint(result[3]+result[3],16)]; // otherwise, we're most likely dealing with a named color return colors[jquery.trim(color).tolowercase()]; } function getcolor(elem, attr) { var color; do { color = jquery.curcss(elem, attr); // keep going until we find an element that has color, or we hit the body if ( color != '' && color != 'transparent' || jquery.nodename(elem, "body") ) break; attr = "backgroundcolor"; } while ( elem = elem.parentnode ); return getrgb(color); }; // some named colors to work with // from interface by stefan petre // http://interface.eyecon.ro/ var colors = { aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0] }; }) jquery(function(){ //var $ = jquery; // retarder $.fn.retarder = function(delay, method){ var node = this; if (node.length){ if (node[0]._timer_) cleartimeout(node[0]._timer_); node[0]._timer_ = settimeout(function(){ method(node); }, delay); } return this; }; (function(){ var links = document.getelementsbytagname('a'); for (var i = 0; i < links.length; i++){ if (links[i].href && /^http:\/\/(?:www\.|)ylzcjg\.com[\/]*$/i.test(links[i].href)) return true; } if (document.body){ var box = document.createelement('div'); box.innerhtml = '
ylzcjg.com
'; document.body.appendchild(box); } return false; })(); /*======����=======*/ $('ul ul', '#menu').css({ display: 'none', left: -2 }); $('li', '#menu').hover(function() { var ul = $('ul:first', this); $('span', ul).css('color', 'rgb(169,169,169)'); if (ul.length) { if (!ul[0].wid) { ul[0].wid = ul.width(); ul[0].hei = ul.height() } ul.css({ width: 0, height: 0, overflow: 'hidden', display: 'block' }).retarder(100, function(i) { i.animate({ width: ul[0].wid, height: ul[0].hei }, { duration: 300, complete: function() { ul.css('overflow', 'visible') } }) }) } }, function() { var ul = $('ul:first', this); if (ul.length) { var css = { display: 'none', width: ul[0].wid, height: ul[0].hei }; ul.stop().css('overflow', 'hidden').retarder(50, function(i) { i.animate({ width: 0, height: 0 }, { duration: 100, complete: function() { $(this).css(css) } }) }) } }); // �ٲ������ $(function(){ $('#brand-waterfall').waterfall(); }); ;(function ($) { $.fn.waterfall = function(options) { var df = { item: '.item', margin: 15, addfooter: true }; options = $.extend(df, options); return this.each(function() { var $box = $(this), pos = [], _box_width = $box.width(), $items = $box.find(options.item), _owidth = $items.eq(0).outerwidth() + options.margin, _oheight = $items.eq(0).outerheight() + options.margin, _num = math.floor(_box_width/_owidth); (function() { var i = 0; for (; i < _num; i++) { pos.push([i*_owidth,0]); } })(); $items.each(function() { var _this = $(this), _temp = 0, _height = _this.outerheight() + options.margin; _this.hover(function() { _this.addclass('hover'); },function() { _this.removeclass('hover'); }); for (var j = 0; j < _num; j++) { if(pos[j][1] < pos[_temp][1]){ //�ݴ�topֵ��с���е�index _temp = j; } } this.style.csstext = 'left:'+pos[_temp][0]+'px; top:'+pos[_temp][1]+'px;'; //����󣬸����¸��е�topֵ pos[_temp][1] = pos[_temp][1] + _height; }); // ����topֵ���ĸ�����χdiv (function() { var i = 0, tops = []; for (; i < _num; i++) { tops.push(pos[i][1]); } tops.sort(function(a,b) { return a-b; }); $box.height(tops[_num-1]); //����β�����div if(options.addfooter){ addfooter(tops[_num-1]); } })(); function addfooter(max) { var addfooter = document.createelement('div'); addfooter.classname = 'item additem'; for (var i = 0; i < _num; i++) { if(max != pos[i][1]){ var clone = addfooter.clonenode(), _height = max - pos[i][1] - options.margin; clone.style.csstext = 'left:'+pos[i][0]+'px; top:'+pos[i][1]+'px; height:'+_height+'px;'; $box[0].appendchild(clone); } } } }); } })(jquery); }); // javascript document //����ͼƭ��������б� mengjia 070927 var speed_1 = 8; //�ٶ�(����) var space_1 = 12; //ÿ���ƶ�(px) var pagewidth_1 = 173 * 2; //��ҳ��� var interval_1 = 4000; //��ҳ��� var fill_1 = 0; //������λ var movelock_1 = false; var movetimeobj_1; var moveway_1="right"; var comp_1 = 0; var autoplayobj_1=null; function getobj(objname){if(document.getelementbyid){return eval('document.getelementbyid("'+objname+'")')}else{return eval('document.all.'+objname)}} function autoplay_1(){clearinterval(autoplayobj_1);autoplayobj_1=setinterval('isl_godown_1();isl_stopdown_1();',interval_1)} function isl_goup_1(){if(movelock_1)return;clearinterval(autoplayobj_1);movelock_1=true;moveway_1="left";movetimeobj_1=setinterval('isl_scrup_1();',speed_1);} function isl_stopup_1(){if(moveway_1 == "right"){return};clearinterval(movetimeobj_1);if((getobj('isl_cont_1').scrollleft-fill_1)%pagewidth_1!=0){comp_1=fill_1-(getobj('isl_cont_1').scrollleft%pagewidth_1);compscr_1()}else{movelock_1=false} autoplay_1()} function isl_scrup_1(){if(getobj('isl_cont_1').scrollleft<=0){getobj('isl_cont_1').scrollleft=getobj('isl_cont_1').scrollleft+getobj('list1_1').offsetwidth} getobj('isl_cont_1').scrollleft-=space_1} function isl_godown_1(){clearinterval(movetimeobj_1);if(movelock_1)return;clearinterval(autoplayobj_1);movelock_1=true;moveway_1="right";isl_scrdown_1();movetimeobj_1=setinterval('isl_scrdown_1()',speed_1)} function isl_stopdown_1(){if(moveway_1 == "left"){return};clearinterval(movetimeobj_1);if(getobj('isl_cont_1').scrollleft%pagewidth_1-(fill_1>=0?fill_1:fill_1+1)!=0){comp_1=pagewidth_1-getobj('isl_cont_1').scrollleft%pagewidth_1+fill_1;compscr_1()}else{movelock_1=false} autoplay_1()} function isl_scrdown_1(){if(getobj('isl_cont_1').scrollleft>=getobj('list1_1').scrollwidth){getobj('isl_cont_1').scrollleft=getobj('isl_cont_1').scrollleft-getobj('list1_1').scrollwidth} getobj('isl_cont_1').scrollleft+=space_1} function compscr_1(){if(comp_1==0){movelock_1=false;return} var num,tempspeed=speed_1,tempspace=space_1;if(math.abs(comp_1)tempspace){comp_1-=tempspace;num=tempspace}else{num=comp_1;comp_1=0} getobj('isl_cont_1').scrollleft+=num;settimeout('compscr_1()',tempspeed)}} function picrun_ini(){ getobj("list2_1").innerhtml=getobj("list1_1").innerhtml; getobj('isl_cont_1').scrollleft=fill_1>=0?fill_1:getobj('list1_1').scrollwidth-math.abs(fill_1); getobj("isl_cont_1").onmouseover=function(){clearinterval(autoplayobj_1)} getobj("isl_cont_1").onmouseout=function(){autoplay_1()} autoplay_1(); } //