PATH:
home
/
letacommog
/
lescompagnons
/
wp-content
/
plugins
/
elementor-extras
/
assets
/
lib
/
unfold
!function(o,e,n,t){o.unfold=function(t,s){var l={scope:o(e),text_closed:"Read more",text_open:"Read less",isolate:!0,duration_unfold:.5,duration_fold:.5,easing_unfold:"easeInOut",easing_fold:"easeInOut",animation_unfold:"Power4",animation_fold:"Power4",steps_unfold:10,steps_fold:10,slow_unfold:10,slow_fold:10,visible_lines:!1,visible_percentage:100,focusOnClose:!1,focusOnOpen:!1},a=this;a.opts={};var d=null,f=null,u=o(t),p=u.find(".ee-unfold__content"),r=u.find(".ee-unfold__mask"),c=u.find(".ee-unfold__separator"),_=u.find(".ee-unfold__trigger .ee-button"),h=_.find(".ee-button-text"),m=_.find(".ee-unfold__icon--closed"),g=_.find(".ee-unfold__icon--open"),v=-1,w=0,b=!1,y=null,O=0,T=!1;a.init=function(){a.opts=o.extend({},l,s),a._construct()},a._construct=function(){d=a.opts.scope,f=o("body"),v=d.width(),a.setup(),a.events()},a.hexToRgba=function(o,e){var n=parseInt(o.slice(1,3),16),t=parseInt(o.slice(3,5),16),i=parseInt(o.slice(5,7),16);return e?"rgba("+n+", "+t+", "+i+", "+e+")":"rgb("+n+", "+t+", "+i+")"},a.setup=function(){a.update()},a.events=function(){d.on("resize",function(){o(this).width()===v||T||a.setup(),v=o(this).width()}),_.on("click",function(){!0===T?a.close():a.open()})},a.onScroll=function(){w=d.scrollTop(),a.requestTick()},a.requestTick=function(){b||(y=requestAnimationFrame(a.update)),b=!0},a.getLineHeight=function(o){var t=e.getComputedStyle(o),i=null,s=n.createElement(o.nodeName);return s.setAttribute("style","margin:0px;padding:0px;font-family:"+t.fontFamily+";font-size:"+t.fontSize),s.innerHTML="test",s=o.parentNode.appendChild(s),i=s.clientHeight,s.parentNode.removeChild(s),i},a.update=function(){var n=p.find("> *");if(!1!==a.opts.visible_lines){var t=0;O=0,n.each(function(n){if(t<a.opts.visible_lines){var s=a.getLineHeight(this),l=o(this).height()/s,d=e.getComputedStyle(this);if(l>1&&isFinite(l)){var f=0;for(i=1;i<=l;i++)t<a.opts.visible_lines&&(O+=s,t++,f++);f===l&&(O+=parseInt(d.marginTop)+parseInt(d.marginBottom))}else O+=o(this).outerHeight(!0),t++}})}else O=a.opts.visible_percentage*p.outerHeight(!0)/100;T=!1,r.css({height:O})},a.destroy=function(){a.clearProps(),cancelAnimationFrame(y),d.off("scroll",a.onScroll),$item.removeData("unfold")},a.open=function(){var e=new TimelineLite({onComplete:function(){T=!0,h.html(a.opts.text_open),g.length&&(m.css("display","none"),g.css("display","inline-block"))}}),n=d.scrollTop(),t=0,i=d[0][a.opts.animation_unfold];"SlowMo"===a.opts.animation_unfold?i=i.config(a.opts.slow_unfold,.7,!1):"SteppedEase"===a.opts.animation_unfold?i=i.config(a.opts.steps_unfold):a.opts.easing_unfold&&(i=i[a.opts.easing_unfold]),e.add("open").to(r,a.opts.duration_unfold,{height:p.outerHeight(!0),ease:i,clearProps:"all"},"open").to(c,a.opts.duration_unfold/3,{autoAlpha:0,ease:Power1.easeIn},"-=0.1"),a.opts.focusOnOpen&&("top"===a.opts.focusOnOpen?t=p.offset().top:"scroll"===a.opts.focusOnOpen&&(t=n),o("html, body").animate({scrollTop:t},1e3*a.opts.duration_unfold))},a.close=function(){var e=new TimelineLite({onComplete:function(){T=!1,h.html(a.opts.text_closed),g.length&&(m.css("display","inline-block"),g.css("display","none"))}}),n=d[0][a.opts.animation_fold];"SlowMo"===a.opts.animation_fold?n=n.config(a.opts.slow_fold,.7,!1):"SteppedEase"===a.opts.animation_fold?n=n.config(a.opts.steps_fold):a.opts.easing_fold&&(n=n[a.opts.easing_fold]),e.add("close").to(c,a.opts.duration_fold/3,{autoAlpha:1,ease:Power1.easeOut},"close").to(r,a.opts.duration_fold,{height:O,ease:n},"-=0.1"),a.opts.focusOnClose&&o("html, body").animate({scrollTop:p.offset().top},1e3*a.opts.duration_fold)},a.init()},o.fn.unfold=function(e){return this.each(function(){if(o.fn.unfold.destroy=function(){void 0!==n&&(o(this).data("unfold").destroy(),o(this).removeData("unfold"))},void 0===o(this).data("unfold")){var n=new o.unfold(this,e);o(this).data("unfold",n)}})}}(jQuery,window,document);
[+]
..
[-] unfold.min.js
[edit]
[-] unfold.js
[edit]