Visualizzazione dei risultati da 1 a 10 su 10
  1. #1
    Utente di HTML.it L'avatar di Iron83
    Registrato dal
    Jun 2008
    Messaggi
    396

    [MooTools] Effetto Mouseenter OnLoad

    Ciao ragazzi come da topic,

    vorrei sapere come fare per caricare l'effetto in questione nel body tramite l'utilizzo del metodo onload.

    Lo scopo è di espandere il div al caricamento della pagina e non al passaggio del mouse

    Codice PHP:
    window.addEvent('domready', function(){
        

        
    // Second Example
        
        // The same as before: adding events
        
    $('layout').addEvents({
            
    'mouseenter': function(){
                
    // Always sets the duration of the tween to 1000 ms and a bouncing transition
                // And then tweens the height of the element
                
    this.set('tween', {
                    
    duration1000,
                    
    transitionFx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
                
    }).tween('height''600px');
            },
            
    'mouseleave': function(){
                
    // Resets the tween and changes the element back to its original size
                
    this.set('tween', {}).tween('height''20px');
            }
        });
    }); 

  2. #2
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    prova

    window.addEvent('load', function(){
    $('layout').fireEvent('mouseEnter')
    })

    http://mootools.net/docs/core/Elemen...ment:fireEvent

  3. #3
    Utente di HTML.it L'avatar di Iron83
    Registrato dal
    Jun 2008
    Messaggi
    396
    Ho cambiato il tutto in questo modo ma l'effetto non viene eseguito ne nell'onload ne nel mouseenter

    Codice PHP:
    //window.addEvent('domready', function(){
        
    window.addEvent('load', function(){

        
    // Second Example
        
        // The same as before: adding events
        //$('layout').addEvents({
        
    $('layout').fireEvent('mouseenter'){
            
    'mouseenter': function(){
                
    // Always sets the duration of the tween to 1000 ms and a bouncing transition
                // And then tweens the height of the element
                
    this.set('tween', {
                    
    duration1000,
                    
    transitionFx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
                
    }).tween('height''600px');
            },
            
    'mouseleave': function(){
                
    // Resets the tween and changes the element back to its original size
                
    this.set('tween', {}).tween('height''20px');
            }
        });
    }); 

  4. #4
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    tutto quello che devi fare e' aggiungere quello che ho postato dopo quello che avevi postato inizialmente

  5. #5
    Utente di HTML.it L'avatar di Iron83
    Registrato dal
    Jun 2008
    Messaggi
    396
    Scusa ma non sono un asso in js e framework vari, o incollato il tutto alla fine , ma al caricamento non funziona mentre al mouseenter si

    Codice PHP:
    window.addEvent('domready', function(){
        

        
    // Second Example
        
        // The same as before: adding events
        
    $('layout').addEvents({
            
    'mouseenter': function(){
                
    // Always sets the duration of the tween to 1000 ms and a bouncing transition
                // And then tweens the height of the element
                
    this.set('tween', {
                    
    duration1000,
                    
    transitionFx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
                
    }).tween('height''600px');
            },
            
    'mouseleave': function(){
                
    // Resets the tween and changes the element back to its original size
                
    this.set('tween', {}).tween('height''20px');
            }
        });
    });

    window.addEvent('load', function(){
    $(
    'layout').fireEvent('mouseEnter')
    }) 

  6. #6
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    $('layout').fireEvent('mouseenter')

  7. #7
    Utente di HTML.it L'avatar di Iron83
    Registrato dal
    Jun 2008
    Messaggi
    396
    Azz è vero! mi è sfuggita la E, ora funziona

    grazie mille

  8. #8
    Utente di HTML.it L'avatar di Iron83
    Registrato dal
    Jun 2008
    Messaggi
    396
    Altro problemino (lo so che mi stai odiando )

    con explorer (7-8) e chrome, l'effetto non funziona, il div rimane "chiuso".

    con firefox 3.6.9 funziona perfettamente


  9. #9
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    perche' dovrei odiarti?
    se ho voglia/tempo per seguire quello che dici ti seguo, altrimenti passo sempre volentieri la parola agli altri!

    in questo caso di tempo non ne ho, ma il problema l' ho rilevato tempo addietro e l' ho dovuto risolvere cosi'
    codice:
    var contentLoaded=false;
    window.addEvent('domready', function(){
    
    
        // Second Example
    
        // The same as before: adding events
        $('layout').addEvents({
            'mouseenter': function(){
                // Always sets the duration of the tween to 1000 ms and a bouncing transition
                // And then tweens the height of the element
                this.set('tween', {
                    duration: 1000,
                    transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
                }).tween('height', '600px');
            },
            'mouseleave': function(){
                // Resets the tween and changes the element back to its original size
                this.set('tween', {}).tween('height', '20px');
            }
        });
        if(contentLoaded) $('layout').fireEvent('mouseenter')
        else window.addEvent('load', function(){$('layout').fireEvent('mouseenter')})
    });
    
    window.addEvent('load', function(){contentLoaded=true})
    prova
    ciao

  10. #10
    Utente di HTML.it L'avatar di Iron83
    Registrato dal
    Jun 2008
    Messaggi
    396
    Era per dire

    comunque funziona alla perfezione con tutti e tre i browser!

    Grazie

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.