$(document).ready( function(){ // validate signup form on keyup and submit //Validate form $("#contact").validationEngine(); $("a.colorbox").colorbox({maxHeight: "100%"}); $('#slideshow').nivoSlider({ effect:'fold,sliceUpDownLeft', //Specify sets like: 'fold,fade,sliceDown' slices:15, animSpeed:500, //Slide transition speed pauseTime:6000, startSlide:0, //Set starting Slide (0 index) directionNav:false, //Next & Prev directionNavHide:false, //Only show on hover controlNav:true, //1,2,3... controlNavThumbs:false, //Use thumbnails for Control Nav controlNavThumbsFromRel:false, //Use image rel for thumbs keyboardNav:true, //Use left & right arrows pauseOnHover:true, //Stop animation while hovering manualAdvance:false, //Force manual transitions captionOpacity:0.8 //Universal caption opacity }); $('.theme-dark .nivo-controlNav a').text(''); /* Al click sparisce il valore di default e cambia lo stile. All'uscita, se non รจ stato inserito niente, torna il valore di default */ $('.default_value').each( function(){ //$(this).attr( 'start_value', $(this).val() ); if( $(this).attr('start_value') == $(this).val() ){ $(this).css('font-style', 'italic'); $(this).css('color', '#888'); } $(this).bind( 'focus', function(){ if( $(this).val() == $(this).attr('start_value') ){ $(this).css('font-style', 'normal'); $(this).css('color', '#333'); $(this).val(''); } } ); $(this).bind( 'focusout', function(){ if( $(this).val()=='' ){ $(this).css('font-style', 'italic'); $(this).css('color', '#888'); $(this).val( $(this).attr('start_value') ); } }); } ); }); function getCurrentPage( url ){ page = url; re = /(.+)\/(.+)$/g; complete_url = page.replace(re,"$2"); //tolgo il parametro lang re = /(.+)&lang=[a-z]{2}/g; complete_url = complete_url.replace( re, "$1" ); complete_url = complete_url.replace( /#.*/, '' ); return complete_url; } function check_form( formid ){ return false; } /* Si interfaccia con il plugin validate e controlla che il campo non abbia come valore quello di default */ function checkNoDefault( field, rules, i, options ){ if( field.val() == "" || field.val() == field.attr("start_value") ) return options.allrules.required.alertText; }