$(document).ready( function(){ $('#menu>li').mouseover( function(){ $(this).stop().css( 'padding-bottom', '15px' ); }); $('#menu>li').mouseout( function(){ $(this).stop().css( 'padding-bottom', '10px' ); }); $('.collezioni').live({ mouseenter: function(){ $('#collections').show(); }, mouseleave: function(){ $('#collections').hide(); } }); // validate signup form on keyup and submit $("#contact").validate({ rules: { nome: "required", telefono: "required", email: { required: true, email: true }, testo: "required", privacy: "required" }, messages: { nome: "Inserisci il tuo nome e cognome", telefono: "Inserisci il tuo numero di telefono", email: "Inserisci il tuo indirizzo email", testo: "Inserisci il testo del messaggio", privacy: "Devi accettare il trattamento dei dati personali" } }); $('#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(''); //Suono in sottofondo $("#bg_song").jPlayer({ ready: function () { $(this).jPlayer("setMedia", { mp3: "http://www.lazzarimobili.com/The_Myst-NeoSound-10026_hifi.mp3" }).jPlayer("play"); }, swfPath: "/js/Jplayer.swf", supplied: "mp3", loop: true, solution: "flash" }); /* if( window.location.hash.length>0 ){ $.ajax({ type: "GET", url: setAjaxMode( window.location.hash.replace('#','') ), dataType: "html", success: function(html) { $('#content>div').html( html ); } }); } $('a').bind('click',function(event){ event.preventDefault(); page = getCurrentPage(this.href); var url = setAjaxMode( page ); $.get( url, function(response){ $('#content>div').html( response ); window.location.hash = "#"+getCurrentPage(page); }); }); */ }); 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; } /* Aggiunge il mode=ajax ai parametri */ function setAjaxMode( url ){ var newAdditionalURL = ""; var tempArray = url.split("?"); var baseURL = tempArray[0]; var aditionalURL = tempArray[1]; var temp = ""; if(aditionalURL){ var tempArray = aditionalURL.split("&"); for ( var i in tempArray ){ if(tempArray[i].indexOf("rows") == -1){ newAdditionalURL += temp+tempArray[i]; temp = "&"; } } } var rows_txt = temp+"mode=ajax"; var finalURL = baseURL+"?"+newAdditionalURL+rows_txt; return finalURL; }