Senza categoria

cache web app

La parte fondamentale è aggiungere vicino le risorse “statiche” il seguente parametro:

?v=’.time().’  o comunque un equivalente in qualsiasi linguaggio in grado di generare una stringa random, possibilmente mai identica in modo tale da forzare il dispositivo ad eseguire un refresh della cache.

echo '

<script src="./framework/js/catalogoMobileInit.js?v='.time().'"></script>
<script src="./framework/js/loadingoverlay.min.js?v='.time().'"></script>

';

 

javascript, jQuery

Smooth Scroll

<script type="text/javascript">
 jQuery(document).ready(function($) { 
 
 //EFFETTO MORBIDOSO
 
 $(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-100
 }, 1000);
 return false;
 }
}
 });
});
 
 });
</script>