📜  script.aculo.us 比例效应

📅  最后修改于: 2022-05-13 01:57:05.869000             🧑  作者: Mango

script.aculo.us 比例效应

此效果用于在垂直或水平方向上逐渐向上或向下缩放元素。它更改元素的宽度和高度尺寸以及 em 单位的基础。

句法:

new Effect.Scale('element_id', percent, [options]);
or
new Effect.Scale(element, percent, [options]);

效果选项

OptionDescription
scaleXSets whether the element should be scaled horizontally, by default its true.
scaleYSets whether the element should be scaled vertically, by default its true.
scaleContentSets whether content scaling should be enabled, by default its true.
scaleFromCenterIf true, scale the element in a way that the center of the element stays on the same position on the screen, by default its false.
scaleModeEither ‘box’ (default, scales the visible area of the element) or ‘contents’ (scales the complete element, that is parts normally only visible byscrolling are taken into account). You can also control the size of the element by assigning the originalHeight and originalWidth variables to scaleMode. Example: scaleMode: { originalHeight: 900, originalWidth: 900 }
scaleFromSets the starting percentage for scaling, by default its 100.00.

例子:



  

    script.aculo.us examples
  
    
  
    
  
    

  

    
        

Click me to Scale

    
  

输出: