Category: dhtml

15000 tutorials per photoshop

Ottima raccolta di tutorials su good-tutorials.com divisi per categorie.

Sito web: http://www.good-tutorials.com/

Multilevel Drop Down Navigation Menus: Esempi e Tutorials



Sito web: http://www.noupe.com/..-tutorials.html

Tutorial avanzati su tematiche web su nettuts.com

Ottimo sito dove poter trovare interessanti tutorial avanazati su programmazione web.

Sito web: http://nettuts.com/

Tabelle richiudibili con DOM e CSS

 

Sito web: http://icant.co.uk/sandbox/footercollapsetables/

Una serie di links a video tutorials

The JavaScript Programming Language (by Douglas Crockford)
Yahoo! JavaScript Architect Douglas Crockford provides a comprehensive introduction to the JavaScript Programming Language in this four-part video:

  • JavaScript Video Lecture Part I (Yahoo Video)
    JavaScript, aka Mocha, aka LiveScript, aka JScript, aka ECMAScript, is one of the world’s most popular programming languages. Virtually every personal computer in the world has at least one JavaScript interpreter installed on it and in active use. JavaScript’s popularity is due entirely to its role as the scripting language of the WWW. Despite its popularity, few know that JavaScript is a very nice dynamic object-oriented general-purpose programming language. How can this be a secret? Why is this

Realizzare uno slider con javascript

<script>
var tempo=100;
var val=10;
var max=100;
var min=10;

function apri(){
setTimeout("aumenta()",tempo);
}

function chiudi(){
setTimeout("diminusci()",tempo);
}

function aumenta(){
  if(val<=max){
        val=val+10;
        muovi(val);
        apri();
        }
}

function diminusci(){
  if(val>=min){
        val=val-10;
        muovi(val);
        chiudi();
        }
}

function muovi(quanto){
         oggetto=ObjById(‘cosa’);
         oggetto.style.height=quanto;
}

function ObjById( id )
{
    if (document.getElementById)
        var returnVar = document.getElementById(id);
    else if (document.all)
        var returnVar = document.all[id];
    else if (document.layers)
        var returnVar = document.layers[id];
    return returnVar;
}
</script>

<body>

<input type="button" value="apri" onclick="javascript:apri(val);">
<input type="button" value="chiudi" onclick="javascript:chiudi(val);">

<div id="cosa" style="background-color:red;">contenuto del blocco da sccrollare</div>…

Upload di file come gli allegati di google

In questo tutorial vedremo come creare un sistema simile a quello gi gmail per allegare i file alle email. Funziona che se si clicca su aggiungi altro file, appare un box con un input per allegare il file.

html

<input type="file" name="attachment" id="attachment" onchange="document.getElementById(‘moreUploadsLink’).style.display = ‘block’;" />
<div id="moreUploads"></div>
<div id="moreUploadsLink" style="display:none;"><a href="javascript:addFileInput();">Aggiungi altro file</a></div>

javascript

var upload_number = 2;
function addFileInput() {
     var d = document.createElement("div");
     var file = document.createElement("input");
     file.setAttribute("type", "file");
     file.setAttribute("name", "attachment"+upload_number);
     d.appendChild(file);
     document.getElementById("moreUploads").appendChild(d);
     upload_number++;
} …

Conoscere la posizione della scrollbar in javascript

function f_scrollLeft() {
        return f_filterResults (
                window.pageXOffset ? window.pageXOffset : 0,
                document.documentElement ? document.documentElement.scrollLeft : 0,
                document.body ? document.body.scrollLeft : 0
        );
}
function f_scrollTop() {
        return f_filterResults (
                window.pageYOffset ? window.pageYOffset : 0,
                document.documentElement ? document.documentElement.scrollTop : 0,
                document.body ? document.body.scrollTop : 0
        );
}
function f_filterResults(n_win, n_docel, n_body) {
        var n_result = n_win ? n_win : 0;
        if (n_docel &#038;& (!n_result || (n_result > n_docel)))
                n_result = n_docel;
        return n_body &#038;& (!n_result || (n_result > n_body)) ? n_body : n_result;
}…

La funzione javascript GetElementsByClass

function getElementsByClass(searchClass,node,tag) {
        var classElements = new Array();
        if ( node == null )
                node = document;
        if ( tag == null )
                tag = ‘*’;
        var els = node.getElementsByTagName(tag);
        var elsLen = els.length;
        var pattern = new RegExp(‘(^|\\s)’+searchClass+’(\\s|$)’);
        for (i = 0, j = 0; i < elsLen; i++) {
                if ( pattern.test(els[i].className) ) {
                        classElements[j] = els[i];
                        j++;
                }
        }
        return classElements;
}…

Inserire un testo nella posizione del cursore in un campo textfield

function insertAtCursor(campo, stringa) {
  if (document.selection) {
    campo.focus();
    sel = document.selection.createRange();
    sel.text = stringa;
  }
  else if (campo.selectionStart || campo.selectionStart == ’0′) {
    var startPos = campo.selectionStart;
    var endPos = campo.selectionEnd;
    campo.value = campo.value.substring(0, startPos)
                  + stringa
                  + campo.value.substring(endPos, campo.value.length);
  } else {
    campo.value += stringa;
  }
}

che possiamo richiamare tramite:

insertAtCursor(document.formName.fieldName, ‘this value’);…

Menu a comparsa laterale

Creare il menu

La prima e più importante parte della realizzazione del nostro menu è la struttura stessa del menu. La cosa migliore da fare è creare un elenco non ordinato, con ogni sotto menu che a sua volta compare come elenco non ordinato all’interno della voce dell’elenco genitore. Suona complicato? Invece è davvero molto semplice:

<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a>
<ul>
<li><a href="#">History</a></li>
<li><a href="#">Team</a></li>
<li><a href="#">Offices</a></li>
</ul>
</li>
<li><a href="#">Services</a>
<ul>
<li><a href="#">Web Design</a></li>
<li><a href="#">Internet
Marketing</a></li>
<li><a href="#">Hosting</a></li>
<li><a href="#">Domain Names</a></li>
<li><a href="#">Broadband</a></li>
</ul>
</li>
<li><a href="#">Contact Us</a>
<ul>
<li><a href="#">United Kingdom</a></li>
<li><a href="#">France</a></li>
<li><a href="#">USA</a></li>
<li><a href="#">Australia</a></li>
</ul>
</li>
</ul>

Continua a leggere su : http://www.gdesign.it/pages/howto/articoli/menuc/menuc.php

Condividi





Booking online




Categorie