HTMLify
custom.js
Views: 1 | Author: cody
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | // Custom Script // Developed by: Samson.Onna // CopyRights : http://webthemez.com /* Theme by: WebThemez.com Note: Please use our back link in your site */ $( function() { var endDate = "December 28, 2015 15:03:25"; $('.countdown.simple').countdown({ date: endDate }); $('.countdown.styled').countdown({ date: endDate, render: function(data) { $(this.el).html("<div>" + this.leadingZeros(data.days, 3) + " <span>days</span></div><div>" + this.leadingZeros(data.hours, 2) + " <span>hrs</span></div><div>" + this.leadingZeros(data.min, 2) + " <span>min</span></div><div>" + this.leadingZeros(data.sec, 2) + " <span>sec</span></div>"); } }); $('.countdown.callback').countdown({ date: +(new Date) + 10000, render: function(data) { $(this.el).text(this.leadingZeros(data.sec, 2) + " sec"); }, onEnd: function() { $(this.el).addClass('ended'); } }).on("click", function() { $(this).removeClass('ended').data('countdown').update(+(new Date) + 10000).start(); }); }); var customScripts = { onePageNav: function () { $('#mainNav').onePageNav({ currentClass: 'active', changeHash: false, scrollSpeed: 950, scrollThreshold: 0.2, filter: '', easing: 'swing', begin: function () { //I get fired when the animation is starting }, end: function () { //I get fired when the animation is ending if(!$('#main-nav ul li:first-child').hasClass('active')){ $('.header').addClass('addBg'); }else{ $('.header').removeClass('addBg'); } }, scrollChange: function ($currentListItem) { //I get fired when you enter a section and I pass the list item of the section if(!$('#main-nav ul li:first-child').hasClass('active')){ $('.header').addClass('addBg'); }else{ $('.header').removeClass('addBg'); } } }); $("a[href='#top']").click(function () { $("html, body").animate({ scrollTop: 0 }, "slow"); return false; }); $("a[href='#basics']").click(function () { $("html, body").animate({ scrollTop: $('#services').offset().top}, "slow"); return false; }); }, waySlide: function(){ /* Waypoints Animations ------------------------------------------------------ */ $('#services').waypoint(function() { $('#services .col-md-3').addClass( 'animated fadeInUp show' ); }, { offset: 800}); $('#aboutUs').waypoint(function() { $('#aboutUs').addClass( 'animated fadeInUp show' ); }, { offset: 800}); $('#contactUs').waypoint(function() { $('#contactUs .parlex-back').addClass( 'animated fadeInUp show' ); }, { offset: 800}); }, init: function () { customScripts.onePageNav(); customScripts.waySlide(); } } $('document').ready(function () { $.backstretch([ "images/img1.jpg" , "images/img2.jpg" , "images/img3.jpg" ], {duration: 3000, fade: 1250}); customScripts.init(); $('#services .col-md-3, #features, #aboutUs, #clients, #portfolio, #plans, #contactUs .parlex-back').css('opacity','0'); $( "#menuToggle" ).toggle(function() { $(this).find('i').removeClass('fa-bars').addClass('fa-remove'); $('#mainNav').animate({"right":"0px"}, "slow"); }, function() { $('#mainNav').animate({"right":"-200px"}, "slow"); $(this).find('i').removeClass('fa-remove').addClass('fa-bars'); }); }); |