Advertisement
Guest User

inits

a guest
Apr 27th, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. /*
  3.  * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
  4.  *
  5.  * Uses the built in easing capabilities added In jQuery 1.1
  6.  * to offer multiple easing options
  7.  *
  8.  * TERMS OF USE - jQuery Easing
  9.  *
  10.  * Open source under the BSD License.
  11.  *
  12.  * Copyright Š 2008 George McGinley Smith
  13.  * All rights reserved.
  14.  *
  15.  * Redistribution and use in source and binary forms, with or without modification,
  16.  * are permitted provided that the following conditions are met:
  17.  *
  18.  * Redistributions of source code must retain the above copyright notice, this list of
  19.  * conditions and the following disclaimer.
  20.  * Redistributions in binary form must reproduce the above copyright notice, this list
  21.  * of conditions and the following disclaimer in the documentation and/or other materials
  22.  * provided with the distribution.
  23.  *
  24.  * Neither the name of the author nor the names of contributors may be used to endorse
  25.  * or promote products derived from this software without specific prior written permission.
  26.  *
  27.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
  28.  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  29.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  30.  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  31.  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  32.  *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  33.  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  34.  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  35.  * OF THE POSSIBILITY OF SUCH DAMAGE.
  36.  *
  37. */
  38.  
  39. // t: current time, b: begInnIng value, c: change In value, d: duration
  40. jQuery.easing['jswing'] = jQuery.easing['swing'];
  41.  
  42. jQuery.extend( jQuery.easing,
  43. {
  44.     def: 'easeOutQuad',
  45.     swing: function (x, t, b, c, d) {
  46.         //alert(jQuery.easing.default);
  47.         return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
  48.     },
  49.     easeInQuad: function (x, t, b, c, d) {
  50.         return c*(t/=d)*t + b;
  51.     },
  52.     easeOutQuad: function (x, t, b, c, d) {
  53.         return -c *(t/=d)*(t-2) + b;
  54.     },
  55.     easeInOutQuad: function (x, t, b, c, d) {
  56.         if ((t/=d/2) < 1) return c/2*t*t + b;
  57.         return -c/2 * ((--t)*(t-2) - 1) + b;
  58.     },
  59.     easeInCubic: function (x, t, b, c, d) {
  60.         return c*(t/=d)*t*t + b;
  61.     },
  62.     easeOutCubic: function (x, t, b, c, d) {
  63.         return c*((t=t/d-1)*t*t + 1) + b;
  64.     },
  65.     easeInOutCubic: function (x, t, b, c, d) {
  66.         if ((t/=d/2) < 1) return c/2*t*t*t + b;
  67.         return c/2*((t-=2)*t*t + 2) + b;
  68.     },
  69.     easeInQuart: function (x, t, b, c, d) {
  70.         return c*(t/=d)*t*t*t + b;
  71.     },
  72.     easeOutQuart: function (x, t, b, c, d) {
  73.         return -c * ((t=t/d-1)*t*t*t - 1) + b;
  74.     },
  75.     easeInOutQuart: function (x, t, b, c, d) {
  76.         if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
  77.         return -c/2 * ((t-=2)*t*t*t - 2) + b;
  78.     },
  79.     easeInQuint: function (x, t, b, c, d) {
  80.         return c*(t/=d)*t*t*t*t + b;
  81.     },
  82.     easeOutQuint: function (x, t, b, c, d) {
  83.         return c*((t=t/d-1)*t*t*t*t + 1) + b;
  84.     },
  85.     easeInOutQuint: function (x, t, b, c, d) {
  86.         if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
  87.         return c/2*((t-=2)*t*t*t*t + 2) + b;
  88.     },
  89.     easeInSine: function (x, t, b, c, d) {
  90.         return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
  91.     },
  92.     easeOutSine: function (x, t, b, c, d) {
  93.         return c * Math.sin(t/d * (Math.PI/2)) + b;
  94.     },
  95.     easeInOutSine: function (x, t, b, c, d) {
  96.         return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
  97.     },
  98.     easeInExpo: function (x, t, b, c, d) {
  99.         return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
  100.     },
  101.     easeOutExpo: function (x, t, b, c, d) {
  102.         return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
  103.     },
  104.     easeInOutExpo: function (x, t, b, c, d) {
  105.         if (t==0) return b;
  106.         if (t==d) return b+c;
  107.         if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
  108.         return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
  109.     },
  110.     easeInCirc: function (x, t, b, c, d) {
  111.         return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
  112.     },
  113.     easeOutCirc: function (x, t, b, c, d) {
  114.         return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
  115.     },
  116.     easeInOutCirc: function (x, t, b, c, d) {
  117.         if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
  118.         return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
  119.     },
  120.     easeInElastic: function (x, t, b, c, d) {
  121.         var s=1.70158;
  122.         var p=0;
  123.         var a=c;
  124.         if (t==0) return b;
  125.         if ((t/=d)==1) return b+c;
  126.         if (!p) p=d*.3;
  127.         if (a < Math.abs(c)) {
  128.             a=c;
  129.             var s=p/4;
  130.         }
  131.         else var s = p/(2*Math.PI) * Math.asin (c/a);
  132.         return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
  133.     },
  134.     easeOutElastic: function (x, t, b, c, d) {
  135.         var s=1.70158;
  136.         var p=0;
  137.         var a=c;
  138.         if (t==0) return b;
  139.         if ((t/=d)==1) return b+c;
  140.         if (!p) p=d*.3;
  141.         if (a < Math.abs(c)) {
  142.             a=c;
  143.             var s=p/4;
  144.         }
  145.         else var s = p/(2*Math.PI) * Math.asin (c/a);
  146.         return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
  147.     },
  148.     easeInOutElastic: function (x, t, b, c, d) {
  149.         var s=1.70158;
  150.         var p=0;
  151.         var a=c;
  152.         if (t==0) return b;
  153.         if ((t/=d/2)==2) return b+c;
  154.         if (!p) p=d*(.3*1.5);
  155.         if (a < Math.abs(c)) {
  156.             a=c;
  157.             var s=p/4;
  158.         }
  159.         else var s = p/(2*Math.PI) * Math.asin (c/a);
  160.         if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
  161.         return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
  162.     },
  163.     easeInBack: function (x, t, b, c, d, s) {
  164.         if (s == undefined) s = 1.70158;
  165.         return c*(t/=d)*t*((s+1)*t - s) + b;
  166.     },
  167.     easeOutBack: function (x, t, b, c, d, s) {
  168.         if (s == undefined) s = 1.70158;
  169.         return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
  170.     },
  171.     easeInOutBack: function (x, t, b, c, d, s) {
  172.         if (s == undefined) s = 1.70158;
  173.         if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
  174.         return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
  175.     },
  176.     easeInBounce: function (x, t, b, c, d) {
  177.         return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
  178.     },
  179.     easeOutBounce: function (x, t, b, c, d) {
  180.         if ((t/=d) < (1/2.75)) {
  181.             return c*(7.5625*t*t) + b;
  182.         } else if (t < (2/2.75)) {
  183.             return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
  184.         } else if (t < (2.5/2.75)) {
  185.             return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
  186.         } else {
  187.             return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
  188.         }
  189.     },
  190.     easeInOutBounce: function (x, t, b, c, d) {
  191.         if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
  192.         return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
  193.     }
  194. });
  195.  
  196.  
  197. /*
  198.  ---------------------------------------
  199.  TOGGLE EFFECT
  200.  ---------------------------------------
  201.  */
  202.  
  203. jQuery(document).ready(function(){
  204.     jQuery(".toggle_container").hide();
  205.     jQuery("h3.trigger").click(function(){
  206.         jQuery(this).toggleClass("active").next().slideToggle("normal");
  207.         return false;
  208.     });
  209. });
  210.  
  211.  
  212. /*
  213.  ---------------------------------------
  214. RESPONSIVE MENU
  215.  ---------------------------------------
  216.  
  217. jQuery("<div id=\"responsive-menu\"><select /></div>").appendTo(".top-bar");
  218.  
  219. // Create default option "Go to..."
  220. jQuery("<option />", {
  221.     "selected": "selected",
  222.     "value"   : "",
  223.     "text"    : "Go to..."
  224. }).appendTo("nav select");
  225.  
  226. // Populate dropdown with menu items
  227. jQuery("nav a").each(function() {
  228.     var el = jQuery(this);
  229.     jQuery("<option />", {
  230.         "value"   : el.attr("href"),
  231.         "text"    : el.contents(':not(em)').text()
  232.     }).appendTo("nav select");
  233. });
  234. jQuery("nav select").change(function() {
  235.     window.location = jQuery(this).find("option:selected").val();
  236. });
  237. */
  238.  
  239. jQuery(".seal").toggle(
  240.     function() {
  241.         jQuery(".overlay-bt").animate({
  242.             opacity: '.5',
  243.             zIndex: '99'
  244.         }, 0);
  245.         jQuery("#expose .before").css({
  246.             zIndex: '101'
  247.         });
  248.         jQuery("#form-container").css({
  249.             zIndex: '100'
  250.         });
  251.         jQuery("#home-form").slideToggle(800, "easeOutBounce").css({
  252.             zIndex: '100'
  253.         });
  254.         jQuery("#home-contact").delay(500).addClass('active');
  255.         jQuery(this).animate({
  256.             height: "93px",
  257.             zIndex: "101"
  258.         }, 50);
  259.     },
  260.     function() {
  261.         jQuery(".overlay-bt").animate({
  262.             opacity: '0',
  263.             zIndex: '-1'
  264.         }, 0);
  265.         jQuery("#expose .before, #form-container").removeAttr("style");
  266.         jQuery("#home-contact").removeClass('active');
  267.         jQuery("#home-form").slideToggle(500, "jswing");
  268.         jQuery(this).animate({
  269.             height: "60px",
  270.             zIndex: "2"
  271.         }, 500);
  272.     });
  273.  
  274. (function ($) {
  275.     $.fn.vAlign = function() {
  276.         return this.each(function(i){
  277.             var ah = $(this).height();
  278.             var ph = $(this).parent().height();
  279.             var mh = (ph - ah) / 2;
  280.             $(this).css('margin-top', mh);
  281.         });
  282.     };
  283. })(jQuery);
  284.  
  285. jQuery(window).load(function() {
  286.     jQuery(".foliothumb div").vAlign();
  287. });
  288.  
  289. jQuery(document).ready(function(){
  290.     jQuery(".zilla-toggle-inner").hide();
  291.     jQuery(".zilla-toggle-title").click(function(){
  292.         jQuery(this).toggleClass("active").next().slideToggle("normal");
  293.         return false;
  294.     });
  295. });
  296.    
  297. jQuery( function($) {
  298.     $('.zilla-tab-inner').each( function() {
  299.         var container = $(this);
  300.         container.find('> ul li a').click( function () {
  301.             $(this).parent().addClass( 'selected-tab' ).siblings().removeClass( 'selected-tab' );
  302.             container.find('.zilla-tab').hide().filter(this.hash).show();
  303.             return false;
  304.         }).eq(0).click();
  305.     });
  306. });
  307.  
  308. /*
  309.  * jQuery Foundation Top Bar 2.0.3
  310.  * http://foundation.zurb.com
  311.  * Copyright 2012, ZURB
  312.  * Free to use under the MIT license.
  313.  * http://www.opensource.org/licenses/mit-license.php
  314. */
  315.  
  316. /*jslint unparam: true, browser: true, indent: 2 */
  317.  
  318. ;
  319. (function ($, window, undefined) {
  320.     'use strict';
  321.  
  322.     var settings = {
  323.         index : 0,
  324.         initialized : false
  325.     },
  326.  
  327.     methods = {
  328.         init : function (options) {
  329.             return this.each(function () {
  330.                 settings = $.extend(settings, options);
  331.                 settings.$w = $(window),
  332.                 settings.$topbar = $('nav.top-bar'),
  333.                 settings.$section = settings.$topbar.find('section'),
  334.                 settings.$titlebar = settings.$topbar.children('ul:first');
  335.  
  336.                 var breakpoint = $("<div class='top-bar-js-breakpoint'/>").appendTo("body");
  337.                 settings.breakPoint = breakpoint.width();
  338.                 breakpoint.remove();
  339.  
  340.                 if (!settings.initialized) {
  341.                     methods.assemble();
  342.                     settings.initialized = true;
  343.                 }
  344.  
  345.                 if (!settings.height) {
  346.                     methods.largestUL();
  347.                 }
  348.  
  349.                 if (settings.$topbar.parent().hasClass('fixed')) {
  350.                     $('body').css('padding-top',settings.$topbar.outerHeight())
  351.                 }
  352.  
  353.                 $('.top-bar .toggle-topbar').die('click.fndtn').live('click.fndtn', function (e) {
  354.                     e.preventDefault();
  355.  
  356.                     if (methods.breakpoint()) {
  357.                         settings.$topbar.toggleClass('expanded');
  358.                         settings.$topbar.css('min-height', '');
  359.                     }
  360.  
  361.                     if (!settings.$topbar.hasClass('expanded')) {
  362.                         settings.$section.css({
  363.                             left: '0%'
  364.                         });
  365.                         settings.$section.find('>.name').css({
  366.                             left: '100%'
  367.                         });
  368.                         settings.$section.find('li.moved').removeClass('moved');
  369.                         settings.index = 0;
  370.                     }
  371.                 });
  372.  
  373.                 // Show the Dropdown Levels on Click
  374.                 $('.top-bar .has-dropdown>a').die('click.fndtn').live('click.fndtn', function (e) {
  375.                     if (Modernizr.touch || methods.breakpoint())
  376.                         e.preventDefault();
  377.  
  378.                     if (methods.breakpoint()) {
  379.                         var $this = $(this),
  380.                         $selectedLi = $this.closest('li');
  381.  
  382.                         settings.index += 1;
  383.                         $selectedLi.addClass('moved');
  384.                         settings.$section.css({
  385.                             left: -(100 * settings.index) + '%'
  386.                         });
  387.                         settings.$section.find('>.name').css({
  388.                             left: 100 * settings.index + '%'
  389.                         });
  390.  
  391.                         $this.siblings('ul').height(settings.height + settings.$titlebar.outerHeight(true));
  392.                         settings.$topbar.css('min-height', settings.height + settings.$titlebar.outerHeight(true) * 2)
  393.                     }
  394.                 });
  395.  
  396.                 $(window).on('resize.fndtn.topbar',function() {
  397.                     if (!methods.breakpoint()) {
  398.                         settings.$topbar.css('min-height', '');
  399.                     }
  400.                 });
  401.                
  402.                 /* removed
  403.                 // Go up a level on Click
  404.                 $('.top-bar .has-dropdown .back').die('click.fndtn').live('click.fndtn', function (e) {
  405.                     e.preventDefault();
  406.  
  407.                     var $this = $(this),
  408.                     $movedLi = $this.closest('li.moved'),
  409.                     $previousLevelUl = $movedLi.parent();
  410.  
  411.                     settings.index -= 1;
  412.                     settings.$section.css({
  413.                         left: -(100 * settings.index) + '%'
  414.                     });
  415.                     settings.$section.find('>.name').css({
  416.                         'left': 100 * settings.index + '%'
  417.                     });
  418.  
  419.                     if (settings.index === 0) {
  420.                         settings.$topbar.css('min-height', 0);
  421.                     }
  422.  
  423.                     setTimeout(function () {
  424.                         $movedLi.removeClass('moved');
  425.                     }, 300);
  426.                 });
  427.                 */
  428.             });
  429.         },
  430.  
  431.         breakpoint : function () {
  432.             return settings.$w.width() < settings.breakPoint;
  433.         },
  434.  
  435.         assemble : function () {
  436.             // Pull element out of the DOM for manipulation
  437.             settings.$section.detach();
  438.  
  439.             settings.$section.find('.has-dropdown>a').each(function () {
  440.                 /* added 1 line below */
  441.                 var value = $(this).attr("href");
  442.                 var $link = $(this),
  443.                 $dropdown = $link.siblings('.dropdown'),
  444.                 /*remove value and paste #*/
  445.                 $titleLi = $('<li class="title back js-generated"><h5><a href="'+value+'"></a></h5></li>');
  446.  
  447.                 // Copy link to subnav
  448.                 $titleLi.find('h5>a').html($link.html());
  449.                 $dropdown.prepend($titleLi);
  450.             });
  451.  
  452.             // Put element back in the DOM
  453.             settings.$section.appendTo(settings.$topbar);
  454.         },
  455.      
  456.         largestUL : function () {
  457.             var uls = settings.$topbar.find('section ul ul'),
  458.             largest = uls.first(),
  459.             total = 0;
  460.  
  461.             uls.each(function () {
  462.                 if ($(this).children('li').length > largest.children('li').length) {
  463.                     largest = $(this);
  464.                 }
  465.             });
  466.  
  467.             largest.children('li').each(function () {
  468.                 total += $(this).outerHeight(true);
  469.             });
  470.  
  471.             settings.height = total;
  472.         }
  473.     };
  474.  
  475.     $.fn.foundationTopBar = function (method) {
  476.         if (methods[method]) {
  477.             return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
  478.         } else if (typeof method === 'object' || !method) {
  479.             return methods.init.apply(this, arguments);
  480.         } else {
  481.             $.error('Method ' +  method + ' does not exist on jQuery.foundationTopBar');
  482.         }
  483.     };
  484.  
  485. }(jQuery, this));
  486.  
  487. ;(function ($, window, undefined) {
  488.   'use strict';
  489.  
  490.   var $doc = $(document),
  491.       Modernizr = window.Modernizr;
  492.  
  493.   $(document).ready(function() {
  494.     $.fn.foundationAlerts ? $doc.foundationAlerts() : null;
  495.     $.fn.foundationButtons ? $doc.foundationButtons() : null;
  496.     $.fn.foundationAccordion ? $doc.foundationAccordion() : null;
  497.     $.fn.foundationNavigation ? $doc.foundationNavigation() : null;
  498.     $.fn.foundationTopBar ? $doc.foundationTopBar() : null;
  499.     $.fn.foundationCustomForms ? $doc.foundationCustomForms() : null;
  500.     $.fn.foundationMediaQueryViewer ? $doc.foundationMediaQueryViewer() : null;
  501.     $.fn.foundationTabs ? $doc.foundationTabs({callback : $.foundation.customForms.appendCustomMarkup}) : null;
  502.     $.fn.foundationTooltips ? $doc.foundationTooltips() : null;
  503.     $.fn.foundationMagellan ? $doc.foundationMagellan() : null;
  504.     $.fn.foundationClearing ? $doc.foundationClearing() : null;
  505.  
  506.     $.fn.placeholder ? $('input, textarea').placeholder() : null;
  507.   });
  508.  
  509.   // UNCOMMENT THE LINE YOU WANT BELOW IF YOU WANT IE8 SUPPORT AND ARE USING .block-grids
  510.   // $('.block-grid.two-up>li:nth-child(2n+1)').css({clear: 'both'});
  511.   // $('.block-grid.three-up>li:nth-child(3n+1)').css({clear: 'both'});
  512.   // $('.block-grid.four-up>li:nth-child(4n+1)').css({clear: 'both'});
  513.   // $('.block-grid.five-up>li:nth-child(5n+1)').css({clear: 'both'});
  514.  
  515.   // Hide address bar on mobile devices (except if #hash present, so we don't mess up deep linking).
  516.   if (Modernizr.touch && !window.location.hash) {
  517.     $(window).load(function () {
  518.       setTimeout(function () {
  519.         // At load, if user hasn't scrolled more than 20px or so...
  520.    if( $(window).scrollTop() < 20 ) {
  521.           window.scrollTo(0, 1);
  522.         }
  523.       }, 0);
  524.     });
  525.   }
  526.  
  527. })(jQuery, this);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement