jquery - TypeError: Cannot read property 'style' of null (Javascript/Wordpress) -
i trying plug-in called appointment calendar work wordpress website, calendar supposed appear doesn't. reported error is
file: jquery.cycle.all.min.js uncaught typeerror: cannot read property 'style' of null [cycle] terminating; few slides: 1
here referred line:
``(function($){var ver="2.99";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function debug(s){$.fn.cycle.debug&&log(s);}function log(){window.console&&console.log&&console.log("[cycle] "+array.prototype.join.call(arguments," "));}$.expr[":"].paused=function(el){return el.cyclepause;};$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isready&&o.s){log("dom not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; 0 elements found selector"+($.isready?"":" (dom not ready)"));return this;}return this.each(function(){var opts=handlearguments(this,options,arg2);if(opts===false){return;}opts.updateactivepagerlink=opts.updateactivepagerlink||$.fn.cycle.updateactivepagerlink;if(this.cycletimeout){cleartimeout(this.cycletimeout);}this.cycletimeout=this.cyclepause=0;var $cont=$(this);var $slides=opts.slideexpr?$(opts.slideexpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; few slides: "+els.length);return;}var opts2=buildoptions($cont,$slides,els,opts,o);if(opts2===false){return;}var starttime=opts2.continuous?10:gettimeout(els[opts2.currslide],els[opts2.nextslide],opts2,!opts2.backwards);if(starttime){starttime+=(opts2.delay||0);if(starttime<10){starttime=10;}debug("first timeout: "+starttime);this.cycletimeout=settimeout(function(){go(els,opts2,0,!opts.backwards);},starttime);}});};function handlearguments(cont,options,arg2){if(cont.cyclestop==undefined){cont.cyclestop=0;}if(options===undefined||options===null){options={};}if(options.constructor==string){switch(options){case"destroy":case"stop":var opts=$(cont).data("cycle.opts");if(!opts){return false;}cont.cyclestop++;if(cont.cycletimeout){cleartimeout(cont.cycletimeout);}cont.cycletimeout=0;$(cont).removedata("cycle.opts");if(options=="destroy"){destroy(opts);}return false;case"toggle":cont.cyclepause=(cont.cyclepause===1)?0:1;checkinstantresume(cont.cyclepause,arg2,cont);return false;case"pause":cont.cyclepause=1;return false;case"resume":cont.cyclepause=0;checkinstantresume(false,arg2,cont);return false;case"prev":case"next":var opts=$(cont).data("cycle.opts");if(!opts){log('options not found, "prev/next" ignored');return false;}$.fn.cycle[options](opts);return false;default:options={fx:options};}return options;}else{if(options.constructor==number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false;}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false;}options.nextslide=num;if(cont.cycletimeout){cleartimeout(cont.cycletimeout);cont.cycletimeout=0;}if(typeof arg2=="string"){options.onetimefx=arg2;}go(options.elements,options,1,num>=options.currslide);return false;}}return options;function checkinstantresume(ispaused,arg2,cont){if(!ispaused&&arg2===true){var options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false;}if(cont.cycletimeout){cleartimeout(cont.cycletimeout);cont.cycletimeout=0;}go(options.elements,options,1,!options.backwards);}}}function removefilter(el,opts){if(!$.support.opacity&&opts.cleartype&&el.style.filter){try{el.style.removeattribute("filter");}catch(smother){}}}function destroy(opts){if(opts.next){$(opts.next).unbind(opts.prevnextevent);}if(opts.prev){$(opts.prev).unbind(opts.prevnextevent);}if(opts.pager||opts.pageranchorbuilder){$.each(opts.pageranchors||[],function(){this.unbind().remove();});}opts.pageranchors=null;if(opts.destroy){opts.destroy(opts);}}function buildoptions($cont,$slides,els,options,o){var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});if(opts.autostop){opts.countdown=opts.autostopcount||els.length;}var cont=$cont[0];$cont.data("cycle.opts",opts);opts.$cont=$cont;opts.stopcount=cont.cyclestop;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];if(!$.support.opacity&&opts.cleartype){opts.after.push(function(){removefilter(this,opts);});}if(opts.continuous){opts.after.push(function(){go(els,opts,0,!opts.backwards);});}saveoriginalopts(opts);if(!$.support.opacity&&opts.cleartype&&!opts.cleartypenobg){cleartypefix($slides);}if($cont.css("position")=="static"){$cont.css("position","relative");}if(opts.width){$cont.width(opts.width);}if(opts.height&&opts.height!="auto"){$cont.height(opts.height);}if(opts.startingslide){opts.startingslide=parseint(opts.startingslide);}else{if(opts.backwards){opts.startingslide=els.length-1;}}if(opts.random){opts.randommap=[];for(var i=0;i<els.length;i++){opts.randommap.push(i);}opts.randommap.sort(function(a,b){return math.random()-0.5;});opts.randomindex=1;opts.startingslide=opts.randommap[1];}else{if(opts.startingslide>=els.length){opts.startingslide=0;}}opts.currslide=opts.startingslide||0;var first=opts.startingslide;$slides.css({position:"absolute",top:0,left:0}).hide().each(function(i){var z;if(opts.backwards){z=first?i<=first?els.length+(i-first):first-i:els.length-i;}else{z=first?i>=first?els.length-(i-first):first-i:els.length-i;}$(this).css("z-index",z);});$(els[first]).css("opacity",1).show();removefilter(els[first],opts);if(opts.fit&&opts.width){$slides.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}var reshape=opts.containerresize&&!$cont.innerheight();if(reshape){var maxw=0,maxh=0;for(var j=0;j<els.length;j++){var $e=$(els[j]),e=$e[0],w=$e.outerwidth(),h=$e.outerheight();if(!w){w=e.offsetwidth||e.width||$e.attr("width");}if(!h){h=e.offsetheight||e.height||$e.attr("height");}maxw=w>maxw?w:maxw;maxh=h>maxh?h:maxh;}if(maxw>0&&maxh>0){$cont.css({width:maxw+"px",height:maxh+"px"});}}if(opts.pause){$cont.hover(function(){this.cyclepause++;},function(){this.cyclepause--;});}if(supportmultitransitions(opts)===false){return false;}var requeue=false;options.requeueattempts=options.requeueattempts||0;$slides.each(function(){var $el=$(this);this.cycleh=(opts.fit&&opts.height)?opts.height:($el.height()||this.offsetheight||this.height||$el.attr("height")||0);this.cyclew=(opts.fit&&opts.width)?opts.width:($el.width()||this.offsetwidth||this.width||$el.attr("width")||0);if($el.is("img")){var loadingie=($.browser.msie&&this.cyclew==28&&this.cycleh==30&&!this.complete);var loadingff=($.browser.mozilla&&this.cyclew==34&&this.cycleh==19&&!this.complete);var loadingop=($.browser.opera&&((this.cyclew==42&&this.cycleh==19)||(this.cyclew==37&&this.cycleh==17))&&!this.complete);var loadingother=(this.cycleh==0&&this.cyclew==0&&!this.complete);if(loadingie||loadingff||loadingop||loadingother){if(o.s&&opts.requeueonimagenotloaded&&++options.requeueattempts<100){log(options.requeueattempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cyclew,this.cycleh);settimeout(function(){$(o.s,o.c).cycle(options);},opts.requeuetimeout);requeue=true;return false;}else{log("could not determine size of image: "+this.src,this.cyclew,this.cycleh);}}}return true;});if(requeue){return false;}opts.cssbefore=opts.cssbefore||{};opts.cssafter=opts.cssafter||{};opts.cssfirst=opts.cssfirst||{};opts.animin=opts.animin||{};opts.animout=opts.animout||{};$slides.not(":eq("+first+")").css(opts.cssbefore);$($slides[first]).css(opts.cssfirst);if(opts.timeout){opts.timeout=parseint(opts.timeout);if(opts.speed.constructor==string){opts.speed=$.fx.speeds[opts.speed]||parseint(opts.speed);}if(!opts.sync){opts.speed=opts.speed/2;}var buffer=opts.fx=="none"?0:opts.fx=="shuffle"?500:250;while((opts.timeout-opts.speed)<buffer){opts.timeout+=opts.speed;}}if(opts.easing){opts.easein=opts.easeout=opts.easing;}if(!opts.speedin){opts.speedin=opts.speed;}if(!opts.speedout){opts.speedout=opts.speed;}opts.slidecount=els.length;opts.currslide=opts.lastslide=first;if(opts.random){if(++opts.randomindex==els.length){opts.randomindex=0;}opts.nextslide=opts.randommap[opts.randomindex];}else{if(opts.backwards){opts.nextslide=opts.startingslide==0?(els.length-1):opts.startingslide-1;}else{opts.nextslide=opts.startingslide>=(els.length-1)?0:opts.startingslide+1;}}if(!opts.multifx){var init=$.fn.cycle.transitions[opts.fx];if($.isfunction(init)){init($cont,$slides,opts);}else{if(opts.fx!="custom"&&!opts.multifx){log("unknown transition: "+opts.fx,"; slideshow terminating");return false;}}}var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true]);}if(opts.after.length){opts.after[0].apply(e0,[e0,e0,opts,true]);}if(opts.next){$(opts.next).bind(opts.prevnextevent,function(){return advance(opts,1);});}if(opts.prev){$(opts.prev).bind(opts.prevnextevent,function(){return advance(opts,0);});}if(opts.pager||opts.pageranchorbuilder){buildpager(els,opts);}exposeaddslide(opts,els);return opts;}function saveoriginalopts(opts){opts.original={before:[],after:[]};opts.original.cssbefore=$.extend({},opts.cssbefore);opts.original.cssafter=$.extend({},opts.cssafter);opts.original.animin=$.extend({},opts.animin);opts.original.animout=$.extend({},opts.animout);$.each(opts.before,function(){opts.original.before.push(this);});$.each(opts.after,function(){opts.original.after.push(this);});}function supportmultitransitions(opts){var i,tx,txs=$.fn.cycle.transitions;if(opts.fx.indexof(",")>0){opts.multifx=true;opts.fxs=opts.fx.replace(/\s*/g,"").split(",");for(i=0;i<opts.fxs.length;i++){var fx=opts.fxs[i];tx=txs[fx];if(!tx||!txs.hasownproperty(fx)||!$.isfunction(tx)){log("discarding unknown transition: ",fx);opts.fxs.splice(i,1);i--;}}if(!opts.fxs.length){log("no valid transitions named; slideshow terminating.");return false;}}else{if(opts.fx=="all"){opts.multifx=true;opts.fxs=[];for(p in txs){tx=txs[p];if(txs.hasownproperty(p)&&$.isfunction(tx)){opts.fxs.push(p);}}}}if(opts.multifx&&opts.randomizeeffects){var r1=math.floor(math.random()*20)+30;for(i=0;i<r1;i++){var r2=math.floor(math.random()*opts.fxs.length);opts.fxs.push(opts.fxs.splice(r2,1)[0]);}debug("randomized fx sequence: ",opts.fxs);}return true;}function exposeaddslide(opts,els){opts.addslide=function(newslide,prepend){var $s=$(newslide),s=$s[0];if(!opts.autostopcount){opts.countdown++;}els[prepend?"unshift":"push"](s);if(opts.els){opts.els[prepend?"unshift":"push"](s);}opts.slidecount=els.length;$s.css("position","absolute");$s[prepend?"prependto":"appendto"](opts.$cont);if(prepend){opts.currslide++;opts.nextslide++;}if(!$.support.opacity&&opts.cleartype&&!opts.cleartypenobg){cleartypefix($s);}if(opts.fit&&opts.width){$s.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$s.height(opts.height);}s.cycleh=(opts.fit&&opts.height)?opts.height:$s.height();s.cyclew=(opts.fit&&opts.width)?opts.width:$s.width();$s.css(opts.cssbefore);if(opts.pager||opts.pageranchorbuilder){$.fn.cycle.createpageranchor(els.length-1,s,$(opts.pager),els,opts);}if($.isfunction(opts.onaddslide)){opts.onaddslide($s);}else{$s.hide();}};}$.fn.cycle.resetstate=function(opts,fx){fx=fx||opts.fx;opts.before=[];opts.after=[];opts.cssbefore=$.extend({},opts.original.cssbefore);opts.cssafter=$.extend({},opts.original.cssafter);opts.animin=$.extend({},opts.original.animin);opts.animout=$.extend({},opts.original.animout);opts.fxfn=null;$.each(opts.original.before,function(){opts.before.push(this);});$.each(opts.original.after,function(){opts.after.push(this);});var init=$.fn.cycle.transitions[fx];if($.isfunction(init)){init(opts.$cont,$(opts.elements),opts);}};function go(els,opts,manual,fwd){if(manual&&opts.busy&&opts.manualtrump){debug("manualtrump in go(), stopping active transition");$(els).stop(true,true);opts.busy=0;}if(opts.busy){debug("transition active, ignoring new tx request");return;}var p=opts.$cont[0],curr=els[opts.currslide],next=els[opts.nextslide];if(p.cyclestop!=opts.stopcount||p.cycletimeout===0&&!manual){return;}if(!manual&&!p.cyclepause&&!opts.bounce&&((opts.autostop&&(--opts.countdown<=0))||(opts.nowrap&&!opts.random&&opts.nextslide<opts.currslide))){if(opts.end){opts.end(opts);}return;}var changed=false;if((manual||!p.cyclepause)&&(opts.nextslide!=opts.currslide)){changed=true;var fx=opts.fx;curr.cycleh=curr.cycleh||$(curr).height();curr.cyclew=curr.cyclew||$(curr).width();next.cycleh=next.cycleh||$(next).height();next.cyclew=next.cyclew||$(next).width();if(opts.multifx){if(opts.lastfx==undefined||++opts.lastfx>=opts.fxs.length){opts.lastfx=0;}fx=opts.fxs[opts.lastfx];opts.currfx=fx;}if(opts.onetimefx){fx=opts.onetimefx;opts.onetimefx=null;}$.fn.cycle.resetstate(opts,fx);if(opts.before.length){$.each(opts.before,function(i,o){if(p.cyclestop!=opts.stopcount){return;}o.apply(next,[curr,next,opts,fwd]);});}var after=function(){opts.busy=0;$.each(opts.after,function(i,o){if(p.cyclestop!=opts.stopcount){return;}o.apply(next,[curr,next,opts,fwd]);});};debug("tx firing("+fx+"); currslide: "+opts.currslide+"; nextslide: "+opts.nextslide);opts.busy=1;if(opts.fxfn){opts.fxfn(curr,next,opts,after,fwd,manual&&opts.fastonevent);}else{if($.isfunction($.fn.cycle[opts.fx])){$.fn.cycle[opts.fx](curr,next,opts,after,fwd,manual&&opts.fastonevent);}else{$.fn.cycle.custom(curr,next,opts,after,fwd,manual&&opts.fastonevent);}}}if(changed||opts.nextslide==opts.currslide){opts.lastslide=opts.currslide;if(opts.random){opts.currslide=opts.nextslide;if(++opts.randomindex==els.length){opts.randomindex=0;}opts.nextslide=opts.randommap[opts.randomindex];if(opts.nextslide==opts.currslide){opts.nextslide=(opts.currslide==opts.slidecount-1)?0:opts.currslide+1;}}else{if(opts.backwards){var roll=(opts.nextslide-1)<0;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextslide=1;opts.currslide=0;}else{opts.nextslide=roll?(els.length-1):opts.nextslide-1;opts.currslide=roll?0:opts.nextslide+1;}}else{var roll=(opts.nextslide+1)==els.length;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextslide=els.length-2;opts.currslide=els.length-1;}else{opts.nextslide=roll?0:opts.nextslide+1;opts.currslide=roll?els.length-1:opts.nextslide-1;}}}}if(changed&&opts.pager){opts.updateactivepagerlink(opts.pager,opts.currslide,opts.activepagerclass);}var ms=0;if(opts.timeout&&!opts.continuous){ms=gettimeout(els[opts.currslide],els[opts.nextslide],opts,fwd);}else{if(opts.continuous&&p.cyclepause){ms=10;}}if(ms>0){p.cycletimeout=settimeout(function(){go(els,opts,0,!opts.backwards);},ms);}}$.fn.cycle.updateactivepagerlink=function(pager,currslide,clsname){$(pager).each(function(){$(this).children().removeclass(clsname).eq(currslide).addclass(clsname);});};function gettimeout(curr,next,opts,fwd){if(opts.timeoutfn){var t=opts.timeoutfn.call(curr,curr,next,opts,fwd);while(opts.fx!="none"&&(t-opts.speed)<250){t+=opts.speed;}debug("calculated timeout: "+t+"; speed: "+opts.speed);if(t!==false){return t;}}return opts.timeout;}$.fn.cycle.next=function(opts){advance(opts,1);};$.fn.cycle.prev=function(opts){advance(opts,0);};function advance(opts,moveforward){var val=moveforward?1:-1;var els=opts.elements;var p=opts.$cont[0],timeout=p.cycletimeout;if(timeout){cleartimeout(timeout);p.cycletimeout=0;}if(opts.random&&val<0){opts.randomindex--;if(--opts.randomindex==-2){opts.randomindex=els.length-2;}else{if(opts.randomindex==-1){opts.randomindex=els.length-1;}}opts.nextslide=opts.randommap[opts.randomindex];}else{if(opts.random){opts.nextslide=opts.randommap[opts.randomindex];}else{opts.nextslide=opts.currslide+val;if(opts.nextslide<0){if(opts.nowrap){return false;}opts.nextslide=els.length-1;}else{if(opts.nextslide>=els.length){if(opts.nowrap){return false;}opts.nextslide=0;}}}}var cb=opts.onprevnextevent||opts.prevnextclick;if($.isfunction(cb)){cb(val>0,opts.nextslide,els[opts.nextslide]);}go(els,opts,1,moveforward);return false;}function buildpager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createpageranchor(i,o,$p,els,opts);});opts.updateactivepagerlink(opts.pager,opts.startingslide,opts.activepagerclass);}$.fn.cycle.createpageranchor=function(i,el,$p,els,opts){var a;if($.isfunction(opts.pageranchorbuilder)){a=opts.pageranchorbuilder(i,el);debug("pageranchorbuilder("+i+", el) returned: "+a);}else{a='<a href="#">'+(i+1)+"</a>";}if(!a){return;}var $a=$(a);if($a.parents("body").length===0){var arr=[];if($p.length>1){$p.each(function(){var $clone=$a.clone(true);$(this).append($clone);arr.push($clone[0]);});$a=$(arr);}else{$a.appendto($p);}}opts.pageranchors=opts.pageranchors||[];opts.pageranchors.push($a);$a.bind(opts.pagerevent,function(e){e.preventdefault();opts.nextslide=i;var p=opts.$cont[0],timeout=p.cycletimeout;if(timeout){cleartimeout(timeout);p.cycletimeout=0;}var cb=opts.onpagerevent||opts.pagerclick;if($.isfunction(cb)){cb(opts.nextslide,els[opts.nextslide]);}go(els,opts,1,opts.currslide<i);});if(!/^click/.test(opts.pagerevent)&&!opts.allowpagerclickbubble){$a.bind("click.cycle",function(){return false;});}if(opts.pauseonpagerhover){$a.hover(function(){opts.$cont[0].cyclepause++;},function(){opts.$cont[0].cyclepause--;});}};$.fn.cycle.hopsfromlast=function(opts,fwd){var hops,l=opts.lastslide,c=opts.currslide;if(fwd){hops=c>l?c-l:opts.slidecount-l;}else{hops=c<l?l-c:l+opts.slidecount-c;}return hops;};function cleartypefix($slides){debug("applying cleartype background-color hack");function hex(s){s=parseint(s).tostring(16);return s.length<2?"0"+s:s;}function getbg(e){for(;e&&e.nodename.tolowercase()!="html";e=e.parentnode){var v=$.css(e,"background-color");if(v&&v.indexof("rgb")>=0){var rgb=v.match(/\d+/g);return"#"+hex(rgb[0])+hex(rgb[1])+hex(rgb[2]);}if(v&&v!="transparent"){return v;}}return"#ffffff";}$slides.each(function(){$(this).css("background-color",getbg(this));});}$.fn.cycle.commonreset=function(curr,next,opts,w,h,rev){$(opts.elements).not(curr).hide();if(typeof opts.cssbefore.opacity=="undefined"){opts.cssbefore.opacity=1;}opts.cssbefore.display="block";if(opts.slideresize&&w!==false&&next.cyclew>0){opts.cssbefore.width=next.cyclew;}if(opts.slideresize&&h!==false&&next.cycleh>0){opts.cssbefore.height=next.cycleh;}opts.cssafter=opts.cssafter||{};opts.cssafter.display="none";$(curr).css("zindex",opts.slidecount+(rev===true?1:0));$(next).css("zindex",opts.slidecount+(rev===true?0:1));};$.fn.cycle.custom=function(curr,next,opts,cb,fwd,speedoverride){var $l=$(curr),$n=$(next);var speedin=opts.speedin,speedout=opts.speedout,easein=opts.easein,easeout=opts.easeout;$n.css(opts.cssbefore);if(speedoverride){if(typeof speedoverride=="number"){speedin=speedout=speedoverride;}else{speedin=speedout=1;}easein=easeout=null;}var fn=function(){$n.animate(opts.animin,speedin,easein,function(){cb();});};$l.animate(opts.animout,speedout,easeout,function(){$l.css(opts.cssafter);if(!opts.sync){fn();}});if(opts.sync){fn();}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq("+opts.currslide+")").css("opacity",0);opts.before.push(function(curr,next,opts){$.fn.cycle.commonreset(curr,next,opts);opts.cssbefore.opacity=0;});opts.animin={opacity:1};opts.animout={opacity:0};opts.cssbefore={top:0,left:0};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={activepagerclass:"activeslide",after:null,allowpagerclickbubble:false,animin:null,animout:null,autostop:0,autostopcount:0,backwards:false,before:null,cleartype:!$.support.opacity,cleartypenobg:false,containerresize:1,continuous:0,cssafter:null,cssbefore:null,delay:0,easein:null,easeout:null,easing:null,end:null,fastonevent:0,fit:0,fx:"fade",fxfn:null,height:"auto",manualtrump:true,next:null,nowrap:0,onpagerevent:null,onprevnextevent:null,pager:null,pageranchorbuilder:null,pagerevent:"click.cycle",pause:0,pauseonpagerhover:0,prev:null,prevnextevent:"click.cycle",random:0,randomizeeffects:1,requeueonimagenotloaded:true,requeuetimeout:250,rev:0,shuffle:null,slideexpr:null,slideresize:1,speed:1000,speedin:null,speedout:null,startingslide:0,sync:1,timeout:4000,timeoutfn:null,updateactivepagerlink:null};})(jquery);
the concerned website. can't manage find issue preventing calendar appear. checked few similar qs, no answer applicable issue. i'd appreciate skilled insight! in advance, m.
the issue indeed plug-in code... somehow ended old version of it, instead of using latest one. efforts, , sorry wasting time.
Comments
Post a Comment