1// © Copyright 2025 - Archi 6.0 by Designesia 2 3jQuery(document).ready(function () { 4 'use strict'; // use strict mode 5 6 var preloader = 1; // 1 - enable, 0 - disable 7 var smooth_scroll = 0; // 1 - enable, 0 - disable 8 var de_header_style = 1; // 1 - solid, 2 - transparent 9 var de_header_layout = 1; // 1 - default, 2 - extended 10 var de_header_color = 1; // 1 - default, 2 - light style 11 var de_header_sticky = 1; // 1 - sticky, 2 - scroll 12 var de_header_mobile_sticky = 2; // 1 - sticky, 2 - scroll 13 var de_menu_separator = 1; // 1 - dotted, 2 - border, 3 - circle, 4 - square, 5 - plus, 6 - strip, 0 - none 14 var de_color_style = 1; // 1 - default, 2 - light style 15 var de_font_style = 1; // 1 - default, 2 - alternate font style 16 var de_force_mobile_menu = 0; // 1 - yes, 0 - no 17 var de_smooth_scroll = 1; // 1 - enable, 0 - disable 18 19 // init 20 var mobile_menu_show = 0; 21 var grid_size = 10; 22 var col = 4; 23 var tmp_col = col; 24 var sr = 466 / 700; 25 var $container = jQuery('#gallery'); 26 var v_count = '0'; 27 28 if (de_color_style == 2) { $('body').addClass('de_light'); } 29 if (de_font_style == 2) { $('head').append('<link rel="stylesheet" href="css/font-style-2.css" type="text/css" />'); } 30 if (de_header_style == 2) { $('header').addClass('transparent'); } 31 if (de_menu_separator == 1) { 32 $('#mainmenu').addClass('dotted-separator'); 33 } else if (de_menu_separator == 2) { 34 $('#mainmenu').addClass('line-separator'); 35 } else if (de_menu_separator == 3) { 36 $('#mainmenu').addClass('circle-separator'); 37 } else if (de_menu_separator == 4) { 38 $('#mainmenu').addClass('square-separator'); 39 } else if (de_menu_separator == 5) { 40 $('#mainmenu').addClass('plus-separator'); 41 } else if (de_menu_separator == 6) { 42 $('#mainmenu').addClass('strip-separator'); 43 } else if (de_menu_separator == 0) { 44 $('#mainmenu').addClass('no-separator'); 45 } 46 if (de_header_layout == 2) { $('header').addClass('de_header_2'); $('header .info').show(); } 47 if (de_header_color == 2) { $('header').addClass('header-light'); } 48 if (de_header_sticky == 2) { $('header').addClass('header-scroll'); } 49 if (de_header_mobile_sticky == 1) { $('header').addClass('header-mobile-sticky'); } 50 if (de_force_mobile_menu == 1) { $('header').addClass('force-header-mobile'); } 51 if (de_smooth_scroll == 1) { 52 !function(){var s,i,c,a,o={frameRate:150,animationTime:600,stepSize:100,pulseAlgorithm:!0,pulseScale:4,pulseNormalize:1,accelerationDelta:50,accelerationMax:3,keyboardSupport:!0,arrowScroll:50,fixedBackground:!0,excluded:""},p=o,u=!1,d=!1,n={x:0,y:0},f=!1,m=document.documentElement,l=[],h=/^Mac/.test(navigator.platform),w={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},v={37:1,38:1,39:1,40:1};function y(){if(!f&&document.body){f=!0;var e=document.body,t=document.documentElement,o=window.innerHeight,n=e.scrollHeight;if(m=0<=document.compatMode.indexOf("CSS")?t:e,s=e,p.keyboardSupport&&Y("keydown",x),top!=self)d=!0;else if(Q&&o<n&&(e.offsetHeight<=o||t.offsetHeight<=o)){var r,a=document.createElement("div");a.style.cssText="position:absolute; z-index:-10000; top:0; left:0; right:0; height:"+m.scrollHeight+"px",document.body.appendChild(a),c=function(){r=r||setTimeout(function(){u||(a.style.height="0",a.style.height=m.scrollHeight+"px",r=null)},500)},setTimeout(c,10),Y("resize",c);if((i=new R(c)).observe(e,{attributes:!0,childList:!0,characterData:!1}),m.offsetHeight<=o){var l=document.createElement("div");l.style.clear="both",e.appendChild(l)}}p.fixedBackground||u||(e.style.backgroundAttachment="scroll",t.style.backgroundAttachment="scroll")}}var b=[],g=!1,r=Date.now();function S(d,f,m){if(function(e,t){e=0<e?1:-1,t=0<t?1:-1,n.x===e&&n.y===t||(n.x=e,n.y=t,b=[],r=0)}(f,m),1!=p.accelerationMax){var e=Date.now()-r;if(e<p.accelerationDelta){var t=(1+50/e)/2;1<t&&(t=Math.min(t,p.accelerationMax),f*=t,m*=t)}r=Date.now()}if(b.push({x:f,y:m,lastX:f<0?.99:-.99,lastY:m<0?.99:-.99,start:Date.now()}),!g){var o=q(),h=d===o||d===document.body;null==d.$scrollBehavior&&function(e){var t=M(e);if(null==B[t]){var o=getComputedStyle(e,"")["scroll-behavior"];B[t]="smooth"==o}return B[t]}(d)&&(d.$scrollBehavior=d.style.scrollBehavior,d.style.scrollBehavior="auto");var w=function(e){for(var t=Date.now(),o=0,n=0,r=0;r<b.length;r++){var a=b[r],l=t-a.start,i=l>=p.animationTime,c=i?1:l/p.animationTime;p.pulseAlgorithm&&(c=F(c));var s=a.x*c-a.lastX>>0,u=a.y*c-a.lastY>>0;o+=s,n+=u,a.lastX+=s,a.lastY+=u,i&&(b.splice(r,1),r--)}h?window.scrollBy(o,n):(o&&(d.scrollLeft+=o),n&&(d.scrollTop+=n)),f||m||(b=[]),b.length?j(w,d,1e3/p.frameRate+1):(g=!1,null!=d.$scrollBehavior&&(d.style.scrollBehavior=d.$scrollBehavior,d.$scrollBehavior=null))};j(w,d,0),g=!0}}function e(e){f||y();var t=e.target;if(e.defaultPrevented||e.ctrlKey)return!0;
52if(N(s,"embed")||N(t,"embed")&&/\.pdf/i.test(t.src)||N(s,"object")||t.shadowRoot)return!0;var o=-e.wheelDeltaX||e.deltaX||0,n=-e.wheelDeltaY||e.deltaY||0;h&&(e.wheelDeltaX&&K(e.wheelDeltaX,120)&&(o=e.wheelDeltaX/Math.abs(e.wheelDeltaX)*-120),e.wheelDeltaY&&K(e.wheelDeltaY,120)&&(n=e.wheelDeltaY/Math.abs(e.wheelDeltaY)*-120)),o||n||(n=-e.wheelDelta||0),1===e.deltaMode&&(o*=40,n*=40);var r=z(t);return r?!!function(e){if(!e)return;l.length||(l=[e,e,e]);e=Math.abs(e),l.push(e),l.shift(),clearTimeout(a),a=setTimeout(function(){try{localStorage.SS_deltaBuffer=l.join(",")}catch(e){}},1e3);var t=120<e&&P(e),o=!P(120)&&!P(100)&&!t;return e<50||o}(n)||(1.2<Math.abs(o)&&(o*=p.stepSize/120),1.2<Math.abs(n)&&(n*=p.stepSize/120),S(r,o,n),e.preventDefault(),void C()):!d||!W||(Object.defineProperty(e,"target",{value:window.frameElement}),parent.wheel(e))}function x(e){var t=e.target,o=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==w.spacebar;document.body.contains(s)||(s=document.activeElement);var n=/^(button|submit|radio|checkbox|file|color|image)$/i;if(e.defaultPrevented||/^(textarea|select|embed|object)$/i.test(t.nodeName)||N(t,"input")&&!n.test(t.type)||N(s,"video")||function(e){var t=e.target,o=!1;if(-1!=document.URL.indexOf("www.youtube.com/watch"))do{if(o=t.classList&&t.classList.contains("html5-video-controls"))break}while(t=t.parentNode);return o}(e)||t.isContentEditable||o)return!0;if((N(t,"button")||N(t,"input")&&n.test(t.type))&&e.keyCode===w.spacebar)return!0;if(N(t,"input")&&"radio"==t.type&&v[e.keyCode])return!0;var r=0,a=0,l=z(s);
52if(!l)return!d||!W||parent.keydown(e);var i=l.clientHeight;switch(l==document.body&&(i=window.innerHeight),e.keyCode){case w.up:a=-p.arrowScroll;break;case w.down:a=p.arrowScroll;break;case w.spacebar:a=-(e.shiftKey?1:-1)*i*.9;break;case w.pageup:a=.9*-i;break;case w.pagedown:a=.9*i;break;case w.home:l==document.body&&document.scrollingElement&&(l=document.scrollingElement),a=-l.scrollTop;break;case w.end:var c=l.scrollHeight-l.scrollTop-i;a=0<c?10+c:0;break;case w.left:r=-p.arrowScroll;break;case w.right:r=p.arrowScroll;break;default:return!0}S(l,r,a),e.preventDefault(),C()}function t(e){s=e.target}var k,D,M=(k=0,function(e){return e.uniqueID||(e.uniqueID=k++)}),E={},T={},B={};function C(){clearTimeout(D),D=setInterval(function(){E=T=B={}},1e3)}function H(e,t,o){for(var n=o?E:T,r=e.length;r--;)n[M(e[r])]=t;return t}function z(e){var t=[],o=document.body,n=m.scrollHeight;do{var r=(!1?E:T)[M(e)];if(r)return H(t,r);if(t.push(e),n===e.scrollHeight){var a=O(m)&&O(o)||X(m);if(d&&L(m)||!d&&a)return H(t,q())}else if(L(e)&&X(e))return H(t,e)}while(e=e.parentElement)}function L(e){return e.clientHeight+10<e.scrollHeight}function O(e){return"hidden"!==getComputedStyle(e,"").getPropertyValue("overflow-y")}function X(e){var t=getComputedStyle(e,"").getPropertyValue("overflow-y");return"scroll"===t||"auto"===t}function Y(e,t,o){window.addEventListener(e,t,o||!1)}function A(e,t,o){window.removeEventListener(e,t,o||!1)}function N(e,t){return e&&(e.nodeName||"").toLowerCase()===t.toLowerCase()}if(window.localStorage&&localStorage.SS_deltaBuffer)try{l=localStorage.SS_deltaBuffer.split(",")}catch(e){}function K(e,t){return Math.floor(e/t)==e/t}function P(e){return K(l[0],e)&&K(l[1],e)&&K(l[2],e)}var $,j=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e,t,o){window.setTimeout(e,o||1e3/60)},R=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,q=($=document.scrollingElement,function(){if(!$){var e=document.createElement("div");e.style.cssText="height:10000px;width:1px;",document.body.appendChild(e);var t=document.body.scrollTop;document.documentElement.scrollTop,window.scrollBy(0,3),$=document.body.scrollTop!=t?document.body:document.documentElement,window.scrollBy(0,-3),document.body.removeChild(e)}return $});function V(e){var t;return((e*=p.pulseScale)<1?e-(1-Math.exp(-e)):(e-=1,(t=Math.exp(-1))+(1-Math.exp(-e))*(1-t)))*p.pulseNormalize}function F(e){return 1<=e?1:e<=0?0:(1==p.pulseNormalize&&(p.pulseNormalize/=V(1)),V(e))}var I=window.navigator.userAgent,_=/Edge/.test(I),W=/chrome/i.test(I)&&!_,U=/safari/i.test(I)&&!_,G=/mobile/i.test(I),J=/Windows NT 6.1/i.test(I)&&/rv:11/i.test(I),Q=U&&(/Version\/8/i.test(I)||/Version\/9/i.test(I)),Z=(W||U||J)&&!G,ee=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){ee=!0}}))}catch(e){}var te=!!ee&&{passive:!1},oe="onwheel"in document.createElement("div")?"wheel":"mousewheel";function ne(e){for(var t in e)o.hasOwnProperty(t)&&(p[t]=e[t])}oe&&Z&&(Y(oe,e,te),Y("mousedown",t),Y("load",y)),ne.destroy=function(){i&&i.disconnect(),A(oe,e),A("mousedown",t),A("keydown",x),A("resize",c),A("load",y)},window.SmoothScrollOptions&&ne(window.SmoothScrollOptions),"function"==typeof define&&define.amd?define(function(){return ne}):"object"==typeof exports?module.exports=ne:window.SmoothScroll=ne}(); 53 } 54 55 56 /* load url */ 57 jQuery('#de__qv-loader').load('product-quick-view'); 58 59 // -------------------------------------------------- 60 // magnificPopup 61 // -------------------------------------------------- 62 63 var startWindowScroll = 0; 64 jQuery('.simple-ajax-popup-align-top').magnificPopup({ 65 type: 'ajax', 66 fixedContentPos: true, 67 fixedBgPos: true, 68 overflowY: 'auto', 69 callbacks: { 70 beforeOpen: function() { 71 startWindowScroll = $(window).scrollTop(); 72 }, 73 open: function(){ 74 if ( $('.mfp-content').height() < $(window).height() ){ 75 $('body').on('touchmove', function (e) { 76 e.preventDefault(); 77 }); 78 } 79 }, 80 close: function() { 81 $(window).scrollTop(startWindowScroll); 82 $('body').off('touchmove'); 83 } 84 } 85 }); 86 87 jQuery('.simple-ajax-popup').magnificPopup({ 88 type: 'ajax' 89 }); 90 91 // zoom gallery 92 jQuery('.zoom-gallery').magnificPopup({ 93 delegate: 'a', 94 type: 'image', 95 closeOnContentClick: false, 96 closeBtnInside: false, 97 mainClass: 'mfp-with-zoom mfp-img-mobile', 98 image: { 99 verticalFit: true, 100 titleSrc: function (item) { 101 return item.el.attr('title'); 102 //return item.el.attr('title') + ' · <a class="image-source-link" href="'+item.el.attr('data-source')+'" target="_blank">image source</a>'; 103 } 104 }, 105 gallery: { 106 enabled: true 107 }, 108 zoom: { 109 enabled: true, 110 duration: 300, // don't foget to change the duration also in CSS 111 opener: function (element) { 112 return element.find('img'); 113 } 114 } 115 116 }); 117 118 // popup youtube, video, gmaps 119 120 jQuery('.popup-gmaps').magnificPopup({ 121 disableOn: 700, 122 type: 'iframe', 123 mainClass: 'mfp-fade', 124 removalDelay: 160, 125 preloader: false, 126
127 fixedContentPos: false 128 }); 129 130 $('.popup-youtube, .popup-vimeo').magnificPopup({ 131 type: 'iframe', 132 mainClass: 'mfp-fade', 133 removalDelay: 160, 134 preloader: false, 135 iframe:{ 136 patterns:{ 137 youtube:{ 138 index: 'youtube.com', 139 id: 'v=', 140 src: 'https://www.youtube.com/embed/%id%' 141 }, 142 }, 143 srcAction:'iframe_src', 144 }, 145 fixedContentPos: false 146 }); 147 148 // image popup 149 150 $('.image-popup-vertical-fit').magnificPopup({ 151 type: 'image', 152 closeOnContentClick: true, 153 mainClass: 'mfp-img-mobile', 154 image: { 155 verticalFit: true 156 } 157 158 }); 159 160 $('.image-popup-fit-width').magnificPopup({ 161 type: 'image', 162 closeOnContentClick: true, 163 image: { 164 verticalFit: false 165 } 166 }); 167 168 $('.image-popup-no-margins').magnificPopup({ 169 type: 'image', 170 closeOnContentClick: true, 171 closeBtnInside: false, 172 fixedContentPos: true, 173 mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side 174 image: { 175 verticalFit: true 176 }, 177 zoom: { 178 enabled: true, 179 duration: 300 // don't foget to change the duration also in CSS 180 } 181 }); 182 183 $('.image-popup-gallery').magnificPopup({ 184 type: 'image', 185 closeOnContentClick: false, 186 closeBtnInside: false, 187 mainClass: 'mfp-with-zoom mfp-img-mobile', 188 image: { 189 verticalFit: true, 190 titleSrc: function (item) { 191 return item.el.attr('title'); 192 //return item.el.attr('title') + ' · <a class="image-source-link" href="'+item.el.attr('data-source')+'" target="_blank">image source</a>'; 193 } 194 }, 195 gallery: { 196 enabled: true 197 } 198 199 }); 200 201 $('.popup-gallery').magnificPopup({ 202 delegate: 'a', 203 type: 'image', 204 tLoading: 'Loading image #%curr%...', 205 mainClass: 'mfp-img-mobile', 206 gallery: { 207 enabled: true, 208 navigateByImgClick: true, 209 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 210 }, 211 image: { 212 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 213 titleSrc: function(item) { 214 return item.el.attr('title'); 215 } 216 } 217 }); 218 219 /* -------------------------------------------------- 220 * custom background 221 * --------------------------------------------------*/ 222 function custom_bg() { 223 $("*").css('background-color', function() { 224 return jQuery(this).data('bgcolor'); 225 }); 226 $("body,div,section,span").css('background', function() { 227 return jQuery(this).data('bgimage'); 228 }); 229 $("div,section").css('background-size', function() { 230 return 'cover'; 231 }); 232 } 233 234 // progress bar // 235 function de_progress() { 236 jQuery('.de-progress').each(function() { 237 var pos_y = jQuery(this).offset().top; 238 var value = jQuery(this).find(".progress-bar").attr('data-value'); 239 var topOfWindow = jQuery(window).scrollTop(); 240 if (pos_y < topOfWindow + 550) { 241 jQuery(this).find(".progress-bar").animate({ 242 'width': value 243 }, "slow"); 244 } 245 246 jQuery(this).find('.value').text(jQuery(this).find('.progress-bar').attr('data-value')); 247 }); 248 } 249 250 // wow jquery 251 252 new WOW().init(); 253 254 // -------------------------------------------------- 255 // init 256 // -------------------------------------------------- 257 function init_de() { 258 259 enquire.register("screen and (max-width: 993px)", { 260 match: function () { 261 $('header').addClass("header-mobile"); 262 }, 263 unmatch: function () { 264 $('header').removeClass("header-mobile"); 265 } 266 }); 267 268 var $window = jQuery(window); 269 jQuery('section[data-type="background"]').each(function () { 270 var $bgobj = jQuery(this); // assigning the object 271 272 jQuery(window).scroll(function () { 273 274 enquire.register("screen and (min-width: 993px)", { 275 match: function () { 276 var yPos = -($window.scrollTop() / $bgobj.data('speed')); 277 var coords = '50% ' + yPos + 'px'; 278 $bgobj.css({ backgroundPosition: coords }); 279 } 280 }); 281 }); 282 document.createElement("article"); 283 document.createElement("section"); 284 }); 285 286 jQuery('.grid.border').css('padding-top', grid_size); 287 jQuery('.grid.border').css('padding-left', grid_size); 288 } 289 290 function grid_gallery() { 291 jQuery('.grid-item').each(function () { 292 var this_col = Number(jQuery(this).parent().attr('data-col')); 293 var this_gridspace = Number(jQuery(this).parent().attr('data-gridspace')); 294 var this_ratio = eval($(this).parent().attr('data-ratio')); 295 jQuery(this).parent().css('padding-left', this_gridspace); 296 var w = (($(document).width() - (this_gridspace * this_col + 1)) / this_col) - (this_gridspace / this_col); 297 var gi = $(this); 298 var h = w * this_ratio; 299 gi.css('width', w); 300 gi.css('height', h); 301 gi.find(".pf_title").css('margin-top', (h / 2) - 10); 302 gi.css('margin-right', this_gridspace); 303 gi.css('margin-bottom', this_gridspace); 304 if (gi.hasClass('large')) { 305 $(this).css('width', (w * 2) + this_gridspace); 306 $(this).css('height', (h * 2) + this_gridspace); 307 } 308 if (gi.hasClass('large-width')) { 309 $(this).css('width', (w * 2) + this_gridspace); 310 $(this).css('height', h); 311 } 312 if (gi.hasClass('large-height')) { 313 $(this).css('height', (h * 2) + this_gridspace); 314 gi.find(".pf_title").css('margin-top', (h) - 20); 315 } 316 }); 317 } 318 319 320 init_de(); 321 de_progress(); 322 grid_gallery(); 323 centery(); 324 325 326 // -------------------------------------------------- 327 // preloader 328 // -------------------------------------------------- 329 330 if(preloader==1){ 331 //calling jPreLoader function with properties 332 jQuery('body').jpreLoader({ 333 splashID: "#jSplash", 334 splashFunction: function () { //passing Splash Screen script to jPreLoader 335 jQuery('#jSplash').children('section').not('.selected').hide(); 336 jQuery('#jSplash').hide().fadeIn(800); 337 init_de(); 338 var timer = setInterval(function () { 339 splashRotator(); 340 }, 1500); 341 } 342 }, function () { //jPreLoader callback function 343 clearInterval(); 344 345 jQuery(function () { 346 var v_url = document.URL; 347 348 if (v_url.indexOf('#') != -1) { 349 var v_hash = v_url.substring(v_url.indexOf("#") + 1); 350 351 352 jQuery('html, body').animate({ 353 scrollTop: jQuery('#' + v_hash).offset().top - 70 354 }, 200); 355 return false;
356 } 357 }); 358 359 360 }); 361 362 // End of jPreLoader script 363 364 function splashRotator() { 365 var cur = jQuery('#jSplash').children('.selected'); 366 var next = jQuery(cur).next(); 367 368 if (jQuery(next).length != 0) { 369 jQuery(next).addClass('selected'); 370 } else { 371 jQuery('#jSplash').children('section:first-child').addClass('selected'); 372 next = jQuery('#jSplash').children('section:first-child'); 373 } 374 375 jQuery(cur).removeClass('selected').fadeOut(100, function () { 376 jQuery(next).fadeIn(100); 377 }); 378 } 379 }else{ 380 $('body').css("display","block"); 381 } 382 383 384 // -------------------------------------------------- 385 // function 386 // -------------------------------------------------- 387 388 function video_autosize() { 389 jQuery('.de-video-container').each(function () { 390 var height_1 = jQuery(this).css("height"); 391 var height_2 = jQuery(this).find(".de-video-content").css("height"); 392 var newheight = (height_1.substring(0, height_1.length - 2) - height_2.substring(0, height_2.length - 2)) / 2; 393 jQuery(this).find('.de-video-overlay').css("height", height_1); 394 jQuery(this).find(".de-video-content").animate({ 'margin-top': newheight }, 'fast'); 395 }); 396 } 397 398 window.onresize = function (event) { 399 400 enquire.register("screen and (min-width: 993px)", { 401 match: function () { 402 jQuery('#mainmenu').show(); 403 jQuery('header').removeClass('height-auto'); 404 mobile_menu_show = 1; 405 col = tmp_col; 406 }, 407 unmatch: function () { 408 jQuery('#mainmenu').hide(); 409 mobile_menu_show = 0; 410 jQuery("#menu-btn").show(); 411 col = 2; 412 } 413 }); 414 415 // header bottom setting begin 416 var mq = window.matchMedia("(max-width: 993px)"); 417 if (mq.matches) { 418 jQuery('.header-bottom,.header-center').css("display", "block"); 419 jQuery('.header-bottom,.header-center').css("top", "0"); 420 } 421 // header bottom setting close 422 423 init(); 424 video_autosize(); 425 centery(); 426 427 $('header').removeClass('smaller'); 428 $('header').removeClass('logo-smaller'); 429 $('header').removeClass('clone'); 430 jQuery('#menu-btn').removeClass("clicked"); 431 jQuery('#menu-btn').addClass("unclick"); 432 433 grid_gallery(); 434 owlnavcenter(); 435 436 }; 437 438 439 function init() { 440 441 var sh = jQuery('#de-sidebar').css("height"); 442 var dh = jQuery(window).innerHeight(); 443 var h = parseInt(sh) - parseInt(dh); 444 var header_height = parseInt(jQuery('header').height(), 10); 445 var screen_height = parseInt(jQuery(window).height(), 10); 446 var header_mt = screen_height - header_height; 447 var mq = window.matchMedia("(min-width: 993px)"); 448 var ms = window.matchMedia("(min-width: 768px)"); 449 450 window.addEventListener('scroll', function (e) { 451 452 if (mq.matches) { 453 var distanceY = window.pageYOffset || document.documentElement.scrollTop, 454 shrinkOn = 100, 455 header = document.querySelector("header"); 456 if (distanceY > shrinkOn) { 457 classie.add(header, "smaller"); 458 } else { 459 if (classie.has(header, "smaller")) { 460 classie.remove(header, "smaller"); 461 } 462 463 } 464 } 465 466 if (mq.matches) { 467 jQuery("header").addClass("clone", 1000, "easeOutBounce"); 468 469 // header autoshow on scroll begin 470 var $document = $(document); 471 var vscroll = 0; 472 473 if ($document.scrollTop() >= 50 && vscroll == 0) { 474 jQuery("header.autoshow").removeClass("scrollOff"); 475 jQuery("header.autoshow").addClass("scrollOn"); 476 vscroll = 1; 477 } else { 478 jQuery("header.autoshow").removeClass("scrollOn"); 479 jQuery("header.autoshow").addClass("scrollOff"); 480 vscroll = 0; 481 } 482 // header autoshow on scroll close 483 484 485 // header bottom on scroll begin
486 var header_height = parseInt(jQuery('header').height(), 10); 487 var screen_height = parseInt(jQuery(window).height(), 10); 488 var header_mt = screen_height - header_height; 489 var header_mt_half = header_mt / 2; 490 491 if ($document.scrollTop() >= header_mt) { 492 jQuery('.header-bottom').css("position", "fixed"); 493 jQuery('.header-bottom').css("top", "0"); 494 } else if ($document.scrollTop() <= header_mt) { 495 jQuery('.header-bottom').css("position", "absolute"); 496 jQuery('.header-bottom').css("top", header_mt); 497 } 498 499 if ($document.scrollTop() >= header_mt_half) { 500 jQuery('.header-center').css("position", "fixed"); 501 jQuery('.header-center').css("top", "0"); 502 } else if ($document.scrollTop() <= header_mt_half) { 503 jQuery('.header-center').css("position", "absolute"); 504 jQuery('.header-center').css("top", header_mt_half); 505 } 506 // header bottom on scroll close 507 508 509 // side header on scroll begin 510 if (jQuery("header").hasClass("side-header")) { 511 if (jQuery(document).scrollTop() >= h) { 512 jQuery('#de-sidebar').css("position", "fixed"); 513 if (parseInt(sh) > parseInt(dh)) { 514 jQuery('#de-sidebar').css("top", -h); 515 } 516 jQuery('#main').addClass("col-md-offset-3"); 517 } else { 518 jQuery('#de-sidebar').css("position", "absolute "); 519 if (parseInt(sh) > parseInt(dh)) { 520 jQuery('#de-sidebar').css("top", 0); 521 } 522 jQuery('#main').removeClass("col-md-offset-3"); 523 } 524 } 525 // side header on scroll close 526 } 527 }); 528 529 530 if (mq.matches) { 531 jQuery('.header-bottom,.header-center').css('position', 'absolute'); 532 jQuery('.header-bottom,.header-center').css('top', header_mt); 533 } 534 535 536 } 537 window.onload = init(); 538 539 540 // -------------------------------------------------- 541 // owlCarousel 542 // -------------------------------------------------- 543 544 jQuery("#carousel-products").owlCarousel({ 545 center: false, 546 items:1, 547 loop:true, 548 dots: true, 549 margin:0, 550 responsive:{ 551 1000:{ 552 items:1 553 }, 554 600:{ 555 items:1 556 }, 557 0:{ 558 items:1 559 } 560 } 561 }); 562 563 jQuery("#gallery-carousel-2").owlCarousel({ 564 center: false, 565 items:2, 566 loop:true, 567 dots: false, 568 margin:0, 569 responsive:{ 570 1000:{ 571 items:2 572 }, 573 600:{ 574 items:2 575 }, 576 0:{ 577 items:1 578 } 579 } 580 }); 581 582 jQuery("#carousel-single-dots").owlCarousel({ 583 single: true, 584 items:1, 585 loop:true, 586 dots: true, 587 margin:0, 588 }); 589 590 var bigimage = $(".p-carousel"); 591 var thumbs = $(".p-carousel-thumb"); 592 //var totalslides = 10; 593 var syncedSecondary = true; 594 595 bigimage 596 .owlCarousel({ 597 items: 1, 598 slideSpeed: 2000, 599 nav: false, 600 // autoplay: true, 601 dots: false, 602 loop: true, 603 responsiveRefreshRate: 200, 604 navText: [ 605 '<i class="fa fa-arrow-left" aria-hidden="true"></i>', 606 '<i class="fa fa-arrow-right" aria-hidden="true"></i>' 607 ] 608 }) 609 .on("changed.owl.carousel", syncPosition); 610 611 thumbs 612 .on("initialized.owl.carousel", function() { 613 thumbs 614 .find(".owl-item") 615 .eq(0) 616 .addClass("current"); 617 }) 618 .owlCarousel({ 619 items: 4, 620 dots: false, 621 nav: false, 622 navText: [ 623 '<i class="fa fa-arrow-left" aria-hidden="true"></i>', 624 '<i class="fa fa-arrow-right" aria-hidden="true"></i>' 625 ], 626 margin:15, 627 smartSpeed: 200, 628 slideSpeed: 500, 629 slideBy: 4, 630 responsiveRefreshRate: 100 631 }) 632 .on("changed.owl.carousel", syncPosition2); 633 634 function syncPosition(el) { 635 //if loop is set to false, then you have to uncomment the next line 636 //var current = el.item.index; 637 638 //to disable loop, comment this block 639 console.log(el); 640 var count = el.item.count - 1; 641 var current = Math.round(el.item.index - el.item.count / 2 - 0.5); 642 643 if (current < 0) { 644 current = count; 645 } 646 if (current > count) { 647 current = 0; 648 } 649 //to this 650 thumbs 651 .find(".owl-item") 652 .removeClass("current") 653 .eq(current) 654 .addClass("current"); 655 var onscreen = thumbs.find(".owl-item.active").length - 1; 656 console.log(onscreen) 657 var start = thumbs 658 .find(".owl-item.active") 659 .first() 660 .index(); 661 var end = thumbs 662 .find(".owl-item.active") 663 .last() 664 .index(); 665 console.log(end); 666 if (current > end) { 667 thumbs.data("owl.carousel").to(current, 100, true); 668 } 669 if (current < start) { 670 thumbs.data("owl.carousel").to(current - onscreen, 100, true); 671 } 672 } 673 674 function syncPosition2(el) { 675 if (syncedSecondary) { 676 var number = el.item.index; 677 bigimage.data("owl.carousel").to(number, 100, true); 678 } 679 } 680 681 thumbs.on("click", ".owl-item", function(e) { 682 e.preventDefault(); 683 var number = $(this).index(); 684 bigimage.data("owl.carousel").to(number, 300, true); 685 }); 686 687 jQuery("#owl-logo").owlCarousel({ 688 center: false, 689 items:4, 690 loop:true, 691 dots: false, 692 margin:0, 693 autoplay:true, 694 autoplayTimeout:2000, 695 responsive:{ 696 1000:{ 697 items:6 698 }, 699 600:{ 700 items:4 701 }, 702 0:{ 703 items:3 704 } 705 } 706 }); 707 708 jQuery("#gallery-carousel-3").owlCarousel({ 709 center: false, 710 items:3, 711 loop:true, 712 dots: false, 713 margin:0, 714 responsive:{ 715 1000:{ 716 items:3 717 }, 718 600:{ 719 items:2 720 }, 721 0:{ 722 items:1 723 } 724 } 725 }); 726 727 jQuery("#gallery-carousel-4").owlCarousel({ 728 center: false, 729 items:4, 730 loop:true, 731 dots: false, 732 margin:0, 733 responsive:{ 734 1000:{ 735 items:4 736 }, 737 600:{ 738 items:2 739 }, 740 0:{ 741 items:1 742 } 743 } 744 }); 745 746 747 jQuery(".carousel-gallery").owlCarousel({ 748 items: 4, 749 navigation: false, 750 pagination: false 751 }); 752 753 jQuery("#blog-carousel").owlCarousel({ 754 center: false, 755 items:2, 756 loop:true, 757 dots: true, 758 margin:30, 759 responsive:{ 760 1000:{ 761 items:2 762 }, 763 600:{ 764 items:1 765 }, 766 0:{ 767 items:1 768 } 769 } 770 }); 771 772 jQuery(".carousel-4-center-dots").owlCarousel({ 773 center: true, 774 items:4, 775 loop:true, 776 dots: true, 777 margin:30, 778 responsive:{ 779 1000:{ 780 items:4 781 }, 782 600:{ 783 items:2 784 }, 785 0:{ 786 items:1 787 } 788 } 789 }); 790 791 jQuery("#testimonial-carousel").owlCarousel({ 792 center: false, 793 items:2, 794 loop:true, 795 dots: true, 796 margin:30, 797 responsive:{ 798 1000:{ 799 items:2 800 }, 801 600:{ 802 items:1 803 }, 804 0:{ 805 items:1 806 } 807 } 808 }); 809 jQuery("#testimonial-carousel-3-cols").owlCarousel({ 810 center: false, 811 items:3, 812 loop:true, 813 dots: true, 814 margin:30, 815 responsive:{ 816 1000:{ 817 items:3 818 }, 819 600:{ 820 items:1 821 }, 822 0:{ 823 items:1 824 } 825 } 826 }); 827 828 jQuery("#testimonial-carousel-single").owlCarousel({ 829 items:1, 830 autoplay:true, 831 autoplayTimeout:6000, 832 animateOut: 'fadeOut', 833 animateIn: 'fadeIn', 834 loop:true, 835 dots:true, 836 mouseDrag:false, 837 touchDrag:false, 838 margin:0, 839 }); 840 841 jQuery("#logo-carousel").owlCarousel({ 842 items: 6, 843 loop:true, 844 dots: false, 845 autoPlay: true, 846 responsive:{ 847 1000:{ 848 items:6 849 }, 850 600:{ 851 items:4 852 }, 853 0:{ 854 items:1 855 } 856 } 857 }); 858 859 jQuery("#contact-carousel").owlCarousel({ 860 items: 1, 861 singleItem: true, 862 navigation: false, 863 pagination: false, 864 autoPlay: true 865 }); 866 867 868 jQuery("#text-carousel").owlCarousel({ 869 items:1, 870 autoplay:true, 871 autoplayTimeout:4000, 872 animateOut: 'fadeOut', 873 animateIn: 'fadeIn', 874 loop:true, 875 dots:false, 876 mouseDrag:false, 877 touchDrag:false, 878 margin:0, 879 }); 880 881 882 jQuery("#single-carousel").owlCarousel({ 883 items:1, 884 autoplay:true, 885 autoplayTimeout:4000, 886 animateOut: 'fadeOut', 887 animateIn: 'fadeIn', 888 loop:true, 889 dots:false, 890 mouseDrag:false, 891 touchDrag:false, 892 margin:0, 893 }); 894 895 896 jQuery(".carousel-single-navi").owlCarousel({ 897 items: 1, 898 singleItem: true, 899 navigation: true, 900 pagination: false, 901 mouseDrag: false, 902 touchDrag: false, 903 transitionStyle: "fade" 904 }); 905 906 jQuery(".blog-slide").owlCarousel({ 907 items: 1, 908 singleItem: true, 909 navigation: false, 910 pagination: false,
911 autoPlay: false 912 }); 913 914 jQuery("#photo-carousel").owlCarousel({ 915 center: false, 916 items:4, 917 loop:true, 918 margin:0, 919 nav: false, 920 dots: true, 921 autoHeight: true, 922 responsive:{ 923 1000:{ 924 items:4 925 }, 926 992:{ 927 items:3 928 }, 929 600:{ 930 items:2 931 }, 932 0:{ 933 items:1 934 } 935 } 936 }); 937 938 jQuery(".carousel-cat-3").owlCarousel({ 939 center: false, 940 items:3, 941 loop:true, 942 dots: false, 943 margin:30, 944 autoplay:true, 945 autoplayTimeout:5000, 946 autoplayHoverPause:true, 947 responsive:{ 948 1000:{ 949 items:3 950 }, 951 600:{ 952 items:2 953 }, 954 0:{ 955 items:1 956 } 957 } 958 }); 959 960 jQuery(".carousel-cat-3-a").owlCarousel({ 961 center: false, 962 items:3, 963 loop:true, 964 dots: false, 965 margin:10, 966 autoplay:true, 967 autoplayTimeout:5000, 968 autoplayHoverPause:true, 969 responsive:{ 970 1000:{ 971 items:3 972 }, 973 600:{ 974 items:2 975 }, 976 0:{ 977 items:1 978 } 979 } 980 }); 981 982 jQuery("#carousel-single").owlCarousel({ 983 singleItem:true, 984 items:1, 985 loop:true, 986 dots: false, 987 margin:0, 988 autoplay:true, 989 autoplayTimeout:4000, 990 }); 991 992 // Custom Navigation owlCarousel 993 $(".next").on("click", function () { 994 $(this).parent().parent().find('.blog-slide').trigger('owl.next'); 995 }); 996 $(".prev").on("click", function () { 997 $(this).parent().parent().find('.blog-slide').trigger('owl.prev'); 998 }); 999 1000 function owlnavcenter(){ 1001 jQuery('.owl-custom-nav').each(function () { 1002 var owl = $($(this).data('target')); 1003 1004 owl.owlCarousel(); 1005 1006 // Custom Navigation Events 1007 $(".btn-next").on("click", function () { 1008 owl.trigger('next.owl.carousel'); 1009 }); 1010 $(".btn-prev").on("click", function () { 1011 owl.trigger('prev.owl.carousel'); 1012 }); 1013 }); 1014 } 1015 1016 owlnavcenter(); 1017 1018 // ecommerce 1019 jQuery(".de__pcard .atr__colors div").on("click", function () { 1020 var img_url = jQuery(this).attr('data-image'); 1021 var sc = jQuery(this).parent().parent().parent().find(".atr__image-main"); 1022 sc.attr('src',img_url); 1023 jQuery(this).parent().find("div").removeClass("active"); 1024 jQuery(this).addClass("active"); 1025 }); 1026 1027 1028 // -------------------------------------------------- 1029 // custom positiion 1030 // -------------------------------------------------- 1031 1032 function centery() { 1033 var mi = window.matchMedia("(min-width: 768px)"); 1034 var ma = window.matchMedia("(max-width: 768px)"); 1035 1036 1037 if (mi.matches) { 1038 var $doc_height = jQuery(window).innerHeight(); 1039 jQuery('#homepage #content.content-overlay').css("margin-top", $doc_height); 1040 jQuery('.full-height').css("height", $doc_height); 1041 var picheight = jQuery('.center-y').css("height"); 1042 picheight = parseInt(picheight, 10); 1043 jQuery('.center-y').css('margin-top', (($doc_height - picheight) / 2) - 90); 1044 jQuery('.full-height .de-video-container').css("height", $doc_height); 1045 } 1046 1047 if (ma.matches) { 1048 jQuery('.full-height').css("max-height", '100%'); 1049 } 1050 } 1051 1052 1053 1054 // -------------------------------------------------- 1055 // blog list hover 1056 // -------------------------------------------------- 1057 jQuery(".blog-list").on("mouseenter", function () { 1058 var v_height; 1059 var v_width; 1060 1061 if (typeof v_height !== 'undefined') { 1062 v_height = jQuery(this).find(".blog-slide").css("height"); 1063 v_width = jQuery(this).find(".blog-slide").css("width"); 1064 var newheight = (v_height.substring(0, v_height.length - 2) / 2) - 40; 1065 jQuery(this).find(".owl-arrow").css("margin-top", newheight); 1066 jQuery(this).find(".owl-arrow").css("width", v_width); 1067 jQuery(this).find(".owl-arrow").fadeTo(150, 1); 1068 } 1069 //alert(v_height); 1070 }).on("mouseleave", function () { 1071 jQuery(this).find(".owl-arrow").fadeTo(150, 0); 1072 1073 }); 1074 1075 // logo carousel hover 1076 jQuery("#logo-carousel img").on("mouseenter", function () { 1077 jQuery(this).fadeTo(150, 0.5); 1078 }).on("mouseleave", function () { 1079 jQuery(this).fadeTo(150, 1); 1080 }); 1081 1082 /* -------------------------------------------------- 1083 * show gallery item sequence 1084 * --------------------------------------------------*/ 1085 function sequence(){ 1086 var sq = jQuery(".sequence .sq-item .picframe"); 1087 var count = sq.length; 1088 sq.addClass("zoomIn"); 1089 for (var i = 0; i <= count; i++) { 1090 var sqx = jQuery(".sequence > .sq-item:eq("+i+") .picframe"); 1091 sqx.attr('data-wow-delay',(i/15)+'s'); 1092 } 1093 } 1094 1095 function demo(){ 1096 $('#switcher').css('display','block'); 1097 jQuery(".bg1").click(function(){ 1098 jQuery("#colors").attr("href", "css/colors/aqua.css"); 1099 }); 1100 1101 jQuery(".bg2").click(function(){ 1102 jQuery("#colors").attr("href", "css/colors/blue.css"); 1103 }); 1104 1105 jQuery(".bg3").click(function(){ 1106 jQuery("#colors").attr("href", "css/colors/green.css"); 1107 }); 1108 1109 jQuery(".bg4").click(function(){ 1110 jQuery("#colors").attr("href", "css/colors/grey.css"); 1111 }); 1112 1113 jQuery(".bg5").click(function(){ 1114 jQuery("#colors").attr("href", "css/colors/orange.css"); 1115 }); 1116 1117 jQuery(".bg6").click(function(){ 1118 jQuery("#colors").attr("href", "css/colors/pink.css"); 1119 }); 1120 1121 jQuery(".bg7").click(function(){ 1122 jQuery("#colors").attr("href", "css/colors/purple.css"); 1123 }); 1124 1125 jQuery(".bg8").click(function(){ 1126 jQuery("#colors").attr("href", "css/colors/red.css"); 1127 }); 1128 1129 jQuery(".bg9").click(function(){
1130 jQuery("#colors").attr("href", "css/colors/yellow.css"); 1131 }); 1132 1133 jQuery(".bg10").click(function(){ 1134 jQuery("#colors").attr("href", "css/colors/lime.css"); 1135 }); 1136 1137 1138 1139 jQuery(".custom-show").hide(); 1140 1141 jQuery(".custom-close").click(function(){ 1142 jQuery(this).hide(); 1143 jQuery(".custom-show").show(); 1144 jQuery('#switcher').animate({'left': '+=120px'},'medium'); 1145 }); 1146 1147 1148 jQuery(".custom-show").click(function(){ 1149 jQuery(this).hide(); 1150 jQuery(".custom-close").show(); 1151 jQuery(this).parent().animate({'left': '-=120px'},'medium'); 1152 }); 1153 1154 1155 jQuery('#de-header-style').on('change', function() { 1156 var v = this.value; 1157 if(v=='opt-1'){ 1158 $('header').removeClass('transparent'); 1159 }else if(v=='opt-2'){ 1160 $('header').addClass('transparent'); 1161 } 1162 }); 1163 1164 jQuery('#de-header-color').on('change', function() { 1165 var v = this.value; 1166 if(v=='opt-1'){ 1167 $('header').removeClass('header-light'); 1168 }else if(v=='opt-2'){ 1169 $('header').addClass('header-light'); 1170 } 1171 }); 1172 1173 jQuery('#de-header-layout').on('change', function() { 1174 var v = this.value; 1175 if(v=='opt-1'){ 1176 $('header').removeClass('de_header_2'); 1177 $('header .info').hide(); 1178 }else if(v=='opt-2'){ 1179 $('header').addClass('de_header_2'); 1180 $('header .info').show(); 1181 } 1182 }); 1183 1184 jQuery('#de-menu').on('change', function() { 1185 $('#mainmenu').removeClass('no-separator'); 1186 $('#mainmenu').removeClass('line-separator'); 1187 $('#mainmenu').removeClass('circle-separator'); 1188 $('#mainmenu').removeClass('square-separator'); 1189 $('#mainmenu').removeClass('plus-separator'); 1190 $('#mainmenu').removeClass('strip-separator'); 1191 var v = this.value 1192 if(v=='opt-1'){ 1193 $('#mainmenu').removeClass('no-separator'); 1194 $('#mainmenu').removeClass('line-separator'); 1195 }else if(v=='opt-2'){ 1196 $('#mainmenu').addClass('line-separator'); 1197 }else if(v=='opt-3'){ 1198 $('#mainmenu').addClass('circle-separator'); 1199 }else if(v=='opt-4'){ 1200 $('#mainmenu').addClass('square-separator'); 1201 }else if(v=='opt-5'){ 1202 $('#mainmenu').addClass('plus-separator'); 1203 }else if(v=='opt-6'){ 1204 $('#mainmenu').addClass('strip-separator'); 1205 }else if(v=='opt-0'){ 1206 $('#mainmenu').addClass('no-separator'); 1207 } 1208 }); 1209 } 1210 1211 sequence(); 1212 1213 1214 // product click notification begin 1215 $("<div/>").attr('id','de_notif').appendTo('body'); 1216 1217 function de_atc(n) { 1218 $("#de_notif").html(n); 1219 }; 1220 1221 jQuery(".de__pcard .atr__wish-list").on("click", function () { 1222 1223 var iteration = $(this).data('iteration') || 1; 1224 1225 switch (iteration) { 1226 case 1: 1227 jQuery(this).addClass("active"); 1228 $("#de_notif").removeClass("active"); 1229 de_atc('Product added to wishlist'); 1230 $("#de_notif").addClass("active"); 1231 setTimeout(function() { 1232 $("#de_notif").removeClass("active"); 1233 }, 1500); 1234 break; 1235 case 2: 1236 jQuery(this).removeClass("active"); 1237 $("#de_notif").addClass("active"); 1238 de_atc('Product removed from wishlist'); 1239 setTimeout(function() { 1240 $("#de_notif").removeClass("active"); 1241 }, 1500); 1242 break; 1243 } 1244 iteration++; 1245 if (iteration > 2) iteration = 1; 1246 $(this).data('iteration', iteration); 1247 1248 }); 1249 1250 jQuery(".de__pcard .atr__add-cart").on("click", function () { 1251 1252 $("#de_notif").removeClass("active"); 1253 de_atc('Product added to cart'); 1254 $("#de_notif").addClass("active"); 1255 setTimeout(function() { 1256 $("#de_notif").removeClass("active"); 1257 }, 1500); 1258 1259 }); 1260 // product click notification close 1261 1262 1263 // document on load 1264 jQuery(window).load(function () { 1265 1266 video_autosize(); 1267 grid_gallery(); 1268 custom_bg(); 1269 de_count(); 1270 centery(); 1271 $(".jarallax").jarallax(); 1272 demo(); 1273 1274 // -------------------------------------------------- 1275 // filtering gallery 1276 // -------------------------------------------------- 1277 1278 $container.isotope({ 1279 itemSelector: '.item', 1280 filter: '*' 1281 }); 1282 jQuery('#filters a').on("click", function () { 1283 var $this = jQuery(this); 1284 if ($this.hasClass('selected')) { 1285 return false;
1286 } 1287 var $optionSet = $this.parents(); 1288 $optionSet.find('.selected').removeClass('selected'); 1289 $this.addClass('selected'); 1290 1291 var selector = jQuery(this).attr('data-filter'); 1292 $container.isotope({ 1293 filter: selector 1294 }); 1295 return false; 1296 }); 1297 1298 $('.grid').isotope({ 1299 itemSelector: '.grid-item' 1300 }); 1301 1302 if(smooth_scroll==1){ 1303 !function(){var s,i,c,a,o={frameRate:150,animationTime:600,stepSize:100,pulseAlgorithm:!0,pulseScale:4,pulseNormalize:1,accelerationDelta:50,accelerationMax:3,keyboardSupport:!0,arrowScroll:50,fixedBackground:!0,excluded:""},p=o,u=!1,d=!1,n={x:0,y:0},f=!1,m=document.documentElement,l=[],h=/^Mac/.test(navigator.platform),w={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},v={37:1,38:1,39:1,40:1};function y(){if(!f&&document.body){f=!0;var e=document.body,t=document.documentElement,o=window.innerHeight,n=e.scrollHeight;if(m=0<=document.compatMode.indexOf("CSS")?t:e,s=e,p.keyboardSupport&&Y("keydown",x),top!=self)d=!0;else if(Q&&o<n&&(e.offsetHeight<=o||t.offsetHeight<=o)){var r,a=document.createElement("div");a.style.cssText="position:absolute; z-index:-10000; top:0; left:0; right:0; height:"+m.scrollHeight+"px",document.body.appendChild(a),c=function(){r=r||setTimeout(function(){u||(a.style.height="0",a.style.height=m.scrollHeight+"px",r=null)},500)},setTimeout(c,10),Y("resize",c);if((i=new R(c)).observe(e,{attributes:!0,childList:!0,characterData:!1}),m.offsetHeight<=o){var l=document.createElement("div");l.style.clear="both",e.appendChild(l)}}p.fixedBackground||u||(e.style.backgroundAttachment="scroll",t.style.backgroundAttachment="scroll")}}var b=[],g=!1,r=Date.now();function S(d,f,m){if(function(e,t){e=0<e?1:-1,t=0<t?1:-1,n.x===e&&n.y===t||(n.x=e,n.y=t,b=[],r=0)}(f,m),1!=p.accelerationMax){var e=Date.now()-r;if(e<p.accelerationDelta){var t=(1+50/e)/2;1<t&&(t=Math.min(t,p.accelerationMax),f*=t,m*=t)}r=Date.now()}if(b.push({x:f,y:m,lastX:f<0?.99:-.99,lastY:m<0?.99:-.99,start:Date.now()}),!g){var o=q(),h=d===o||d===document.body;null==d.$scrollBehavior&&function(e){var t=M(e);if(null==B[t]){var o=getComputedStyle(e,"")["scroll-behavior"];B[t]="smooth"==o}return B[t]}(d)&&(d.$scrollBehavior=d.style.scrollBehavior,d.style.scrollBehavior="auto");var w=function(e){for(var t=Date.now(),o=0,n=0,r=0;r<b.length;r++){var a=b[r],l=t-a.start,i=l>=p.animationTime,c=i?1:l/p.animationTime;p.pulseAlgorithm&&(c=F(c));var s=a.x*c-a.lastX>>0,u=a.y*c-a.lastY>>0;o+=s,n+=u,a.lastX+=s,a.lastY+=u,i&&(b.splice(r,1),r--)}h?window.scrollBy(o,n):(o&&(d.scrollLeft+=o),n&&(d.scrollTop+=n)),f||m||(b=[]),b.length?j(w,d,1e3/p.frameRate+1):(g=!1,null!=d.$scrollBehavior&&(d.style.scrollBehavior=d.$scrollBehavior,d.$scrollBehavior=null))};j(w,d,0),g=!0}}function e(e){f||y();var t=e.target;if(e.defaultPrevented||e.ctrlKey)return!0;if(N(s,"embed")||N(t,"embed")&&/\.pdf/i.test(t.src)||N(s,"object")||t.shadowRoot)return!0;var o=-e.wheelDeltaX||e.deltaX||0,n=-e.wheelDeltaY||e.deltaY||0;h&&(e.wheelDeltaX&&K(e.wheelDeltaX,120)&&(o=e.wheelDeltaX/Math.abs(e.wheelDeltaX)*-120),e.wheelDeltaY&&K(e.wheelDeltaY,120)&&(n=e.wheelDeltaY/Math.abs(e.wheelDeltaY)*-120)),o||n||(n=-e.wheelDelta||0),1===e.deltaMode&&(o*=40,n*=40);var r=z(t);return r?!!function(e){if(!e)return;l.length||(l=[e,e,e]);e=Math.abs(e),l.push(e),l.shift(),clearTimeout(a),a=setTimeout(function(){try{localStorage.SS_deltaBuffer=l.join(",")}catch(e){}},1e3);var t=120<e&&P(e),o=!P(120)&&!P(100)&&!t;return e<50||o}(n)||(1.2<Math.abs(o)&&(o*=p.stepSize/120),1.2<Math.abs(n)&&(n*=p.stepSize/120),S(r,o,n),e.preventDefault(),void C()):!d||!W||(Object.defineProperty(e,"target",{value:window.frameElement}),parent.wheel(e))}function x(e){var t=e.target,o=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==w.spacebar;document.body.contains(s)||(s=document.activeElement);var n=/^(button|submit|radio|checkbox|file|color|image)$/i;if(e.defaultPrevented||/^(textarea|select|embed|object)$/i.test(t.nodeName)||N(t,"input")&&!n.test(t.type)||N(s,"video")||function(e){var t=e.target,o=!1;if(-1!=document.URL.indexOf("www.youtube.com/watch"))do{if(o=t.classList&&t.classList.contains("html5-video-controls"))break}while(t=t.parentNode);return o}(e)||t.isContentEditable||o)return!0;
1303if((N(t,"button")||N(t,"input")&&n.test(t.type))&&e.keyCode===w.spacebar)return!0;if(N(t,"input")&&"radio"==t.type&&v[e.keyCode])return!0;var r=0,a=0,l=z(s);if(!l)return!d||!W||parent.keydown(e);var i=l.clientHeight;switch(l==document.body&&(i=window.innerHeight),e.keyCode){case w.up:a=-p.arrowScroll;break;case w.down:a=p.arrowScroll;break;case w.spacebar:a=-(e.shiftKey?1:-1)*i*.9;break;case w.pageup:a=.9*-i;break;case w.pagedown:a=.9*i;break;case w.home:l==document.body&&document.scrollingElement&&(l=document.scrollingElement),a=-l.scrollTop;break;case w.end:var c=l.scrollHeight-l.scrollTop-i;a=0<c?10+c:0;break;case w.left:r=-p.arrowScroll;break;case w.right:r=p.arrowScroll;break;default:return!0}S(l,r,a),e.preventDefault(),C()}function t(e){s=e.target}var k,D,M=(k=0,function(e){return e.uniqueID||(e.uniqueID=k++)}),E={},T={},B={};function C(){clearTimeout(D),D=setInterval(function(){E=T=B={}},1e3)}function H(e,t,o){for(var n=o?E:T,r=e.length;r--;)n[M(e[r])]=t;return t}function z(e){var t=[],o=document.body,n=m.scrollHeight;do{var r=(!1?E:T)[M(e)];if(r)return H(t,r);if(t.push(e),n===e.scrollHeight){var a=O(m)&&O(o)||X(m);if(d&&L(m)||!d&&a)return H(t,q())}else if(L(e)&&X(e))return H(t,e)}while(e=e.parentElement)}function L(e){return e.clientHeight+10<e.scrollHeight}function O(e){return"hidden"!==getComputedStyle(e,"").getPropertyValue("overflow-y")}function X(e){var t=getComputedStyle(e,"").getPropertyValue("overflow-y");return"scroll"===t||"auto"===t}function Y(e,t,o){window.addEventListener(e,t,o||!1)}function A(e,t,o){window.removeEventListener(e,t,o||!1)}function N(e,t){return e&&(e.nodeName||"").toLowerCase()===t.toLowerCase()}if(window.localStorage&&localStorage.SS_deltaBuffer)try{l=localStorage.SS_deltaBuffer.split(",")}catch(e){}function K(e,t){return Math.floor(e/t)==e/t}function P(e){return K(l[0],e)&&K(l[1],e)&&K(l[2],e)}var $,j=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e,t,o){window.setTimeout(e,o||1e3/60)},R=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,q=($=document.scrollingElement,function(){if(!$){var e=document.createElement("div");e.style.cssText="height:10000px;width:1px;",document.body.appendChild(e);var t=document.body.scrollTop;document.documentElement.scrollTop,window.scrollBy(0,3),$=document.body.scrollTop!=t?document.body:document.documentElement,window.scrollBy(0,-3),document.body.removeChild(e)}return $});function V(e){var t;return((e*=p.pulseScale)<1?e-(1-Math.exp(-e)):(e-=1,(t=Math.exp(-1))+(1-Math.exp(-e))*(1-t)))*p.pulseNormalize}function F(e){return 1<=e?1:e<=0?0:(1==p.pulseNormalize&&(p.pulseNormalize/=V(1)),V(e))}var I=window.navigator.userAgent,_=/Edge/.test(I),W=/chrome/i.test(I)&&!_,U=/safari/i.test(I)&&!_,G=/mobile/i.test(I),J=/Windows NT 6.1/i.test(I)&&/rv:11/i.test(I),Q=U&&(/Version\/8/i.test(I)||/Version\/9/i.test(I)),Z=(W||U||J)&&!G,ee=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){ee=!0}}))}catch(e){}var te=!!ee&&{passive:!1},oe="onwheel"in document.createElement("div")?"wheel":"mousewheel";function ne(e){for(var t in e)o.hasOwnProperty(t)&&(p[t]=e[t])}oe&&Z&&(Y(oe,e,te),Y("mousedown",t),Y("load",y)),ne.destroy=function(){i&&i.disconnect(),A(oe,e),A("mousedown",t),A("keydown",x),A("resize",c),A("load",y)},window.SmoothScrollOptions&&ne(window.SmoothScrollOptions),"function"==typeof define&&define.amd?define(function(){return ne}):"object"==typeof exports?module.exports=ne:window.SmoothScroll=ne}(); 1304 } 1305 1306 /* mo-menu begin */ 1307 1308 1309 jQuery('#mo-menu li').on("click", function() { 1310 1311 var iteration = $(this).data('iteration') || 1; 1312 1313 switch (iteration) { 1314 case 1: 1315 $(this).children('ul').addClass('full'); 1316 break; 1317 case 2: 1318 $(this).children('ul').removeClass('full'); 1319 break; 1320 } 1321 iteration++; 1322 if (iteration > 2) iteration = 1; 1323 $(this).data('iteration', iteration); 1324 1325 }); 1326 1327 jQuery('#mo-button-open').on("click", function() { 1328 jQuery('#menu-overlay').fadeIn(); 1329 jQuery('#menu-overlay').css("top","0"); 1330 1331 /*$("#mo-menu > li").each(function(i) { 1332 $(this).animate({ 1333 'opacity': '1', 1334 }, 10*i); 1335 });*/ 1336 1337 $("#mo-menu li").finish().delay(500).each(function(i) { 1338 $(this).finish().delay(200+(100 * i)).queue(function() { 1339 $(this).addClass("show"); 1340 }) 1341 }) 1342 1343 }); 1344 1345 jQuery('#mo-button-close').on("click", function() { 1346 jQuery('#menu-overlay').fadeOut(); 1347 $("#mo-menu li").finish().delay(500).each(function(i) { 1348 $(this).finish().delay(100 * i).queue(function() { 1349 $(this).removeClass("show"); 1350 }) 1351 }) 1352 if(jQuery('#menu-overlay').hasClass("slideDown")){ 1353 jQuery('#menu-overlay').css("top","-100%"); 1354 } 1355 }); 1356 1357 jQuery('#mo-menu a').on("click", function() { 1358 1359 if (this.href.indexOf('#') != -1) { 1360 jQuery('#menu-overlay').fadeOut(); 1361 $("#mo-menu > li").each(function(i) { 1362 $(this).animate({ 1363 'opacity': '0', 1364 }, 150*i); 1365 }); 1366 if(jQuery('#menu-overlay').hasClass("slideDown")){ 1367 jQuery('#menu-overlay').css("top","-100%"); 1368 } 1369 } 1370 1371 }); 1372 /* mo-menu close */ 1373 1374 1375 // -------------------------------------------------- 1376 // tabs 1377 // -------------------------------------------------- 1378 jQuery('.de_tab').find('.de_tab_content > div').hide(); 1379 jQuery('.de_tab').find('.de_tab_content > div:first').show(); 1380 jQuery('li').find('.v-border').fadeTo(150, 0); 1381 jQuery('li.active').find('.v-border').fadeTo(150, 1); 1382 1383 jQuery('.de_nav li').click(function () { 1384 jQuery(this).parent().find('li').removeClass("active"); 1385 jQuery(this).addClass("active"); 1386 jQuery(this).parent().parent().find('.v-border').fadeTo(150, 0); 1387 jQuery(this).parent().parent().find('.de_tab_content > div').hide(); 1388 1389 var indexer = jQuery(this).index(); //gets the current index of (this) which is #nav li 1390 jQuery(this).parent().parent().find('.de_tab_content > div:eq(' + indexer + ')').fadeIn(); //uses whatever index the link has to open the corresponding box 1391 jQuery(this).find('.v-border').fadeTo(150, 1); 1392 }); 1393 1394 $('.de-simple-tab').find('.de-simple-tab-content > div').hide(); 1395 $('.de-simple-tab').find('.de-simple-tab-content > div:first').show(); 1396 1397 $('.de-simple-tab li').click(function() { 1398 $(this).parent().find('li span').removeClass("active"); 1399 $(this).find('span').addClass("active"); 1400 $(this).parent().parent().find('.de-simple-tab-content > div').hide(); 1401 1402 var indexer = $(this).index(); //gets the current index of (this) which is #nav li 1403 $(this).parent().parent().find('.de-simple-tab-content > div:eq(' + indexer + ')').fadeIn(); //uses whatever index the link has to open the corresponding box 1404 }); 1405 1406 1407 // request quote function 1408 1409 var rq_step = 1; 1410 1411 jQuery('#request_form .btn-right').click(function () { 1412 1413 var rq_name = $('#rq_name').val(); 1414 var rq_email = $('#rq_email').val(); 1415 var rq_phone = $('#rq_phone').val(); 1416 1417 if (rq_step == 1) { 1418 if (rq_name.length == 0) { $('#rq_name').addClass("error_input"); } else { $('#rq_name').removeClass("error_input"); } 1419 if (rq_email.length == 0) { $('#rq_email').addClass("error_input"); } else { $('#rq_email').removeClass("error_input"); } 1420 if (rq_phone.length == 0) { $('#rq_phone').addClass("error_input"); } else { $('#rq_phone').removeClass("error_input"); } 1421 } 1422 1423 if (rq_name.length != 0 && rq_email.length != 0 && rq_phone.length != 0) { 1424 jQuery("#rq_step_1").hide(); 1425 jQuery("#rq_step_2").fadeIn(); 1426 } 1427 1428 }); 1429 1430 // -------------------------------------------------- 1431 // tabs 1432 // -------------------------------------------------- 1433 jQuery('.de_review').find('.de_tab_content > div').hide(); 1434 jQuery('.de_review').find('.de_tab_content > div:first').show(); 1435 //jQuery('.de_review').find('.de_nav li').fadeTo(150,.5); 1436 jQuery('.de_review').find('.de_nav li:first').fadeTo(150, 1); 1437 1438 jQuery('.de_nav li').click(function () { 1439 jQuery(this).parent().find('li').removeClass("active"); 1440 //jQuery(this).parent().find('li').fadeTo(150,.5); 1441 jQuery(this).addClass("active"); 1442 jQuery(this).fadeTo(150, 1); 1443 jQuery(this).parent().parent().find('.de_tab_content > div').hide(); 1444 1445 var indexer = jQuery(this).index(); //gets the current index of (this) which is #nav li 1446 jQuery(this).parent().parent().find('.de_tab_content > div:eq(' + indexer + ')').show(); //uses whatever index the link has to open the corresponding box 1447 }); 1448 1449 1450 function de_count(){ 1451 jQuery('.timer').each(function () { 1452 var imagePos = jQuery(this).offset().top; 1453 1454 var topOfWindow = jQuery(window).scrollTop(); 1455 if (imagePos < topOfWindow + 500 && v_count == '0') { 1456 1457 jQuery(function ($) { 1458 1459 // start all the timers 1460 jQuery('.timer').each(count); 1461 1462 function count(options) { 1463 v_count = '1'; 1464 var $this = jQuery(this); 1465 options = $.extend({}, options || {}, $this.data('countToOptions') || {}); 1466 $this.countTo(options); 1467 } 1468 }); 1469 1470 } 1471 }); 1472 } 1473 1474 1475 // -------------------------------------------------- 1476 // toggle 1477 // -------------------------------------------------- 1478 jQuery(".toggle-list h2").addClass("acc_active"); 1479 jQuery(".toggle-list h2").toggle( 1480 function () { 1481 jQuery(this).addClass("acc_noactive"); 1482 jQuery(this).next(".ac-content").slideToggle(200); 1483 }, 1484 function () { 1485 jQuery(this).removeClass("acc_noactive").addClass("acc_active"); 1486 jQuery(this).next(".ac-content").slideToggle(200); 1487 }); 1488 1489 var mb; 1490 1491 // -------------------------------------------------- 1492 // navigation for mobile 1493 // -------------------------------------------------- 1494 1495 1496 1497 jQuery('#menu-btn').on("click", function () { 1498 if (mobile_menu_show == 0) { 1499 jQuery('#mainmenu').slideDown(); 1500 jQuery('header').addClass('height-auto'); 1501 jQuery('.force-header-mobile').css('max-height','100%'); 1502 mobile_menu_show = 1; 1503 jQuery(this).removeClass("unclick"); 1504 jQuery(this).addClass("clicked"); 1505 } else { 1506 $('#mainmenu').slideUp('fast', function () { 1507 jQuery('header').removeClass('height-auto'); 1508 jQuery('.force-header-mobile').css('max-height','80px'); 1509 mobile_menu_show = 0; 1510 }); 1511 jQuery(this).removeClass("clicked"); 1512 jQuery(this).addClass("unclick"); 1513 } 1514 }); 1515 1516 // close menu when click for onepage on mobile (added 17/04/23) 1517 jQuery("header.header-mobile #mainmenu a").click(function (evn) { 1518 if (this.href.indexOf('#') != -1) { 1519 evn.preventDefault(); 1520 $(this).parent().parent().hide('fast', function () { 1521 jQuery('header').removeClass('height-auto'); 1522 jQuery('.force-header-mobile').css('max-height','80px'); 1523 mobile_menu_show = 0; 1524 }); 1525 jQuery("#menu-btn").removeClass("clicked"); 1526 jQuery("#menu-btn").addClass("unclick"); 1527 } 1528 }); 1529 1530 // one page navigation 1531 /** 1532 * This part causes smooth scrolling using scrollto.js 1533 * We target all a tags inside the nav, and apply the scrollto.js to it. 1534 */ 1535 1536 jQuery("#homepage nav a, .scroll-to, #mo-menu a").click(function (evn) { 1537 1538 if (this.href.indexOf('#') != -1) { 1539 evn.preventDefault(); 1540 jQuery('html,body').scrollTo(this.hash, this.hash); 1541 } 1542 }); 1543 1544 jQuery("a.btn").click(function (evn) { 1545 1546 if (this.href.indexOf('#') != -1) { 1547 evn.preventDefault(); 1548 jQuery('html,body').scrollTo(this.hash, this.hash); 1549 } 1550 }); 1551 1552 jQuery(".pop-search-click").on("click", function() { 1553 var iteration = $(this).data('iteration') || 1; 1554 switch (iteration) { 1555 case 1: 1556 jQuery(this).addClass("click"); 1557 jQuery('.pop-search .form-default').fadeTo(300,1); 1558 jQuery('.pop-search .form-default input').focus(); 1559 break; 1560 case 2: 1561 jQuery(this).removeClass("click"); 1562 jQuery('.pop-search .form-default').hide(); 1563 break; 1564 } 1565 iteration++; 1566 if (iteration > 2) iteration = 1; 1567 $(this).data('iteration', iteration); 1568 }); 1569 1570 jQuery('.de-gallery .item .icon-info').on("click", function () { 1571 jQuery('.page-overlay').show(); 1572 url = jQuery(this).attr("data-value"); 1573 1574 jQuery("#loader-area .project-load").load(url, function () { 1575 jQuery("#loader-area").slideDown(500, function () { 1576 jQuery('.page-overlay').hide(); 1577 jQuery('html, body').animate({ 1578 scrollTop: jQuery('#loader-area').offset().top - 70 1579 }, 500, 'easeOutCubic'); 1580 1581 // 1582 1583 jQuery(".image-slider").owlCarousel({ 1584 items: 1, 1585 singleItem: true, 1586 navigation: false, 1587 pagination: true,
1588 autoPlay: false 1589 }); 1590 1591 jQuery(".container").fitVids(); 1592 1593 jQuery('#btn-close-x').on("click", function () { 1594 jQuery("#loader-area").slideUp(500, function () { 1595 jQuery('html, body').animate({ 1596 scrollTop: jQuery('#section-portfolio').offset().top - 70 1597 }, 500, 'easeOutCirc'); 1598 }); 1599 1600 return false; 1601 1602 }); 1603 1604 }); 1605 }); 1606 }); 1607 1608 jQuery('.de-gallery .item').on("click", function () { 1609 $('#navigation').show(); 1610 }); 1611 1612 1613 jQuery('#btn-close-quick-view').on("click", function () { 1614 $(".de__quick-view").fadeOut("normal", function() { 1615 $(this).hide(); 1616 $('html,body').removeClass("no-scroll"); 1617 }); 1618 }); 1619 1620 jQuery('.atr__quick-view').on("click", function () { 1621 $(".de__quick-view").fadeIn("normal"); 1622 $('html,body').addClass("no-scroll"); 1623 var url = $(this).data("url"); 1624 jQuery('#de__qv-loader').load(url); 1625 }); 1626 1627 // -------------------------------------------------- 1628 // custom page with background on side 1629 // -------------------------------------------------- 1630 jQuery('.side-bg').each(function () { 1631 //jQuery(this).find(".image-container").css("height", jQuery(this).find(".image-container").parent().css("height")); 1632 }); 1633 1634 var target = $('.center-y'); 1635 var targetHeight = target.outerHeight(); 1636 1637 jQuery('.animated').fadeTo(0, 0); 1638 jQuery('.animated').each(function () { 1639 var imagePos = jQuery(this).offset().top; 1640 var timedelay = jQuery(this).attr('data-delay'); 1641 1642 var topOfWindow = jQuery(window).scrollTop(); 1643 if (imagePos < topOfWindow + 300) { 1644 jQuery(this).fadeTo(1, 500); 1645 var $anim = jQuery(this).attr('data-animation'); 1646 } 1647 }); 1648 1649 1650 // btn arrow up 1651 jQuery(".arrow-up").on("click", function () { 1652 jQuery(".coming-soon .coming-soon-content").fadeOut("medium", function () { 1653 jQuery("#hide-content").fadeIn(600, function () { 1654 jQuery('.arrow-up').animate({ 'bottom': '-40px' }, "slow"); 1655 jQuery('.arrow-down').animate({ 'top': '0' }, "slow"); 1656 }); 1657 }); 1658 }); 1659 1660 // btn arrow down 1661 jQuery(".arrow-down").on("click", function () { 1662 jQuery("#hide-content").fadeOut("slow", function () { 1663 jQuery(".coming-soon .coming-soon-content").fadeIn(800, function () { 1664 jQuery('.arrow-up').animate({ 'bottom': '0px' }, "slow"); 1665 jQuery('.arrow-down').animate({ 'top': '-40' }, "slow"); 1666 }); 1667 }); 1668 }); 1669 1670 // document scroll // 1671 jQuery(document).scroll(function () { 1672 var scrollPercent = (targetHeight - window.scrollY) / targetHeight; 1673 if (scrollPercent >= 0) { 1674 target.css('opacity', scrollPercent); 1675 } 1676 1677 if (location.hash!=="") { 1678 jQuery('#homepage nav li a').each(function () { 1679 if (this.href.indexOf('#') != -1) { 1680 var href = jQuery(this).attr('href'); 1681 if (jQuery(window).scrollTop() > jQuery(href).offset().top - 140) { 1682 jQuery('nav li a').removeClass('active'); 1683 jQuery(this).addClass('active'); 1684 } 1685 } 1686 }); 1687 } 1688 1689 de_count(); 1690 1691 jQuery('.animated').each(function () { 1692 var imagePos = jQuery(this).offset().top; 1693 var timedelay = jQuery(this).attr('data-delay'); 1694 1695 var topOfWindow = jQuery(window).scrollTop(); 1696 if (imagePos < topOfWindow + 500) { 1697 jQuery(this).delay(timedelay).queue(function () { 1698 jQuery(this).fadeTo(1, 500); 1699 var $anim = jQuery(this).attr('data-animation'); 1700 jQuery(this).addClass($anim).clearQueue(); 1701 }); 1702 1703 } 1704 }); 1705 1706 jQuery(".nav-exit").on("click", function () { 1707 $.magnificPopup.close(); 1708 }); 1709 1710 }); // document scroll end // 1711 1712 $.stellar({ 1713 horizontalScrolling: false, 1714 verticalOffset: 0 1715 }); 1716 1717 }); // document load end // 1718 1719 1720 // mainmenu create span 1721 jQuery('#mainmenu li a').each(function () { 1722 if ($(this).next("ul").length > 0) { 1723 $("<span></span>").insertAfter($(this)); 1724 } 1725 }); 1726 1727 // mainmenu arrow click 1728 jQuery("#mainmenu > li > span").on("click", function () { 1729 var iteration = $(this).data('iteration') || 1; 1730 switch (iteration) { 1731 case 1: 1732 $(this).addClass("active"); 1733 $(this).parent().find("ul:first").css("height", "auto"); 1734 var curHeight = $(this).parent().find("ul:first").height(); 1735 $(this).parent().find("ul:first").css("height", "0"); 1736 $(this).parent().find("ul:first").animate({ 'height': curHeight }, 400, 'easeInOutQuint'); 1737 1738 break; 1739 1740 case 2: 1741 $(this).removeClass("active"); 1742 $(this).parent().find("ul:first").animate({ 'height': "0" }, 400, 'easeInOutQuint'); 1743 break; 1744 } 1745 iteration++; 1746 if (iteration > 2) iteration = 1; 1747 $(this).data('iteration', iteration); 1748 }); 1749 1750 jQuery("#mainmenu > li > ul > li > span").on("click", function () { 1751 var iteration = $(this).data('iteration') || 1; 1752 switch (iteration) { 1753 case 1: 1754 $(this).addClass("active"); 1755 $(this).parent().find("ul:first").css("height", "auto"); 1756 $(this).parent().parent().parent().find("ul:first").css("height", "auto"); 1757 var curHeight = $(this).parent().find("ul:first").height(); 1758 $(this).parent().find("ul:first").css("height", "0"); 1759 $(this).parent().find("ul:first").animate({ 'height': curHeight }, 400, 'easeInOutQuint'); 1760 1761 break; 1762 1763 case 2: 1764 $(this).removeClass("active"); 1765 $(this).parent().find("ul:first").animate({ 'height': "0" }, 400, 'easeInOutQuint'); 1766 break; 1767 } 1768 iteration++; 1769 if (iteration > 2) iteration = 1; 1770 $(this).data('iteration', iteration); 1771 }); 1772 1773 jQuery("#mainmenu > li > ul > li > ul > li span").on("click", function () { 1774 var iteration = $(this).data('iteration') || 1; 1775 switch (iteration) { 1776 case 1: 1777 $(this).addClass("active"); 1778 $(this).parent().find("ul:first").css("height", "auto"); 1779 $(this).parent().parent().parent().find("ul:first").css("height", "auto"); 1780 var curHeight = $(this).parent().find("ul:first").height(); 1781 $(this).parent().find("ul:first").css("height", "0"); 1782 $(this).parent().find("ul:first").animate({ 'height': curHeight }, 400, 'easeInOutQuint'); 1783 1784 break; 1785 1786 case 2: 1787 $(this).removeClass("active"); 1788 $(this).parent().find("ul:first").animate({ 'height': "0" }, 400, 'easeInOutQuint'); 1789 break; 1790 } 1791 iteration++; 1792 if (iteration > 2) iteration = 1; 1793 $(this).data('iteration', iteration); 1794 }); 1795 1796 //jQUery('footer').append('<a href="#" id="back-to-top"></a>'); 1797 1798 if ($('#back-to-top').length) { 1799 var scrollTrigger = 500, // px 1800 backToTop = function () { 1801 var scrollTop = $(window).scrollTop(); 1802 if (scrollTop > scrollTrigger) { 1803 $('#back-to-top').addClass('show'); 1804 } else { 1805 $('#back-to-top').removeClass('show'); 1806 } 1807 }; 1808 backToTop(); 1809 $(window).on('scroll', function () { 1810 backToTop(); 1811 }); 1812 $('#back-to-top').on('click', function (e) { 1813 e.preventDefault(); 1814 $('html,body').animate({ 1815 scrollTop: 0 1816 }, 700); 1817 }); 1818 1819 $("section,div").css('background-color', function () { 1820 return jQuery(this).data('bgcolor'); 1821 }); 1822 1823 $("div").css('background-image', function () { 1824 return jQuery(this).data('bgimage'); 1825 }); 1826 1827 1828 } 1829 1830 1831 var incrementPlus; 1832 var incrementMinus; 1833 1834 var buttonPlus = $(".f-input-number-increment"); 1835 var buttonMinus = $(".f-input-number-decrement"); 1836 1837 var incrementPlus = buttonPlus.click(function() { 1838 var $n = $(this) 1839 .parent() 1840 .find(".f-input-number"); 1841 $n.val(Number($n.val())+1 ); 1842 }); 1843 1844 var incrementMinus = buttonMinus.click(function() { 1845 var $n = $(this) 1846 .parent() 1847 .find(".f-input-number"); 1848 var amount = Number($n.val()); 1849 if (amount > 0) { 1850 $n.val(amount-1); 1851 } 1852 }); 1853 1854 1855 // -------------------------------------------------- 1856 // looping background 1857 // -------------------------------------------------- 1858 $(function () { 1859 var x = 0; 1860 setInterval(function () { 1861 x -= 1; 1862 $('.bg-loop').css('background-position', x + 'px 0'); 1863 }, 50); 1864 }); 1865 1866 // new added 1867 1868 jQuery('.expand').each(function () { 1869 $(this).find('h4').on("click", function () { 1870 var iteration = $(this).data('iteration') || 1; 1871 switch (iteration) { 1872 case 1: 1873 $(this).next('.hidden-content').slideDown(300); 1874 $(this).addClass('active'); 1875 break; 1876 1877 case 2: 1878 $(this).next('.hidden-content').slideUp(300); 1879 $(this).removeClass('active'); 1880 break; 1881 } 1882 iteration++; 1883 if (iteration > 2) iteration = 1; 1884 $(this).data('iteration', iteration); 1885 }); 1886 }); 1887 1888}); 1889
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.