Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 23
  1. #1

    Effetto fade in e out navigazione

    ragazzi sono riuscito a trovare questo script che funziona ad hoc, ma non so proprio ora come dare un effetto morbido di fade alla navigazione, vi incollo lo script:

    graziee


    jQuery(function( $ ){

    var $sections = $('#navigation a'),// Links on the left
    last = null;// Last section

    $sections.click(function(){
    if( last != this ){ // let's avoid needless requests
    var url = 'html/' + this.hash.slice(1) + '.html';
    $('#content').html( '<p class="loading">Loading...</p>' ).load( url, function(){
    this.scrollLeft = 0;//scroll back to the left

    });
    }
    last = this;
    this.blur(); // Remove the awful outline
    return false;
    });
    $sections.eq(0).click(); // Load the first section
    });

  2. #2
    Utente di HTML.it L'avatar di m4rko80
    Registrato dal
    Aug 2008
    residenza
    Milano
    Messaggi
    2,655
    Ciao, non l'ho provato ma forse...

    $('#content').html( '<p class="loading">Loading...</p>' ).hide().load( url, function(){
    this.scrollLeft = 0;//scroll back to the left

    }).fadeIn();

    ......

    nascondi #content e dopo che ci hai caricato il contenuto con load() lo mostri con fade.

  3. #3
    ehy!! ciao grazie, per la risposta, ma... no..

    $('#content').html( '<p class="loading">Loading...</p>' ).hide().load( url, function(){
    this.scrollLeft = 0;//scroll back to the left
    }).fadeIn();
    }
    last = this;
    this.blur(); // Remove the awful outline
    return false;
    });

    $sections.eq(0).click(); // Load the first section
    });


    scatta sempre, nel senso non c'è la transizione..
    Appena riesce caspita faccio un post apposta perchè credo che sia utile per moltissimi.

  4. #4
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    il fadeIn va nel callback del load
    ...load( url, function(){$(this).hide().fadeIn('slow');})

  5. #5
    caspita...è dura...nemmeno così..non nasconde nemmeno il #content...

  6. #6
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    sbagli altro
    controlla la console javascript
    posta tutto il codice interessato

  7. #7
    mah..davvero non so..
    incollo il codice, come verisone di jquery uso:
    http://ajax.googleapis.com/ajax/libs.../jquery.min.js



    jQuery(function( $ ){

    var $sections = $('#navigation a'),// Links on the left
    last = null;// Last section

    $sections.click(function(){
    if( last != this ){ // let's avoid needless requests
    var url = 'html/' + this.hash.slice(1) + '.html';
    $('#content').html( '<p class="loading">Loading...</p>' ).load( url, function(){$(this).hide().fadeIn('slow');})
    this.scrollLeft = 0;//scroll back to the left


    });
    }
    last = this;
    this.blur(); // Remove the awful outline
    return false;
    });

    $sections.eq(0).click(); // Load the first section


    });

  8. #8
    se qualcuno ha un altro metodo..accetto qualsiasi codice..

  9. #9
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    se controllassi la console capiresti di aver incollato a caso!

    e se postassi codice formattato salterebbe pure piu' facilmente all' occhio
    codice:
    jQuery(function( $ ){
    	var $sections = $('#navigation a'),// Links on the left
    	last = null;// Last section
    
    	$sections.click(function(){
    		if( last != this ){ // let's avoid needless requests
    			var url = 'html/' + this.hash.slice(1) + '.html';
    			$('#content').html( '<p class="loading">Loading...</p>' )
    			.load( url, function(){
    				$(this).hide().fadeIn('slow');
    				this.scrollLeft = 0;//scroll back to the left
    			})
    
    		}
    		last = this;
    		this.blur(); // Remove the awful outline
    		return false;
    	});
    
    	$sections.eq(0).click(); // Load the first section
    
    
    });

  10. #10
    caspita...non voglio essere un rompi..mah...xinod, scusa..
    non riesco ad uscirne..


    ho messo online l'esempio..

    link---> demo

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.