mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
XEDTION
This commit is contained in:
parent
7daf31956c
commit
b5e67beacd
50 changed files with 8295 additions and 0 deletions
8
layouts/xedition/js/SmoothScroll.min.js
vendored
Normal file
8
layouts/xedition/js/SmoothScroll.min.js
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// SmoothScroll for websites v1.2.1
|
||||
// Licensed under the terms of the MIT license.
|
||||
|
||||
// People involved
|
||||
// - Balazs Galambosi (maintainer)
|
||||
// - Michael Herf (Pulse Algorithm)
|
||||
|
||||
!function(){function e(){var e=!1;e&&c("keydown",r),v.keyboardSupport&&!e&&u("keydown",r)}function t(){if(document.body){var t=document.body,o=document.documentElement,n=window.innerHeight,r=t.scrollHeight;if(S=document.compatMode.indexOf("CSS")>=0?o:t,w=t,e(),x=!0,top!=self)y=!0;else if(r>n&&(t.offsetHeight<=n||o.offsetHeight<=n)){var a=!1,i=function(){a||o.scrollHeight==document.height||(a=!0,setTimeout(function(){o.style.height=document.height+"px",a=!1},500))};if(o.style.height="auto",setTimeout(i,10),S.offsetHeight<=n){var l=document.createElement("div");l.style.clear="both",t.appendChild(l)}}v.fixedBackground||b||(t.style.backgroundAttachment="scroll",o.style.backgroundAttachment="scroll")}}function o(e,t,o,n){if(n||(n=1e3),d(t,o),1!=v.accelerationMax){var r=+new Date,a=r-C;if(a<v.accelerationDelta){var i=(1+30/a)/2;i>1&&(i=Math.min(i,v.accelerationMax),t*=i,o*=i)}C=+new Date}if(M.push({x:t,y:o,lastX:0>t?.99:-.99,lastY:0>o?.99:-.99,start:+new Date}),!T){var l=e===document.body,u=function(){for(var r=+new Date,a=0,i=0,c=0;c<M.length;c++){var s=M[c],d=r-s.start,f=d>=v.animationTime,h=f?1:d/v.animationTime;v.pulseAlgorithm&&(h=p(h));var m=s.x*h-s.lastX>>0,w=s.y*h-s.lastY>>0;a+=m,i+=w,s.lastX+=m,s.lastY+=w,f&&(M.splice(c,1),c--)}l?window.scrollBy(a,i):(a&&(e.scrollLeft+=a),i&&(e.scrollTop+=i)),t||o||(M=[]),M.length?E(u,e,n/v.frameRate+1):T=!1};E(u,e,0),T=!0}}function n(e){x||t();var n=e.target,r=l(n);if(!r||e.defaultPrevented||s(w,"embed")||s(n,"embed")&&/\.pdf/i.test(n.src))return!0;var a=e.wheelDeltaX||0,i=e.wheelDeltaY||0;return a||i||(i=e.wheelDelta||0),!v.touchpadSupport&&f(i)?!0:(Math.abs(a)>1.2&&(a*=v.stepSize/120),Math.abs(i)>1.2&&(i*=v.stepSize/120),o(r,-a,-i),void e.preventDefault())}function r(e){var t=e.target,n=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==H.spacebar;if(/input|textarea|select|embed/i.test(t.nodeName)||t.isContentEditable||e.defaultPrevented||n)return!0;if(s(t,"button")&&e.keyCode===H.spacebar)return!0;var r,a=0,i=0,u=l(w),c=u.clientHeight;switch(u==document.body&&(c=window.innerHeight),e.keyCode){case H.up:i=-v.arrowScroll;break;case H.down:i=v.arrowScroll;break;case H.spacebar:r=e.shiftKey?1:-1,i=-r*c*.9;break;case H.pageup:i=.9*-c;break;case H.pagedown:i=.9*c;break;case H.home:i=-u.scrollTop;break;case H.end:var d=u.scrollHeight-u.scrollTop-c;i=d>0?d+10:0;break;case H.left:a=-v.arrowScroll;break;case H.right:a=v.arrowScroll;break;default:return!0}o(u,a,i),e.preventDefault()}function a(e){w=e.target}function i(e,t){for(var o=e.length;o--;)z[N(e[o])]=t;return t}function l(e){var t=[],o=S.scrollHeight;do{var n=z[N(e)];if(n)return i(t,n);if(t.push(e),o===e.scrollHeight){if(!y||S.clientHeight+10<o)return i(t,document.body)}else if(e.clientHeight+10<e.scrollHeight&&(overflow=getComputedStyle(e,"").getPropertyValue("overflow-y"),"scroll"===overflow||"auto"===overflow))return i(t,e)}while(e=e.parentNode)}function u(e,t,o){window.addEventListener(e,t,o||!1)}function c(e,t,o){window.removeEventListener(e,t,o||!1)}function s(e,t){return(e.nodeName||"").toLowerCase()===t.toLowerCase()}function d(e,t){e=e>0?1:-1,t=t>0?1:-1,(k.x!==e||k.y!==t)&&(k.x=e,k.y=t,M=[],C=0)}function f(e){if(e){e=Math.abs(e),D.push(e),D.shift(),clearTimeout(A);var t=D[0]==D[1]&&D[1]==D[2],o=h(D[0],120)&&h(D[1],120)&&h(D[2],120);return!(t||o)}}function h(e,t){return Math.floor(e/t)==e/t}function m(e){var t,o,n;return e*=v.pulseScale,1>e?t=e-(1-Math.exp(-e)):(o=Math.exp(-1),e-=1,n=1-Math.exp(-e),t=o+n*(1-o)),t*v.pulseNormalize}function p(e){return e>=1?1:0>=e?0:(1==v.pulseNormalize&&(v.pulseNormalize/=m(1)),m(e))}var w,g={frameRate:150,animationTime:800,stepSize:120,pulseAlgorithm:!0,pulseScale:8,pulseNormalize:1,accelerationDelta:20,accelerationMax:1,keyboardSupport:!0,arrowScroll:50,touchpadSupport:!0,fixedBackground:!0,excluded:""},v=g,b=!1,y=!1,k={x:0,y:0},x=!1,S=document.documentElement,D=[120,120,120],H={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},v=g,M=[],T=!1,C=+new Date,z={};setInterval(function(){z={}},1e4);var A,N=function(){var e=0;return function(t){return t.uniqueID||(t.uniqueID=e++)}}(),E=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(e,t,o){window.setTimeout(e,o||1e3/60)}}(),K=/chrome/i.test(window.navigator.userAgent),L="onmousewheel"in document;L&&K&&(u("mousedown",a),u("mousewheel",n),u("load",t))}();
|
||||
2268
layouts/xedition/js/camera.js
Normal file
2268
layouts/xedition/js/camera.js
Normal file
File diff suppressed because it is too large
Load diff
80
layouts/xedition/js/jquery.countTo.js
Normal file
80
layouts/xedition/js/jquery.countTo.js
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
(function ($) {
|
||||
$.fn.countTo = function (options) {
|
||||
options = options || {};
|
||||
|
||||
return $(this).each(function () {
|
||||
// set options for current element
|
||||
var settings = $.extend({}, $.fn.countTo.defaults, {
|
||||
from: $(this).data('from'),
|
||||
to: $(this).data('to'),
|
||||
speed: $(this).data('speed'),
|
||||
refreshInterval: $(this).data('refresh-interval'),
|
||||
decimals: $(this).data('decimals')
|
||||
}, options);
|
||||
|
||||
// how many times to update the value, and how much to increment the value on each update
|
||||
var loops = Math.ceil(settings.speed / settings.refreshInterval),
|
||||
increment = (settings.to - settings.from) / loops;
|
||||
|
||||
// references & variables that will change with each update
|
||||
var self = this,
|
||||
$self = $(this),
|
||||
loopCount = 0,
|
||||
value = settings.from,
|
||||
data = $self.data('countTo') || {};
|
||||
|
||||
$self.data('countTo', data);
|
||||
|
||||
// if an existing interval can be found, clear it first
|
||||
if (data.interval) {
|
||||
clearInterval(data.interval);
|
||||
}
|
||||
data.interval = setInterval(updateTimer, settings.refreshInterval);
|
||||
|
||||
// initialize the element with the starting value
|
||||
render(value);
|
||||
|
||||
function updateTimer() {
|
||||
value += increment;
|
||||
loopCount++;
|
||||
|
||||
render(value);
|
||||
|
||||
if (typeof(settings.onUpdate) == 'function') {
|
||||
settings.onUpdate.call(self, value);
|
||||
}
|
||||
|
||||
if (loopCount >= loops) {
|
||||
// remove the interval
|
||||
$self.removeData('countTo');
|
||||
clearInterval(data.interval);
|
||||
value = settings.to;
|
||||
|
||||
if (typeof(settings.onComplete) == 'function') {
|
||||
settings.onComplete.call(self, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function render(value) {
|
||||
var formattedValue = settings.formatter.call(self, value, settings);
|
||||
$self.text(formattedValue);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.countTo.defaults = {
|
||||
from: 0, // the number the element should start at
|
||||
to: 0, // the number the element should end at
|
||||
speed: 1000, // how long it should take to count between the target numbers
|
||||
refreshInterval: 100, // how often the element should be updated
|
||||
decimals: 0, // the number of decimal places to show
|
||||
formatter: formatter, // handler for formatting the value before rendering
|
||||
onUpdate: null, // callback method for every time the element is updated
|
||||
onComplete: null // callback method for when the element finishes updating
|
||||
};
|
||||
|
||||
function formatter(value, settings) {
|
||||
return value.toFixed(settings.decimals);
|
||||
}
|
||||
}(jQuery));
|
||||
205
layouts/xedition/js/jquery.easing.1.3.js
Normal file
205
layouts/xedition/js/jquery.easing.1.3.js
Normal file
|
|
@ -0,0 +1,205 @@
|
|||
/*
|
||||
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
||||
*
|
||||
* Uses the built in easing capabilities added In jQuery 1.1
|
||||
* to offer multiple easing options
|
||||
*
|
||||
* TERMS OF USE - jQuery Easing
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2008 George McGinley Smith
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
// t: current time, b: begInnIng value, c: change In value, d: duration
|
||||
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
||||
|
||||
jQuery.extend( jQuery.easing,
|
||||
{
|
||||
def: 'easeOutQuad',
|
||||
swing: function (x, t, b, c, d) {
|
||||
//alert(jQuery.easing.default);
|
||||
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
||||
},
|
||||
easeInQuad: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t + b;
|
||||
},
|
||||
easeOutQuad: function (x, t, b, c, d) {
|
||||
return -c *(t/=d)*(t-2) + b;
|
||||
},
|
||||
easeInOutQuad: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t + b;
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
},
|
||||
easeInCubic: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t + b;
|
||||
},
|
||||
easeOutCubic: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t + 1) + b;
|
||||
},
|
||||
easeInOutCubic: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t + 2) + b;
|
||||
},
|
||||
easeInQuart: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t + b;
|
||||
},
|
||||
easeOutQuart: function (x, t, b, c, d) {
|
||||
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
||||
},
|
||||
easeInOutQuart: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
||||
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
||||
},
|
||||
easeInQuint: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t*t + b;
|
||||
},
|
||||
easeOutQuint: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
||||
},
|
||||
easeInOutQuint: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
||||
},
|
||||
easeInSine: function (x, t, b, c, d) {
|
||||
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
||||
},
|
||||
easeOutSine: function (x, t, b, c, d) {
|
||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
||||
},
|
||||
easeInOutSine: function (x, t, b, c, d) {
|
||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
||||
},
|
||||
easeInExpo: function (x, t, b, c, d) {
|
||||
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
||||
},
|
||||
easeOutExpo: function (x, t, b, c, d) {
|
||||
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
||||
},
|
||||
easeInOutExpo: function (x, t, b, c, d) {
|
||||
if (t==0) return b;
|
||||
if (t==d) return b+c;
|
||||
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
||||
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
||||
},
|
||||
easeInCirc: function (x, t, b, c, d) {
|
||||
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
||||
},
|
||||
easeOutCirc: function (x, t, b, c, d) {
|
||||
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
||||
},
|
||||
easeInOutCirc: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
||||
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
||||
},
|
||||
easeInElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
},
|
||||
easeOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
||||
},
|
||||
easeInOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
||||
},
|
||||
easeInBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*(t/=d)*t*((s+1)*t - s) + b;
|
||||
},
|
||||
easeOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
||||
},
|
||||
easeInOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
||||
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
||||
},
|
||||
easeInBounce: function (x, t, b, c, d) {
|
||||
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
||||
},
|
||||
easeOutBounce: function (x, t, b, c, d) {
|
||||
if ((t/=d) < (1/2.75)) {
|
||||
return c*(7.5625*t*t) + b;
|
||||
} else if (t < (2/2.75)) {
|
||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
||||
} else if (t < (2.5/2.75)) {
|
||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
||||
} else {
|
||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
||||
}
|
||||
},
|
||||
easeInOutBounce: function (x, t, b, c, d) {
|
||||
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
||||
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
*
|
||||
* TERMS OF USE - EASING EQUATIONS
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2001 Robert Penner
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
158
layouts/xedition/js/layout.js
Normal file
158
layouts/xedition/js/layout.js
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
(function($){
|
||||
$(function(){
|
||||
var $shrinkHeaderHeight = 300;
|
||||
var $fixedHeader = $('.fixed_header .header_wrap');
|
||||
var $gnb = $('.gnb');
|
||||
var $hoverEl = $('.hover');
|
||||
var $searchEl = $('.click > a');
|
||||
var $searchForm = $('.search_area');
|
||||
|
||||
// Fixed header
|
||||
$(window).scroll(function() {
|
||||
var scroll = $(this).scrollTop();
|
||||
if( scroll >= $shrinkHeaderHeight ) {
|
||||
$fixedHeader.addClass('shrink')
|
||||
}
|
||||
else {
|
||||
$fixedHeader.removeClass('shrink');
|
||||
}
|
||||
});
|
||||
|
||||
// Gnb
|
||||
$gnb.find('>ul>li>a')
|
||||
.mouseover(function(){
|
||||
$gnb.find('>ul>li>ul:visible').hide().parent('li').removeClass('on');
|
||||
$(this).next('ul:hidden').stop().fadeIn(200).parent('li').addClass('on')
|
||||
})
|
||||
.focus(function(){
|
||||
$(this).mouseover();
|
||||
})
|
||||
.end()
|
||||
.mouseleave(function(){
|
||||
$gnb.find('>ul>li>ul').hide().parent().removeClass('on')
|
||||
});
|
||||
|
||||
$gnb.find('>ul>li>ul>li>a')
|
||||
.mouseover(function(){
|
||||
$gnb.find('>ul>li>ul>li>ul:visible').hide().parent('li').removeClass('on');
|
||||
$(this).next('ul:hidden').stop().fadeIn(200).parent('li').addClass('on')
|
||||
})
|
||||
.focus(function(){
|
||||
$(this).mouseover();
|
||||
})
|
||||
.end()
|
||||
.mouseleave(function(){
|
||||
$gnb.find('>ul>li>ul>li>ul').hide().parent().removeClass('on')
|
||||
});
|
||||
|
||||
// login popup
|
||||
$hoverEl.on('mouseenter mouseleave focusin focusout',function(e){
|
||||
e.preventDefault();
|
||||
$this = $(this);
|
||||
if(e.type == 'mouseenter' || e.type == 'focusin'){
|
||||
$this.addClass('on');
|
||||
} else {
|
||||
$this.removeClass('on');
|
||||
}
|
||||
});
|
||||
|
||||
// Search
|
||||
$searchEl.click(function(){
|
||||
if($searchForm.is(':hidden')){
|
||||
$searchForm.fadeIn().find('input').focus();
|
||||
if($('.magazine').length > 0){
|
||||
$('.custom_area').css('opacity',0);
|
||||
$('.side').css('opacity',0)
|
||||
} else{
|
||||
$('.header').css('opacity',0)
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$('.btn_close').click(function(){
|
||||
$this = $(this);
|
||||
$this.parent().fadeOut().find('input').val('');
|
||||
if($('.magazine').length > 0){
|
||||
$('.custom_area').css('opacity',1);
|
||||
$('.side').css('opacity',1)
|
||||
} else{
|
||||
$('.header').css('opacity',1)
|
||||
}
|
||||
$searchEl.focus();
|
||||
return false;
|
||||
});
|
||||
|
||||
// Scroll to top
|
||||
var scrollToTop = function() {
|
||||
var link = $('.btn_top');
|
||||
var windowW = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
|
||||
|
||||
$(window).scroll(function() {
|
||||
if (($(this).scrollTop() > 150) && (windowW > 1000)) {
|
||||
link.fadeIn(100);
|
||||
} else {
|
||||
link.fadeOut(100);
|
||||
}
|
||||
});
|
||||
|
||||
link.click(function() {
|
||||
$('html, body').animate({scrollTop: 0}, 400);
|
||||
return false;
|
||||
});
|
||||
};
|
||||
scrollToTop();
|
||||
|
||||
// Sub Header Parallax
|
||||
$('.sub_type3 .bg_img').parallax('50%',0.4);
|
||||
})
|
||||
})(jQuery);
|
||||
|
||||
(function($) {
|
||||
var $window = $(window);
|
||||
var windowHeight = $window.height();
|
||||
|
||||
$window.resize(function() {
|
||||
windowHeight = $window.height()
|
||||
});
|
||||
|
||||
$.fn.parallax = function(xpos, speedFactor, outerHeight) {
|
||||
var $this = $(this);
|
||||
var getHeight;
|
||||
var firstTop;
|
||||
$this.each(function() {
|
||||
firstTop = $this.offset().top;
|
||||
});
|
||||
|
||||
if (outerHeight) {
|
||||
getHeight = function(object) {
|
||||
return object.outerHeight(true)
|
||||
}
|
||||
} else {
|
||||
getHeight = function(object) {
|
||||
return object.height()
|
||||
}
|
||||
}
|
||||
if (arguments.length < 1 || xpos === null)
|
||||
xpos = "50%";
|
||||
if (arguments.length < 2 || speedFactor === null)
|
||||
speedFactor = 0.1;
|
||||
if (arguments.length < 3 || outerHeight === null)
|
||||
outerHeight = true;
|
||||
function update() {
|
||||
var pos = $window.scrollTop();
|
||||
$this.each(function() {
|
||||
var $element = $(this);
|
||||
var top = $element.offset().top;
|
||||
var height = getHeight($element);
|
||||
|
||||
if (top + height < pos || top > pos + windowHeight) {
|
||||
return
|
||||
}
|
||||
$this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px")
|
||||
})
|
||||
}
|
||||
$window.bind('scroll', update).resize(update);
|
||||
update()
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
83
layouts/xedition/js/welcome.js
Normal file
83
layouts/xedition/js/welcome.js
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
(function($){
|
||||
$(function(){
|
||||
var flag = true;
|
||||
$('.statistics').parallax('50%',0.4)
|
||||
$(window).scroll(function(){
|
||||
var winScrollTop = $(this).scrollTop();
|
||||
if(winScrollTop > 500) {
|
||||
if(flag){
|
||||
$('.number').countTo({
|
||||
formatter: function (value, options) {
|
||||
return value.toFixed(options.decimals).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
});
|
||||
}
|
||||
flag = false;
|
||||
}
|
||||
});
|
||||
|
||||
$('.fe_box').on('mouseenter mouseleave',function(e){
|
||||
$this = $(this);
|
||||
if(e.type == 'mouseenter'){
|
||||
$this.addClass('on')
|
||||
} else {
|
||||
$this.removeClass('on');
|
||||
}
|
||||
|
||||
});
|
||||
})
|
||||
})(jQuery);
|
||||
|
||||
(function($) {
|
||||
var $window = $(window);
|
||||
var windowHeight = $window.height();
|
||||
|
||||
$window.resize(function() {
|
||||
windowHeight = $window.height()
|
||||
});
|
||||
|
||||
|
||||
$.fn.parallax = function(xpos, speedFactor, outerHeight) {
|
||||
var $this = $(this);
|
||||
var getHeight;
|
||||
var firstTop;
|
||||
$this.each(function() {
|
||||
if($this.hasClass('statistics')){
|
||||
firstTop = $this.offset().top + 600;
|
||||
} else {
|
||||
firstTop = $this.offset().top;
|
||||
}
|
||||
});
|
||||
|
||||
if (outerHeight) {
|
||||
getHeight = function(object) {
|
||||
return object.outerHeight(true)
|
||||
}
|
||||
} else {
|
||||
getHeight = function(object) {
|
||||
return object.height()
|
||||
}
|
||||
}
|
||||
if (arguments.length < 1 || xpos === null)
|
||||
xpos = "50%";
|
||||
if (arguments.length < 2 || speedFactor === null)
|
||||
speedFactor = 0.1;
|
||||
if (arguments.length < 3 || outerHeight === null)
|
||||
outerHeight = true;
|
||||
function update() {
|
||||
var pos = $window.scrollTop();
|
||||
$this.each(function() {
|
||||
var $element = $(this);
|
||||
var top = $element.offset().top;
|
||||
var height = getHeight($element);
|
||||
|
||||
if (top + height < pos || top > pos + windowHeight) {
|
||||
return
|
||||
}
|
||||
$this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px")
|
||||
})
|
||||
}
|
||||
$window.bind('scroll', update).resize(update);
|
||||
update()
|
||||
}
|
||||
})(jQuery);
|
||||
Loading…
Add table
Add a link
Reference in a new issue