Changeset 2970

Show
Ignore:
Timestamp:
07/25/08 12:10:04 (4 weeks ago)
Author:
gcroes
Message:

Légère amélioration du code JS

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/project/modules/devel/cms3/heading/templates/headingelements.admin.tpl

    r2968 r2970  
    1818 
    1919var FXArray = new Array (); 
    20 var fxStartParams = {'duration':300, 'wait': false}; 
    21 var fxStopParams = {'duration':1000, 'wait': false}; 
    2220    $$('.headingElementTypeImage').each (function (el){ 
    2321       el.setStyle ('opacity', 0.5); 
     
    3331     
    3432    function startFXArray (idElement){ 
     33        resetFxArray (idElement, {'duration':300, 'wait': false}); 
     34        FXArray[idElement][0].start (1); 
     35        FXArray[idElement][1].start (64); 
     36        FXArray[idElement][2].start (64);       
     37    } 
     38     
     39    function stopFxArray (idElement){ 
     40        resetFxArray (idElement, {'duration':1000, 'wait': false}); 
     41        FXArray[idElement][0].start (0.5); 
     42        FXArray[idElement][1].start (40); 
     43        FXArray[idElement][2].start (40);       
     44    } 
     45     
     46    function resetFxArray (idElement, params){ 
    3547       if (! FXArray[idElement]){ 
    3648          FXArray[idElement] = new Array (); 
     
    4153       } 
    4254 
    43        FXArray[idElement][0] = new Fx.Style(document.getElementById (idElement),'opacity', fxStartParams);      
    44        FXArray[idElement][1] = new Fx.Style(document.getElementById (idElement),'width', fxStartParams);        
    45        FXArray[idElement][2] = new Fx.Style(document.getElementById (idElement),'height', fxStartParams);       
     55       FXArray[idElement][0] = new Fx.Style(document.getElementById (idElement),'opacity', params);     
     56       FXArray[idElement][1] = new Fx.Style(document.getElementById (idElement),'width', params);       
     57       FXArray[idElement][2] = new Fx.Style(document.getElementById (idElement),'height', params);      
     58    } 
    4659 
    47        FXArray[idElement][0].start (1); 
    48        FXArray[idElement][1].start (64); 
    49        FXArray[idElement][2].start (64);        
    50     } 
    51      
    52     function stopFxArray (idElement){ 
    53        if (! FXArray[idElement]){ 
    54           FXArray[idElement] = new Array (); 
    55        }else{ 
    56           FXArray[idElement][0].stop (); 
    57           FXArray[idElement][1].stop (); 
    58           FXArray[idElement][2].stop (); 
    59        } 
    60  
    61        FXArray[idElement][0] = new Fx.Style(document.getElementById (idElement),'opacity', fxStopParams); 
    62        FXArray[idElement][1] = new Fx.Style(document.getElementById (idElement),'width', fxStopParams);     
    63        FXArray[idElement][2] = new Fx.Style(document.getElementById (idElement),'height', fxStopParams);        
    64  
    65        FXArray[idElement][0].start (0.5); 
    66        FXArray[idElement][1].start (40); 
    67        FXArray[idElement][2].start (40);        
    68     } 
    6960{/literal} 
    7061{/copixhtmlheader}