Resize an SWF when loading it with SWFObject

后端 未结 4 1980
名媛妹妹
名媛妹妹 2020-12-09 06:56

I\'m loading an SWF movie into an HTML page using SWFObject. I want to resize this SWF dynamically. How can SWFObject help? I\'m sure I don\'t have to write my own solution.

4条回答
  •  不思量自难忘°
    2020-12-09 07:21

    The easiest solution is to embed the SWF within a container div, then use JavaScript and CSS to dynamically resize the container DIV. If the SWF is set to 100% width/height, it will stretch to fit the wrapper whenever the wrapper is resized.

    In the body:

    This div will be replaced by an object via SWFObject

    In the head:

    
    
    
    

    Now whenever you resize #wrapper, the SWF will scale to fill it.

提交回复
热议问题