1. Drag the mouse to change the size. <script language = "JavaScript">
Function resizeImage (evt, obj ){
NewX = evt. x
NewY = evt. y
Obj. width = newX
Obj. height = newY
}
</Script>
2. Scroll the mouse to control the image size
3. Use the code in the image label to control the size screen. width-500) this. style. width = screen. width-500; "> you need to modify the size after testing. Otherwise, the original size is displayed when the page is refreshed. screen. width-500) this. resized = true; this. style. width = screen. width-500; ">
4. CSS controls the image size
1. css2 direct implementation: img {max-width: 500px;} (not supported by IE currently)
2. expression implementation: img {width: expression (width> 500? "500px": width);} (IE only)
3. Use js. Method: Use document. getElementsByTagName ("IMG") to retrieve all img elements, traverse img elements, determine their width, and perform corresponding operations.