//notification $(document).ready(function() { $("#Notification").delay(2000).animate({ "left":"0px" }); $("#Notification").delay(4000).animate({ "left":"-50%" }); }); //Slideshow var counter = 0, // to keep track of current slide $items = $('.diy-slideshow figure'), // a collection of all of the slides, caching for performance numItems = $items.length; // total number of slides // this function is what cycles the slides, showing the next or previous slide and hiding all the others var showCurrent = function(){ var itemToShow = Math.abs(counter%numItems);// uses remainder (aka modulo) operator to get the actual index of the element to show $items.removeClass('show'); // remove .show from whichever element currently has it $items.eq(itemToShow).addClass('show'); }; // add click events to prev & next buttons $('.next').on('click', function(){ counter++; showCurrent(); }); $('.prev').on('click', function(){ counter--; showCurrent(); }); // if touch events are supported then add swipe interactions using TouchSwipe https://github.com/mattbryson/TouchSwipe-Jquery-Plugin if('ontouchstart' in window){ $('.diy-slideshow').swipe({ swipeLeft:function() { counter++; showCurrent(); }, swipeRight:function() { counter--; showCurrent(); } }); } //Clock $(document).ready(function() { // Create two variable with the names of the months and days in an array var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; var dayNames= ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"] // Create a newDate() object var newDate = new Date(); // Extract the current date from Date object newDate.setDate(newDate.getDate()); // Output the day, date, month and year $('#Date').html(dayNames[newDate.getDay()] + " " + newDate.getDate() + ' ' + monthNames[newDate.getMonth()] + ' ' + newDate.getFullYear() + ' | '); setInterval( function() { // Create a newDate() object and extract the seconds of the current time on the visitor's var seconds = new Date().getSeconds(); // Add a leading zero to seconds value $("#sec").html(( seconds < 10 ? "0" : "" ) + seconds); },1000); setInterval( function() { // Create a newDate() object and extract the minutes of the current time on the visitor's var minutes = new Date().getMinutes(); // Add a leading zero to the minutes value $("#min").html(( minutes < 10 ? "0" : "" ) + minutes); },1000); setInterval( function() { // Create a newDate() object and extract the hours of the current time on the visitor's var hours = new Date().getHours(); // Add a leading zero to the hours value $("#hours").html(( hours < 10 ? "0" : "" ) + hours); }, 1000); }); //Smooth scrolling $(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); });