/* * jquery flexslider v2.1 * http://www.qifeiye.com/flexslider/ * * copyright 2012 bitthemes * free to use under the gplv2 license. * http://www.gnu.org/licenses/gpl-2.0.html * * contributing author: tyler smith (@mbmufffin) */ (function(d){d.flexslider=function(j,l){var a=d(j),c=d.extend({},d.flexslider.defaults,l),e=c.namespace,q="ontouchstart"in window||window.documenttouch&&document instanceof documenttouch,u=q?"touchend":"click",m="vertical"===c.direction,n=c.reverse,h=0g?a.gettarget("next"):a.gettarget("prev");a.flexanimate(d,c.pauseonaction)});c.pauseplay&&f.pauseplay.setup();c.slideshow&&(c.pauseonhover&&a.hover(function(){!a.manualplay&&!a.manualpause&&a.pause()}, function(){!a.manualpause&&!a.manualplay&&a.play()}),0');if(1':""+b+"",a.controlnavscaffold.append("
  • "+g+"
  • "),b++;a.controlscontainer?d(a.controlscontainer).append(a.controlnavscaffold):a.append(a.controlnavscaffold);f.controlnav.set();f.controlnav.active();a.controlnavscaffold.delegate("a, img",u,function(b){b.preventdefault();b=d(this);var g=a.controlnav.index(b);b.hasclass(e+"active")||(a.direction=g>a.currentslide?"next":"prev",a.flexanimate(g,c.pauseonaction))});q&&a.controlnavscaffold.delegate("a", "click touchstart",function(a){a.preventdefault()})},setupmanual:function(){a.controlnav=a.manualcontrols;f.controlnav.active();a.controlnav.live(u,function(b){b.preventdefault();b=d(this);var g=a.controlnav.index(b);b.hasclass(e+"active")||(g>a.currentslide?a.direction="next":a.direction="prev",a.flexanimate(g,c.pauseonaction))});q&&a.controlnav.live("click touchstart",function(a){a.preventdefault()})},set:function(){a.controlnav=d("."+e+"control-nav li "+("thumbnails"===c.controlnav?"img":"a"), a.controlscontainer?a.controlscontainer:a)},active:function(){a.controlnav.removeclass(e+"active").eq(a.animatingto).addclass(e+"active")},update:function(b,c){1"+a.count+"")):1===a.pagingcount?a.controlnavscaffold.find("li").remove():a.controlnav.eq(c).closest("li").remove();f.controlnav.set();1
  • '+c.prevtext+'
  • '+c.nexttext+"
  • ");a.controlscontainer?(d(a.controlscontainer).append(b),a.directionnav=d("."+e+"direction-nav li a",a.controlscontainer)):(a.append(b),a.directionnav=d("."+e+"direction-nav li a",a));f.directionnav.update();a.directionnav.bind(u,function(b){b.preventdefault();b=d(this).hasclass(e+"next")?a.gettarget("next"):a.gettarget("prev");a.flexanimate(b,c.pauseonaction)}); q&&a.directionnav.bind("click touchstart",function(a){a.preventdefault()})},update:function(){var b=e+"disabled";1===a.pagingcount?a.directionnav.addclass(b):c.animationloop?a.directionnav.removeclass(b):0===a.animatingto?a.directionnav.removeclass(b).filter("."+e+"prev").addclass(b):a.animatingto===a.last?a.directionnav.removeclass(b).filter("."+e+"next").addclass(b):a.directionnav.removeclass(b)}},pauseplay:{setup:function(){var b=d('
    ');a.controlscontainer? (a.controlscontainer.append(b),a.pauseplay=d("."+e+"pauseplay a",a.controlscontainer)):(a.append(b),a.pauseplay=d("."+e+"pauseplay a",a));f.pauseplay.update(c.slideshow?e+"pause":e+"play");a.pauseplay.bind(u,function(b){b.preventdefault();d(this).hasclass(e+"pause")?(a.manualpause=!0,a.manualplay=!1,a.pause()):(a.manualpause=!1,a.manualplay=!0,a.play())});q&&a.pauseplay.bind("click touchstart",function(a){a.preventdefault()})},update:function(b){"play"===b?a.pauseplay.removeclass(e+"pause").addclass(e+ "play").text(c.playtext):a.pauseplay.removeclass(e+"play").addclass(e+"pause").text(c.pausetext)}},touch:function(){function b(b){k=m?d-b.touches[0].pagey:d-b.touches[0].pagex;q=m?math.abs(k)k||a.currentslide===a.last&&0number(new date)-l&&50r/2)?a.flexanimate(m,c.pauseonaction):s||a.flexanimate(a.currentslide,c.pauseonaction,!0)}j.removeeventlistener("touchend",g,!1);f=k=e=d=null}var d,e,f,r,k,l,q=!1;j.addeventlistener("touchstart",function(k){a.animating?k.preventdefault():1===k.touches.length&&(a.pause(),r=m?a.h:a.w,l=number(new date),f=h&&n&&a.animatingto=== a.last?0:h&&n?a.limit-(a.itemw+c.itemmargin)*a.move*a.animatingto:h&&a.currentslide===a.last?a.limit:h?(a.itemw+c.itemmargin)*a.move*a.currentslide:n?(a.last-a.currentslide+a.cloneoffset)*r:(a.currentslide+a.cloneoffset)*r,d=m?k.touches[0].pagey:k.touches[0].pagex,e=m?k.touches[0].pagex:k.touches[0].pagey,j.addeventlistener("touchmove",b,!1),j.addeventlistener("touchend",g,!1))},!1)},resize:function(){!a.animating&&a.is(":visible")&&(h||a.domath(),s?f.smoothheight():h?(a.slides.width(a.computedw), a.update(a.pagingcount),a.setprops()):m?(a.viewport.height(a.h),a.setprops(a.h,"settotal")):(c.smoothheight&&f.smoothheight(),a.newslides.width(a.computedw),a.setprops(a.computedw,"settotal")))},smoothheight:function(b){if(!m||s){var c=s?a:a.viewport;b?c.animate({height:a.slides.eq(a.animatingto).height()},b):c.height(a.slides.eq(a.animatingto).height())}},sync:function(b){var g=d(c.sync).data("flexslider"),e=a.animatingto;switch(b){case "animate":g.flexanimate(e,c.pauseonaction,!1,!0);break;case "play":!g.playing&& !g.asnav&&g.play();break;case "pause":g.pause()}}};a.flexanimate=function(b,g,p,j,l){t&&1===a.pagingcount&&(a.direction=a.currentitema.w?2*c.itemmargin:c.itemmargin,b=(a.itemw+b)*a.move*a.animatingto, b=b>a.limit&&1!==a.visible?a.limit:b):b=0===a.currentslide&&b===a.count-1&&c.animationloop&&"next"!==a.direction?n?(a.count+a.cloneoffset)*r:0:a.currentslide===a.last&&0===b&&c.animationloop&&"prev"!==a.direction?n?0:(a.count+1)*r:n?(a.count-1-b+a.cloneoffset)*r:(b+a.cloneoffset)*r;a.setprops(b,"",c.animationspeed);if(a.transitions){if(!c.animationloop||!a.atend)a.animating=!1,a.currentslide=a.animatingto;a.container.unbind("webkittransitionend transitionend");a.container.bind("webkittransitionend transitionend", function(){a.wrapup(r)})}else a.container.animate(a.args,c.animationspeed,c.easing,function(){a.wrapup(r)})}c.smoothheight&&f.smoothheight(c.animationspeed)}};a.wrapup=function(b){!s&&!h&&(0===a.currentslide&&a.animatingto===a.last&&c.animationloop?a.setprops(b,"jumpend"):a.currentslide===a.last&&(0===a.animatingto&&c.animationloop)&&a.setprops(b,"jumpstart"));a.animating=!1;a.currentslide=a.animatingto;c.after(a)};a.animateslides=function(){a.animating||a.flexanimate(a.gettarget("next"))};a.pause= function(){clearinterval(a.animatedslides);a.playing=!1;c.pauseplay&&f.pauseplay.update("play");a.syncexists&&f.sync("pause")};a.play=function(){a.animatedslides=setinterval(a.animateslides,c.slideshowspeed);a.playing=!0;c.pauseplay&&f.pauseplay.update("pause");a.syncexists&&f.sync("play")};a.canadvance=function(b,g){var d=t?a.pagingcount-1:a.last;return g?!0:t&&a.currentitem===a.count-1&&0===b&&"prev"===a.direction?!0:t&&0===a.currentitem&&b===a.pagingcount-1&&"next"!==a.direction?!1:b===a.currentslide&& !t?!1:c.animationloop?!0:a.atend&&0===a.currentslide&&b===d&&"next"!==a.direction?!1:a.atend&&a.currentslide===d&&0===b&&"next"===a.direction?!1:!0};a.gettarget=function(b){a.direction=b;return"next"===b?a.currentslide===a.last?0:a.currentslide+1:0===a.currentslide?a.last:a.currentslide-1};a.setprops=function(b,g,d){var e,f=b?b:(a.itemw+c.itemmargin)*a.move*a.animatingto;e=-1*function(){if(h)return"settouch"===g?b:n&&a.animatingto===a.last?0:n?a.limit-(a.itemw+c.itemmargin)*a.move*a.animatingto:a.animatingto=== a.last?a.limit:f;switch(g){case "settotal":return n?(a.count-1-a.currentslide+a.cloneoffset)*b:(a.currentslide+a.cloneoffset)*b;case "settouch":return b;case "jumpend":return n?b:a.count*b;case "jumpstart":return n?a.count*b:b;default:return b}}()+"px";a.transitions&&(e=m?"translate3d(0,"+e+",0)":"translate3d("+e+",0,0)",d=void 0!==d?d/1e3+"s":"0s",a.container.css("-"+a.pfx+"-transition-duration",d));a.args[a.prop]=e;(a.transitions||void 0===d)&&a.container.css(a.args)};a.setup=function(b){if(s)a.slides.css({width:"100%", "float":"left",marginright:"-100%",position:"relative"}),"init"===b&&(q?a.slides.css({opacity:0,display:"block",webkittransition:"opacity "+c.animationspeed/1e3+"s ease",zindex:1}).eq(a.currentslide).css({opacity:1,zindex:2}):a.slides.eq(a.currentslide).fadein(c.animationspeed,c.easing)),c.smoothheight&&f.smoothheight();else{var g,p;"init"===b&&(a.viewport=d('
    ').css({overflow:"hidden",position:"relative"}).appendto(a).append(a.container),a.clonecount=0,a.cloneoffset= 0,n&&(p=d.makearray(a.slides).reverse(),a.slides=d(p),a.container.empty().append(a.slides)));c.animationloop&&!h&&(a.clonecount=2,a.cloneoffset=1,"init"!==b&&a.container.find(".clone").remove(),a.container.append(a.slides.first().clone().addclass("clone")).prepend(a.slides.last().clone().addclass("clone")));a.newslides=d(c.selector,a);g=n?a.count-1-a.currentslide+a.cloneoffset:a.currentslide+a.cloneoffset;m&&!h?(a.container.height(200*(a.count+a.clonecount)+"%").css("position","absolute").width("100%"), settimeout(function(){a.newslides.css({display:"block"});a.domath();a.viewport.height(a.h);a.setprops(g*a.h,"init")},"init"===b?100:0)):(a.container.width(200*(a.count+a.clonecount)+"%"),a.setprops(g*a.computedw,"init"),settimeout(function(){a.domath();a.newslides.css({width:a.computedw,"float":"left",display:"block"});c.smoothheight&&f.smoothheight()},"init"===b?100:0))}h||a.slides.removeclass(e+"active-slide").eq(a.currentslide).addclass(e+"active-slide")};a.domath=function(){var b=a.slides.first(), d=c.itemmargin,e=c.minitems,f=c.maxitems;a.w=a.width();a.h=b.height();a.boxpadding=b.outerwidth()-b.width();h?(a.itemt=c.itemwidth+d,a.minw=e?e*a.itemt:a.w,a.maxw=f?f*a.itemt:a.w,a.itemw=a.minw>a.w?(a.w-d*e)/e:a.maxwa.w?a.w:c.itemwidth,a.visible=math.floor(a.w/(a.itemw+d)),a.move=0a.w?(a.itemw+2*d)*a.count-a.w- d:(a.itemw+d)*a.count-a.w-d):(a.itemw=a.w,a.pagingcount=a.count,a.last=a.count-1);a.computedw=a.itemw-a.boxpadding};a.update=function(b,d){a.domath();h||(ba.controlnav.length)f.controlnav.update("add");else if("remove"===d&&!h||a.pagingcounta.last&&(a.currentslide-=1,a.animatingto-=1), f.controlnav.update("remove",a.last);c.directionnav&&f.directionnav.update()};a.addslide=function(b,e){var f=d(b);a.count+=1;a.last=a.count-1;m&&n?void 0!==e?a.slides.eq(a.count-e).after(f):a.container.prepend(f):void 0!==e?a.slides.eq(e).before(f):a.container.append(f);a.update(e,"add");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.added(a)};a.removeslide=function(b){var e=isnan(b)?a.slides.index(d(b)):b;a.count-=1;a.last=a.count-1;isnan(b)?d(b,a.slides).remove():m&&n?a.slides.eq(a.last).remove(): a.slides.eq(b).remove();a.domath();a.update(e,"remove");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.removed(a)};f.init()};d.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationloop:!0,smoothheight:!1,startat:0,slideshow:!0,slideshowspeed:7e3,animationspeed:600,initdelay:0,randomize:!1,pauseonaction:!0,pauseonhover:!1,usecss:!0,touch:!0,video:!1,controlnav:!0,directionnav:!0,prevtext:"previous",nexttext:"next", keyboard:!0,multiplekeyboard:!1,mousewheel:!1,pauseplay:!1,pausetext:"pause",playtext:"play",controlscontainer:"",manualcontrols:"",sync:"",asnavfor:"",itemwidth:0,itemmargin:0,minitems:0,maxitems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};d.fn.flexslider=function(j){void 0===j&&(j={});if("object"===typeof j)return this.each(function(){var a=d(this),c=a.find(j.selector?j.selector:".slides > li");1===c.length?(c.fadein(400), j.start&&j.start(a)):void 0==a.data("flexslider")&&new d.flexslider(this,j)});var l=d(this).data("flexslider");switch(j){case "play":l.play();break;case "pause":l.pause();break;case "next":l.flexanimate(l.gettarget("next"),!0);break;case "prev":case "previous":l.flexanimate(l.gettarget("prev"),!0);break;default:"number"===typeof j&&l.flexanimate(j,!0)}}})(jquery); function _vc_plugin_flexslider(){ jquery('.qfe_flexslider:not(".played")').each(function() { var this_element = jquery(this); this_element.addclass("played"); var sliderspeed = 800, slidertimeout = parseint(this_element.attr('data-interval'))*1000, sliderfx = this_element.attr('data-flex_fx'), slidershowdirection = this_element.attr('data-direction'), slidershowbottomnav = this_element.attr('data-bottom_nav'), minitems = this_element.attr('data-per-view'), itemwidth = this_element.attr('data-itemwidth'), slideshow = true; var body_width = jquery("body").width(); var img =null; var maxwidth = 0; this_element.find('img').each(function(){ if(jquery(this).width()>maxwidth){ maxwidth = jquery(this).width(); img = jquery(this); } }) if(maxwidth>body_width) { this_element.parent().parent().css("max-width","100%"); this_element.parent().parent().css("max-height","auto"); }else{ this_element.parent().parent().css("max-width","auto"); this_element.parent().parent().css("max-height","auto"); } if ( slidertimeout == 0 ) slideshow = false; if (slidershowdirection == 0) slidershowdirection= false; if (slidershowbottomnav == 0) slidershowbottomnav= false; this_element.flexslider({ animation: sliderfx, slideshow: slideshow, slideshowspeed: slidertimeout, sliderspeed: sliderspeed, controlnav: slidershowbottomnav, directionnav: slidershowdirection, smoothheight: true, minitems:minitems, itemwidth:itemwidth, after: function() { jquery.waypoints('refresh'); } }); }); }