/* 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(); } }); }); //menu $(document).ready(function() { $('#nav').onePageNav(); }); //slider $(document).ready(function() { $('#myCarousel').carousel({ interval: 7000 }); });