Advertisement
baliniz

jquery.jlanding.js

Aug 9th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 14.95 KB | None | 0 0
  1. function landingmap(){jQuery(".fullwidthmapwrapper").jlandingmap()}!function(n){"use strict";n.fn.jparallax=function(){n(this).each(function(){function t(t,o,e){var a=-1*(t*s),l=r+" "+a+"px";n(i).css("background-position",l)}var i,o,e,a,r,s,l,d,c;i=n(this),l="SECTION"===n(i).prop("tagName")?i:n(this).parent(),a=n(i).css("backgroundPosition").split(" "),r=n(this).data("position"),s=n(this).data("speed");var u=function(){var t=function(){var t=o.top-n(window).height(),i=n(l).next().position().top;return{min:t,max:i,diff:i-t}};o=n(l).position(),e=t()},h=function(){setTimeout(function(){u(),f()},500)},f=function(){void 0!==e&&(d=jpobj.globaltop,c=null,d>=e.min&&d<=e.max&&(c=(d-e.min)/e.diff,t(c,d,e)))};joption.ismobile||(n(window).bind("load resize",h),n(window).bind("jscroll",f))})}}(jQuery),function(n){"use strict";n.fn.jnewparallax=function(){var t,i,o,e,a,r,s,l,d,c,u;t=this,i=n(this).parent(),o=n(this).data("position"),e=n(this).data("sizemode"),a=n(this).data("speed");var h=function(){setTimeout(function(){f(),g()},500)},f=function(){var a=function(){var t=n(i).position().top-n(window).height(),o=n(i).position().top+n(i).outerHeight();return{min:t,max:o,diff:o-t,wh:n(window).height()}},l=function(){n(t).attr("style","");var a=null,r=0,s=0;if("nostretch"===e)a={elewidth:n(t).width(),eleheight:n(t).height(),containerwidth:n(i).outerWidth(),containerheight:n(i).outerHeight()};else{var l=n.new_get_image_container_size(n(t),n(window),"zoom");n(t).css({height:l[0],width:l[1]}),a={eleheight:l[0],elewidth:l[1],containerwidth:n(i).outerWidth(),containerheight:n(i).outerHeight()}}return r=(a.containerheight-a.eleheight)/2,"center"===o?s=(a.containerwidth-a.elewidth)/2:"left"===o?s=0:"right"===o&&(s=a.containerwidth-a.elewidth),jpobj.doTranslate(t,s+"px",r+"px"),a.leftpos=s,a};r=a(),s=l()},p=function(n,i,o){c=-1*(s.eleheight-(s.eleheight-r.wh)-a*(r.wh/r.diff)-o+i*a),jpobj.doTranslate(t,s.leftpos+"px",Math.floor(c)+"px")},g=function(){void 0!==r&&(d=null,l=n(window).scrollTop(),l>=r.min&&l<=r.max&&(u=l-r.min,d=u/r.diff,p(l,d,u)))};joption.ismobile||(n(window).bind("load resize",h),n(window).bind("scroll",g))}}(jQuery),function(n){"use strict";n.fn.headingparallax=function(){function t(){if(d>a&&r>d){var t=0;t=(d-s-u)/l,n(f).css({opacity:1-.75*t});var i=t*l/2;jpobj.doTranslate(h,"0px",i+"px"),jpobj.doTranslate(f,"0px",i+"px"),c=1}else jpobj.doTranslate(h,"0px","0px"),jpobj.doTranslate(f,"0px","0px"),n(f).css({opacity:1}),c=0}function i(){d=jpobj.globaltop,t()}function o(){if(joption.ismobile)n(e).find(".video-fallback").show(),n(e).find(".youtubefullscreen").hide(),n(e).find(".video_toggle").hide();else{var t=n(e).find(".youtubefullscreen").data("url"),i=n.youtube_parser(t),o=1===n(e).find(".youtubefullscreen").data("static")?!0:!1;n(e).find(".youtubefullscreen").tubular({videoId:i,attachtobody:o})}}var e=n(this),a=0,r=0,s=0,l=0,d=0,c=0,u=n.jreducedtop();n(".bottomnav").length&&(u=0);var h=n(e).find(".bgholder"),f=n(e).find(".parallaxtext"),p=function(){s=n(e).offset().top,l=n(e).height(),a=s+u,r=s+l-u};n(window).bind("resize load",p);var g=n(e).data("slider-type");"youtube"===g&&o(),joption.ismobile||"chrome"!==jpobj.browser[0].toLowerCase()&&"firefox"!==jpobj.browser[0].toLowerCase()||n(window).bind("jscroll",i)},n.fn.fslandingslider=function(){n(this).each(function(){var t=this,i=n("ul",this),o=0,e=n(".text-slider-wrap ul li",this).length,a=n(i).data("speed"),r=0,s=function(o){var a=n(".text-slider-wrap",t).height();n(i).animate({top:a*(o%e)*-1},400)};return setInterval(function(){s(++o)},a),n(".callout",t).bind("click",function(){var i;n(t).parent().nextAll().each(function(){return"SECTION"===n(this).prop("tagName")?(i=this,!1):void 0}),r=n(window).width()>1024?n(i).offset().top+n.jreducedtoplanding()+1:n(i).offset().top,n("html, body").animate({scrollTop:r},700,"easeInOutQuad")}),this})},n.landingslitslider=function(t){n(".sliderloader").fadeIn();var i=function(){var t=n("#nav-arrows"),i=n("#nav-dots > span"),o=n("#slider").slitslider({onBeforeChange:function(n,t){i.removeClass("nav-dot-current"),i.eq(t).addClass("nav-dot-current")}}),e=function(){a()},a=function(){t.children(":last").on("click",function(){return o.next(),!1}),t.children(":first").on("click",function(){return o.previous(),!1}),i.each(function(t){n(this).on("click",function(e){var a=n(this);return o.isActive()||(i.removeClass("nav-dot-current"),a.addClass("nav-dot-current")),o.jump(t+1),!1})})};return{init:e}}(),o=function(){n(".sl-slider-wrapper").fadeIn(),n(".sliderloader").fadeOut(),i.init()},e=function(t){if(n(".sl-slide").length>t){var i=n(n(".sl-slide").get(t)).find(".bg-img ").css("background-image");i=i.replace("url(","").replace(")",""),i=i.replace('"',"").replace('"',"");var a=new Image;n(a).load(function(){e(++t)}).attr("src",i)}else o()};e(0);var a=0,r=0,s=0,l=0,d=0,c=0,u=n.jreducedtop();n(".bottomnav").length&&(u=0);var h=n(t).find(".sl-slider-wrapper"),f=function(){if(d>a&&r>d){var n=0;n=(d-s-u)/l;var t=n*l/2;jpobj.doTranslate(h,"0px",t+"px"),c=1}else jpobj.doTranslate(h,"0px","0px"),c=0},p=function(){d=jpobj.globaltop,f()},g=function(){s=n(h).offset().top,l=n(h).height(),a=s+u,r=s+l-u};n(window).bind("resize",g),n(window).bind("load",function(){setTimeout(g,1e3)}),joption.ismobile||"chrome"!==jpobj.browser[0].toLowerCase()&&"firefox"!==jpobj.browser[0].toLowerCase()||n(window).bind("jscroll",p)}}(jQuery),function(n){"use strict";n.fn.jlanding=function(){var t=this,i=function(){n(".landingslider",t).length&&n.landingslitslider(t)},o=function(){n(".product-slide",t).length&&n(".product-slide",t).each(function(){var t=n(this).data("column")?n(this).data("column"):3;n(this).owlCarousel({items:t,itemsDesktop:[1199,3],autoHeight:!0,itemsDesktopSmall:[979,3]})})},e=function(){n(".service-slide",t).length&&n(".service-slide",t).each(function(){var t=n(this).data("number")?n(this).data("number"):3;n(this).owlCarousel({items:t,itemsDesktop:[1199,3],autoHeight:!0,itemsDesktopSmall:[979,3]})})},a=function(){n(".testislide",t).length&&n(".testislide",t).owlCarousel({navigation:!1,slideSpeed:300,paginationSpeed:400,autoHeight:!0,singleItem:!0})},r=function(){n(".clientslider",t).length&&n(".clientslider",t).each(function(){var t=n(this).data("number")?n(this).data("number"):4;n(this).owlCarousel({items:t,autoHeight:!0,itemsDesktop:[1199,3],itemsDesktopSmall:[979,3]})})},s=function(){var t=function(){n(".landingmasonrywrapper .landingmasonryitem").each(function(t){var i=n(this).data("width").split("/"),o=n(".landingmasonryblock").width(),e=o*(i[0]/i[1]);n(this).width(Math.floor(e)),n(".landingmasonrywrapper").isotope("layout"),setTimeout(function(){n(".landingmasonrywrapper").isotope("layout")},1e3)})};n(".landingmasonryblock").length&&(n(".landingmasonrywrapper").isotope({itemSelector:".landingmasonryitem",masonry:{columnWidth:1}}),t(),n(window).bind("resize",t))},l=function(){var t=function(){if(!joption.ismobile){var t="janimate_start",i="100";n(".jeg_animate_sequence").length&&n(".jeg_animate_sequence").each(function(){var o=n(this),e=n(o).data("speed"),a=void 0==n(o).data("offset")?i:n(o).data("offset");o.waypoint(function(i){var a=n(o).find(".jeg_do_animate");n(a).each(function(i){var o=this;setTimeout(function(){n(o).addClass(t)},i*e)})},{offset:a+"%",triggerOnce:!0,context:window})}),n(".jeg_animate_random").length&&n(".jeg_animate_random").each(function(){var i=n(this).find(".jeg_do_animate");n(i).each(function(){var i=n(this);0===n(this).position().left?n(this).attr("data-position","janimpos-left"):n(this).parent().width()-50<n(this).position().left+n(this).width()&&n(this).attr("data-position","janimpos-right"),i.waypoint(function(o){setTimeout(function(){n(i).addClass(t)},100)},{offset:"95%",triggerOnce:!0,context:window})})}),n(".jeg_animate_single").length&&n(".jeg_animate_single").each(function(){var i=n(this);n(i).each(function(){var i=n(this);i.waypoint(function(o){setTimeout(function(){n(i).addClass(t)},100)},{offset:"98%",triggerOnce:!0,context:window})})}),n(".counter-wrapper").length&&n(".counter-wrapper").each(function(){var t=n(this);n(t).each(function(){var i=n(this);i.waypoint(function(i){n(t).find(".odometer").each(function(t){var i=n(this).attr("data-number"),o=n(this);setTimeout(function(){n(o).html(i)},200*t)})},{offset:"98%",triggerOnce:!0,context:window})})})}};n(window).bind("load",function(){setTimeout(t,500)})},d=function(){n(".newparallax").length&&n(".newparallax").each(function(){n(this).jnewparallax()})},c=function(){n(".parallaxbackground").length&&n(".parallaxbackground").each(function(){n(this).jparallax()})},u=function(){n(".movingbg").length&&!joption.ismobile&&n(".movingbg").each(function(){var t=n(this),i=n(t).css("backgroundPosition").split(" "),o=n(t).data("direction"),e=0,a=0,r=n(this).css("background-image");r=/^url\((['"]?)(.*)\1\)$/.exec(r),r=r?r[2]:"";var s=new Image;s.src=r;var l=n.jgetbrowser().toLowerCase();n(s).load(function(){var r=s.width,d=s.height,c=function(){"horizontal"===o?(e>r&&(e=0),"netscape"===l||"msie"===l?n(t).css("background-position-x",e++ +"px"):n(t).css("background-position",e++ +"px "+i[1])):"vertical"===o?(e>d&&(e=0),"netscape"===l||"msie"===l?n(t).css("background-position-y",e++ +"px"):n(t).css("background-position",i[0]+e++ +"px ")):"diagonal"===o&&(e>r&&(e=0),a>d&&(a=0),"netscape"===l||"msie"===l?(n(t).css("background-position-x",e++ +"px"),n(t).css("background-position-y",a++ +"px")):n(t).css("background-position",e++ +"px "+a++ +"px ")),requestAnimationFrame(c)};requestAnimationFrame(c)})})},h=function(){n(".fs-container").length&&n(".fs-container").fsfullheight([".headermenu",".responsiveheader",".topnavigation",".post-header"])},f=function(){n(".fslandingslider").length&&n(".fslandingslider").fslandingslider()},p=function(){if(n(".imageanimwrap",t).length){var i=function(){n(".imageanimwrap",t).each(function(){var t=n(n(this).find("img").get(0)).height();n(this).height(t)})};n(window).bind("load resize",i)}},g=function(){if(n(".pricing-table").length){var t=function(){n(".pricing-table").each(function(){var t=0;n(".pricing-list",this).each(function(){n(this).height()>t&&(t=n(this).height())}),n(".pricing-list",this).css({height:t})})};n(window).bind("load resize",t),n(document).bind("ready",t)}},m=function(){if(n(".landing-navigator").length){var t=function(){var t=n(".landing-navigator").height();n(".landing-navigator").css({top:(n(window).height()-t)/2}).fadeIn(2e3)};n(window).bind("load resize",t),n(document).bind("ready",t);var i=function(){var t=[],i=0,o=0,e=function(){i=jpobj.globaltop;for(var e=0;e<t.length;e++)i<t[e].begin?n(".landing-navigator").find("li[data-for='"+t[e].id+"'] .navigator-block-fill").css({height:"0%"}).removeClass("active"):i>t[e].end?n(".landing-navigator").find("li[data-for='"+t[e].id+"'] .navigator-block-fill").css({height:"100%"}).addClass("active"):i>=t[e].begin&&i<=t[e].end&&(o=Math.floor((i-t[e].begin)/(t[e].end-t[e].begin)*100),n(".landing-navigator").find("li[data-for='"+t[e].id+"'] .navigator-block-fill").css({height:o+"%"}).addClass("active"))},a=function(){t=[],n(".landingpagewrapper section").each(function(){var i=n(this);if(""!==i.data("title")){var o={begin:Math.floor(n(i).offset().top)+n.jreducedtoplanding(),end:Math.floor(n(i).offset().top)+n(i).outerHeight()+n.jreducedtoplanding(),element:i,id:n(i).attr("data-id")};t.push(o)}}),e(),n(window).unbind("jscroll",e),n(window).bind("jscroll",e)},r=function(){var t=n(this).data("for"),i=n("section[data-id='"+t+"']");n("html, body").animate({scrollTop:n(i).offset().top+n.jreducedtoplanding()+1},700,"easeInOutQuad")};a(),n(window).bind("resize",a),n(".landing-navigator li").bind("click",r).jtooltip({holder:n(".landing-navigator"),timeout:2e3})};n(document).bind("ready",i)}},w=function(){n(".video-wrap").jfullvideo(),n(".video_toggle").bind("click",function(){var t=n(this).parents("section").data("slider-type"),i=n(this).parent().find("video"),o=n(this).data("toogle"),e=n(this).data("on"),a=n(this).data("off");"on"===o?(n(this).data("toogle","off"),n(this).find("i").removeClass(e).addClass(a),"video"===t?n(i).prop("muted",!0):"youtube"===t&&window.player.mute()):(n(this).data("toogle","on"),n(this).find("i").removeClass(a).addClass(e),"video"===t?n(i).prop("muted",!1):"youtube"===t&&window.player.unMute())})},v=function(){if(n(".bottomnav").length){var t=n(".landing-bottom-nav").position().top,i=function(){t=n(".landing-bottom-nav").position().top},o=function(){jpobj.globaltop<t?n(".landing-bottom-nav").removeClass("sticky"):n(".landing-bottom-nav").addClass("sticky")};n(window).bind("load resize",function(){i(),n(window).bind("jscroll",o)})}},b=function(t){var i="main-mobile-menu";n(".mobile-menu-trigger").removeClass("active"),n("body").hasClass("menuopen")?(n("body").removeClass("menuopen").attr("role",""),n(".contentoverflow").hide()):(n(t).addClass("active"),n("body").addClass("menuopen").attr("role",i),n(".contentoverflow").show())},j=function(){n(window).bind("hashchange load",function(t){if(window.location.hash){var i=function(){var t=window.location.hash.substring(1),i=n("section[data-id='"+t+"']");n(i).length&&(n("html, body").animate({scrollTop:n(i).offset().top+n.jreducedtoplanding()+1},700,"easeInOutQuad"),console.log("Hashtag Link: "+t))};n("body").hasClass("menuopen")?(b(null),setTimeout(function(){i()},200)):i()}})},y=function(){n(".fullwidthmapwrapper").length&&do_load_googlemap("landingmap")},x=function(){i(),e(),r(),o(),s(),l(),a(),c(),d(),u(),h(),f(),p(),m(),g(),w(),n.portfolio_popup(),n(".jnpslider").length&&n(".jnpslider").jnpslider(),n(".headingparallax").length&&n(".headingparallax").headingparallax(),n("[data-typer-targets]").typer(),v(),j(),y()};x()}}(jQuery),function(n){"use strict";n.fn.jlandingmap=function(){return n(this).each(function(){var t=this,i=n(this).find(".mapcontainer").attr("id"),o=n(this).data("zoom"),e=[];n(".maplist .infowindow",t).each(function(t){e[t]={element:this,lat:parseFloat(n(this).data("lat")),lng:parseFloat(n(this).data("lng"))}});var a,r=new Array,s=new Array;if(void 0==google||void 0==google.maps.MapTypeId)return null;var l={mapTypeId:google.maps.MapTypeId.ROADMAP,disableDefaultUI:!0,scrollwheel:!1,navigationControl:!0,mapTypeControl:!0,scaleControl:!0,draggable:!0,panControl:!0,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.LEFT_BOTTOM}},d=new google.maps.Map(document.getElementById(i),l),c=new google.maps.LatLngBounds,u=function(n,t,i){return new google.maps.Marker({position:n,map:t,zIndex:10})},h=function(t,o,e){var a=new InfoBubble({map:d,content:t.element,position:e,shadowStyle:0,padding:0,backgroundColor:"rgba(125, 125, 125, 0.1)",borderRadius:5,arrowSize:10,borderWidth:.5,borderColor:"#fff",disableAutoPan:!0,hideCloseButton:!0,arrowPosition:40,backgroundClassName:"infowindowbg",arrowStyle:2});return google.maps.event.addListener(s[o],"click",function(){f(),a.open(d,s[o]),a.panToView(),google.maps.event.addListenerOnce(r[o],"domready",function(){var t="#"+i+" .closeme";n(t).click(function(){f()})})}),a},f=function(){for(var n=0;n<r.length;n++)r[n].close()},p=function(){for(var n=0;n<e.length;n++){var t=new google.maps.LatLng(e[n].lat,e[n].lng);s[n]=u(t,d,10),r[n]=h(e[n],n,t),c.extend(t)}};p(),d.setCenter(c.getCenter()),d.setZoom(o),a=c.getCenter()})}}(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement