JQuery: passare url da un link all’altro: Ad esempio: <a href=”www.target1.it” id=”1″> e <a href=”VUOTO” id=”2″> <!DOCTYPE html><html lang=”it-IT” ><head><meta charset=”UTF-8″ /> <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js”></script> <style type=”text/css”>.box{width:200px;height:100px;margin:10px;}.box1{background:red;}.box2{background:green;}.box3{background:yellow;} </style> </head><body> …
JQuery: passare dei valori via JQuery da un paragrafo all’altro <!DOCTYPE html><html lang=”it-IT” ><head><meta charset=”UTF-8″ /> <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js”></script> <style type=”text/css”>.box{width:200px;height:100px;margin:10px;}.box1{background:red;}.box2{background:green;}.box3{background:blue;}.box4{background:yellow;}</style> </head><body> <script type=”text/javascript” language=”javascript”> …
Esempio di iscrizione ad un servizio esterno di newsletter tramite ajax e JQuery <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js ” type=”text/javascript”></script> <form id=”Form” method=”post”> <input id=”email” name=”email” value=”[email protected]” type=”hidden”/> <input …
Guida JQuery su come aprire i files in .pdf con target _blank, in automatico: Script: /* Artigiani Del Web – .pdf target _blank */ jQuery(‘a[href$=”.pdf”]’).attr(‘target’, ‘_blank’).addClass(“external”); ( Nell’esempio aggiunge anche la class “exsternal” per scopi grafici. )
Come aggiungere in automatico il link con formattazione :mailto a tutti quei testi con email privi di link. Spiegazione: [email protected] —> diventa in output: <a href=”mailto:[email protected]”>[email protected]</a> Esempio: <span class=”contact-widget”> [email protected] </span> diventa in output: <span class=”contact-widget”> <a href=”mailto:[email protected]”>[email protected]</a></span> Selettore …
Come creare una FotoGallery automatica che pesca le immagini in automatico da una cartella, scritto in php e JQuery, con Alt automatico a partire dal nome del file. 1) Mettere tutte le foto nella cartella “images/gallery/” saranno scansionate in automatico: …
Ecco come aggiungere una finestra di conferma cancellazione in jquery: Elemento selettore: class=’cancella’ Html: <input class=’cancella’ type=’submit’ name=’cancella_progetto’ value=’Cancella Progetto’> Script: /* Artigiani Del Web – Conferma cancellazione */ <script type=’text/javascript’> $(document).ready(function(){ …
Come aggiungere una Validazione “equal to” (due campi devono essere uguali) utilizzando JQuery. Può servire ad esempio per verificare che due campi email siano uguali (il classico “riscrivi la tua mail”) per verificarne la correttezza. Script: /* Artigiani Del Web …
Salve a tutti, ecco una piccola guida JQuery su come popolare il campo “alt” in automatico alle immagini se campo è vuoto: /* Artigiani Del Web – “alt” automatico alle immagini se campo vuoto */ jQuery(‘img’).each(function(){ var img = jQuery(this); …
Guida JQuery su come aprire i link diversi dal sito con target _blank, in automatico: Script: /* Artigiani Del Web – External Links */ jQuery(“a[href*=’http://’]:not([href*=’”+location.hostname+”‘]), [href*=’https://’]:not([href*=’”+location.hostname+”‘])”) .attr(“target”,”_blank”).attr(“title”,”Opens new window”) .addClass(“external”);










