Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 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;
- }
- });
- /*
- ---------------------------------------
- TOGGLE EFFECT
- ---------------------------------------
- */
- jQuery(document).ready(function(){
- jQuery(".toggle_container").hide();
- jQuery("h3.trigger").click(function(){
- jQuery(this).toggleClass("active").next().slideToggle("normal");
- return false;
- });
- });
- /*
- ---------------------------------------
- RESPONSIVE MENU
- ---------------------------------------
- jQuery("<div id=\"responsive-menu\"><select /></div>").appendTo(".top-bar");
- // Create default option "Go to..."
- jQuery("<option />", {
- "selected": "selected",
- "value" : "",
- "text" : "Go to..."
- }).appendTo("nav select");
- // Populate dropdown with menu items
- jQuery("nav a").each(function() {
- var el = jQuery(this);
- jQuery("<option />", {
- "value" : el.attr("href"),
- "text" : el.contents(':not(em)').text()
- }).appendTo("nav select");
- });
- jQuery("nav select").change(function() {
- window.location = jQuery(this).find("option:selected").val();
- });
- */
- jQuery(".seal").toggle(
- function() {
- jQuery(".overlay-bt").animate({
- opacity: '.5',
- zIndex: '99'
- }, 0);
- jQuery("#expose .before").css({
- zIndex: '101'
- });
- jQuery("#form-container").css({
- zIndex: '100'
- });
- jQuery("#home-form").slideToggle(800, "easeOutBounce").css({
- zIndex: '100'
- });
- jQuery("#home-contact").delay(500).addClass('active');
- jQuery(this).animate({
- height: "93px",
- zIndex: "101"
- }, 50);
- },
- function() {
- jQuery(".overlay-bt").animate({
- opacity: '0',
- zIndex: '-1'
- }, 0);
- jQuery("#expose .before, #form-container").removeAttr("style");
- jQuery("#home-contact").removeClass('active');
- jQuery("#home-form").slideToggle(500, "jswing");
- jQuery(this).animate({
- height: "60px",
- zIndex: "2"
- }, 500);
- });
- (function ($) {
- $.fn.vAlign = function() {
- return this.each(function(i){
- var ah = $(this).height();
- var ph = $(this).parent().height();
- var mh = (ph - ah) / 2;
- $(this).css('margin-top', mh);
- });
- };
- })(jQuery);
- jQuery(window).load(function() {
- jQuery(".foliothumb div").vAlign();
- });
- jQuery(document).ready(function(){
- jQuery(".zilla-toggle-inner").hide();
- jQuery(".zilla-toggle-title").click(function(){
- jQuery(this).toggleClass("active").next().slideToggle("normal");
- return false;
- });
- });
- jQuery( function($) {
- $('.zilla-tab-inner').each( function() {
- var container = $(this);
- container.find('> ul li a').click( function () {
- $(this).parent().addClass( 'selected-tab' ).siblings().removeClass( 'selected-tab' );
- container.find('.zilla-tab').hide().filter(this.hash).show();
- return false;
- }).eq(0).click();
- });
- });
- /*
- * jQuery Foundation Top Bar 2.0.3
- * http://foundation.zurb.com
- * Copyright 2012, ZURB
- * Free to use under the MIT license.
- * http://www.opensource.org/licenses/mit-license.php
- */
- /*jslint unparam: true, browser: true, indent: 2 */
- ;
- (function ($, window, undefined) {
- 'use strict';
- var settings = {
- index : 0,
- initialized : false
- },
- methods = {
- init : function (options) {
- return this.each(function () {
- settings = $.extend(settings, options);
- settings.$w = $(window),
- settings.$topbar = $('nav.top-bar'),
- settings.$section = settings.$topbar.find('section'),
- settings.$titlebar = settings.$topbar.children('ul:first');
- var breakpoint = $("<div class='top-bar-js-breakpoint'/>").appendTo("body");
- settings.breakPoint = breakpoint.width();
- breakpoint.remove();
- if (!settings.initialized) {
- methods.assemble();
- settings.initialized = true;
- }
- if (!settings.height) {
- methods.largestUL();
- }
- if (settings.$topbar.parent().hasClass('fixed')) {
- $('body').css('padding-top',settings.$topbar.outerHeight())
- }
- $('.top-bar .toggle-topbar').die('click.fndtn').live('click.fndtn', function (e) {
- e.preventDefault();
- if (methods.breakpoint()) {
- settings.$topbar.toggleClass('expanded');
- settings.$topbar.css('min-height', '');
- }
- if (!settings.$topbar.hasClass('expanded')) {
- settings.$section.css({
- left: '0%'
- });
- settings.$section.find('>.name').css({
- left: '100%'
- });
- settings.$section.find('li.moved').removeClass('moved');
- settings.index = 0;
- }
- });
- // Show the Dropdown Levels on Click
- $('.top-bar .has-dropdown>a').die('click.fndtn').live('click.fndtn', function (e) {
- if (Modernizr.touch || methods.breakpoint())
- e.preventDefault();
- if (methods.breakpoint()) {
- var $this = $(this),
- $selectedLi = $this.closest('li');
- settings.index += 1;
- $selectedLi.addClass('moved');
- settings.$section.css({
- left: -(100 * settings.index) + '%'
- });
- settings.$section.find('>.name').css({
- left: 100 * settings.index + '%'
- });
- $this.siblings('ul').height(settings.height + settings.$titlebar.outerHeight(true));
- settings.$topbar.css('min-height', settings.height + settings.$titlebar.outerHeight(true) * 2)
- }
- });
- $(window).on('resize.fndtn.topbar',function() {
- if (!methods.breakpoint()) {
- settings.$topbar.css('min-height', '');
- }
- });
- /* removed
- // Go up a level on Click
- $('.top-bar .has-dropdown .back').die('click.fndtn').live('click.fndtn', function (e) {
- e.preventDefault();
- var $this = $(this),
- $movedLi = $this.closest('li.moved'),
- $previousLevelUl = $movedLi.parent();
- settings.index -= 1;
- settings.$section.css({
- left: -(100 * settings.index) + '%'
- });
- settings.$section.find('>.name').css({
- 'left': 100 * settings.index + '%'
- });
- if (settings.index === 0) {
- settings.$topbar.css('min-height', 0);
- }
- setTimeout(function () {
- $movedLi.removeClass('moved');
- }, 300);
- });
- */
- });
- },
- breakpoint : function () {
- return settings.$w.width() < settings.breakPoint;
- },
- assemble : function () {
- // Pull element out of the DOM for manipulation
- settings.$section.detach();
- settings.$section.find('.has-dropdown>a').each(function () {
- /* added 1 line below */
- var value = $(this).attr("href");
- var $link = $(this),
- $dropdown = $link.siblings('.dropdown'),
- /*remove value and paste #*/
- $titleLi = $('<li class="title back js-generated"><h5><a href="'+value+'"></a></h5></li>');
- // Copy link to subnav
- $titleLi.find('h5>a').html($link.html());
- $dropdown.prepend($titleLi);
- });
- // Put element back in the DOM
- settings.$section.appendTo(settings.$topbar);
- },
- largestUL : function () {
- var uls = settings.$topbar.find('section ul ul'),
- largest = uls.first(),
- total = 0;
- uls.each(function () {
- if ($(this).children('li').length > largest.children('li').length) {
- largest = $(this);
- }
- });
- largest.children('li').each(function () {
- total += $(this).outerHeight(true);
- });
- settings.height = total;
- }
- };
- $.fn.foundationTopBar = function (method) {
- if (methods[method]) {
- return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
- } else if (typeof method === 'object' || !method) {
- return methods.init.apply(this, arguments);
- } else {
- $.error('Method ' + method + ' does not exist on jQuery.foundationTopBar');
- }
- };
- }(jQuery, this));
- ;(function ($, window, undefined) {
- 'use strict';
- var $doc = $(document),
- Modernizr = window.Modernizr;
- $(document).ready(function() {
- $.fn.foundationAlerts ? $doc.foundationAlerts() : null;
- $.fn.foundationButtons ? $doc.foundationButtons() : null;
- $.fn.foundationAccordion ? $doc.foundationAccordion() : null;
- $.fn.foundationNavigation ? $doc.foundationNavigation() : null;
- $.fn.foundationTopBar ? $doc.foundationTopBar() : null;
- $.fn.foundationCustomForms ? $doc.foundationCustomForms() : null;
- $.fn.foundationMediaQueryViewer ? $doc.foundationMediaQueryViewer() : null;
- $.fn.foundationTabs ? $doc.foundationTabs({callback : $.foundation.customForms.appendCustomMarkup}) : null;
- $.fn.foundationTooltips ? $doc.foundationTooltips() : null;
- $.fn.foundationMagellan ? $doc.foundationMagellan() : null;
- $.fn.foundationClearing ? $doc.foundationClearing() : null;
- $.fn.placeholder ? $('input, textarea').placeholder() : null;
- });
- // UNCOMMENT THE LINE YOU WANT BELOW IF YOU WANT IE8 SUPPORT AND ARE USING .block-grids
- // $('.block-grid.two-up>li:nth-child(2n+1)').css({clear: 'both'});
- // $('.block-grid.three-up>li:nth-child(3n+1)').css({clear: 'both'});
- // $('.block-grid.four-up>li:nth-child(4n+1)').css({clear: 'both'});
- // $('.block-grid.five-up>li:nth-child(5n+1)').css({clear: 'both'});
- // Hide address bar on mobile devices (except if #hash present, so we don't mess up deep linking).
- if (Modernizr.touch && !window.location.hash) {
- $(window).load(function () {
- setTimeout(function () {
- // At load, if user hasn't scrolled more than 20px or so...
- if( $(window).scrollTop() < 20 ) {
- window.scrollTo(0, 1);
- }
- }, 0);
- });
- }
- })(jQuery, this);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement