/* * Create HTML5 elements for IE's sake */ /* catch ie10 */ if (/*@cc_on!@*/false) { document.documentElement.className+=' ie10'; } /* slider */ jQuery(window).load(function() { jQuery('ul.sf-menu').superfish(); }); /* scroll to top */ jQuery(document).ready(function(){ // hide #back-top first jQuery("#back-top").hide(); // fade in #back-top jQuery(function () { jQuery(window).scroll(function () { if (jQuery(this).scrollTop() > 500) { jQuery('#back-top').fadeIn(); } else { jQuery('#back-top').fadeOut(); } }); // scroll body to 0px on click jQuery('#back-top a').click(function () { jQuery('body,html').animate({ scrollTop: 0 }, 800); return false; }); }); }); //validation // When the browser is ready... $(function() { // Setup form validation on the #register-form element $("#register-form").validate({ // Specify the validation rules rules: { firstname: "required", message: "required", email: { required: true, email: true }, password: { required: true, minlength: 5 }, agree: "required" }, // Specify the validation error messages messages: { firstname: "Please enter your first name", message: "Please enter your message", password: { required: "Please provide a password", minlength: "Your password must be at least 5 characters long" }, email: "Please enter a valid email address", agree: "Please accept our policy" }, submitHandler: function(form) { form.submit(); } }); }); //carousel $('#list_photos').carouFredSel({ responsive: true, width: '100%', scroll: 2, items: {width: 250,visible: {min: 2, max: 6}} }); //overlay $(document).ready(function(){ if (Modernizr.touch) { // show the close overlay button $(".close-overlay").removeClass("hidden"); // handle the adding of hover class when clicked $(".img").click(function(e){ if (!$(this).hasClass("hover")) { $(this).addClass("hover"); } }); // handle the closing of the overlay $(".close-overlay").click(function(e){ e.preventDefault(); e.stopPropagation(); if ($(this).closest(".img").hasClass("hover")) { $(this).closest(".img").removeClass("hover"); } }); } else { // handle the mouseenter functionality $(".img").mouseenter(function(){ $(this).addClass("hover"); }) // handle the mouseleave functionality .mouseleave(function(){ $(this).removeClass("hover"); }); } }); //menu $(document).ready(function() { $('#nav').onePageNav(); }); //pp $(document).ready(function(){ $("area[rel^='prettyPhoto']").prettyPhoto(); $(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: false}); $(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true}); $("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({ custom_markup: '
', changepicturecallback: function(){ initialize(); } }); $("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({ custom_markup: '', changepicturecallback: function(){ _bsap.exec(); } }); }); //slider $(document).ready(function() { $('#myCarousel').carousel({ interval: 7000 }); });