I have an HTML page. There is a base64 encoded image in it. I am planning on writing a javascript to increase the size of the image and content on the page. So everything on the page will appear bigger. I am able to increase the font size but not sure about the embedded ima开发者_如何学JAVAge.
If you have
<img id="myImage" src="" />
Then you can do it like this:
$('#myImage').attr({
width: 150, // new width
height: 150 // new height
});
Well, you can just adjust the css for that image or the attributes. Use either height or width, just not both so they scale properly.
Jquery:
$("img").css("width","150px");
I may be confused but don't all modern browsers support Ctrl + scroll to zoom?
With images referenced by URL, you can change height and width (either the HTML attributes or CSS styles) and the browser will resize the image. I imagine it will work the same with an embedded image.
This functionality is available in most modern browsers, and as such it is unnecessary to duplicate it using client-side scripts. Consider simply informing the user that most browsers have text size controls built in (so that they may use this tool on other sites as well).
精彩评论