Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- // NAVIGATION
- jQuery('.main-menu li a,.footer-menu li a').each(function(){ var title = jQuery(this).attr('title'); jQuery(this).parent().addClass(title); }); jQuery('ul li a[title="contact"]').click(function(e){ e.preventDefault(); var scrollP = jQuery('#bottom').offset(); jQuery('html,body').animate({scrollTop: scrollP.top}, 1000); }); // FOOTER jQuery('.beers-section .beers-wrapper').filter(':first-child').addClass('some-beers').next().addClass('some-bottles-and-cans');
- // Slider
- $('.slider-wrapper ul li:first-child').addClass('current-slide');
- $('.slider-controls a.prev').click(function(e) {
- e.preventDefault();
- if(!$('.slider-wrapper ul').is(':animated')) {
- if(!$('li.current-slide').is(':first-child')) {
- var margin = $('li.current-slide').prev().width()+24;
- $('.slider-wrapper ul').animate({'marginLeft': "+="+margin}, 1000);
- $('li.current-slide').prev().addClass('current-slide');
- $('li.current-slide').last().removeClass('current-slide');
- } else {
- $(this).unbind('mouseenter');
- };
- };
- })
- $('.slider-controls a.next').click(function(e) {
- e.preventDefault();
- if(!$('.slider-wrapper ul').is(':animated')) {
- if(!$('li.current-slide').is(':last-child')) {
- var margin = $('li.current-slide').width()+24;
- $('.slider-wrapper ul').animate({'marginLeft': "-="+margin}, 1000);
- $('li.current-slide').next().addClass('current-slide');
- $('li.current-slide').first().removeClass('current-slide');
- };
- };
- })
- // Menu
- $(".the-menu-item a").hover(
- function () {
- $(this).find('span.download-link').show();
- },
- function () {
- $(this).find('span.download-link').hide();
- }
- );
- // Animations
- if(!getCookie('visited')) {
- $(window).load(function() {
- var sidebarHeight = $('.sidebar').outerHeight();
- $('.sidebar').css({
- 'top': -(sidebarHeight+90)
- })
- $('.sidebar').animate({'top': 0}, 2000, function(){
- $('.sidebar h1, .sidebar h2').fadeIn(1000)
- $('.header .social-section').animate({'top': 0}, 1000);
- $('.main-menu').animate({'left': 0}, 1000);
- })
- setCookie('visited', 1, 7);
- });
- } else {
- $('body').addClass('visited')
- }
- $(window).bind('unload', function() {
- eraseCookie('visited');
- });
- // Cookies
- function setCookie(name, value, days) {
- var now=new Date();
- var expTime=now.getTime()+days*24*60*60*1000;
- var expDate=new Date(expTime);
- document.cookie=name+"="+value+"; EXPIRES="+expDate.toGMTString();
- }
- function getCookie(name) {
- var start=document.cookie.indexOf(name+"=");
- if(start==-1) return null;
- var len=start+name.length+1;
- var end=document.cookie.indexOf(";", len);
- if(end==-1) end=document.cookie.length;
- return document.cookie.substring(len, end)
- return true
- }
- function eraseCookie(name) {
- setCookie(name,"",-1);
- }
- // Contact Menu Item
- $('.main-menu li.contact a').click(function(e){
- e.preventDefault();
- $("html").animate({ scrollTop: $(document).height() }, "slow");
- })
- });
Add Comment
Please, Sign In to add comment