Use JavaScript to Scale an Image According to Window Size Sometimes you need to resize an image according to the window's size. You can do this by setting the image width and height as 100 percent inside the <img> tag. IE then resizes the image according to the window's size.
You can also do this with JavaScript, using document.body.clientWidth
and document.body.clientHeight
. These return the active window width and height. On_Load sets the image width and height. When the window is resized, width.history.go(0) refreshes the page.
- Demo
- Enlarge
- Reload
- New window
Free iPage Web Hosting for First Year NOW
If you're still looking for a reliable web host provider with affordable rates, why you don't take a little of time to try iPage, only with $1.89/month, included $500+ Free Extra Credits for the payment of 24 months ($45)?
Over 1,000,000+ existisng customers can not be wrong, definitely you're not, too! More important, when you register the web hosting at iPage through our link, we're going to be happy for resending a full refund to you. That's awesome! You should try iPage web hosting for FREE now! And contact us for anything you need to know about iPage.
- Sent (0)
- New
iPhoneKer.com
Save up to 630$ when buy new iPhone 15
GateIO.gomymobi.com
Free Airdrops to Claim, Share Up to $150,000 per Project
https://tooly.win
Open tool hub for free to use by any one for every one with hundreds of tools
chatGPTaz.com, chatGPT4.win, chatGPT2.fun, re-chatGPT.com
Talk to ChatGPT by your mother language
Dall-E-OpenAI.com
Generate creative images automatically with AI
AIVideo-App.com
Render creative video automatically with AI
Save up to 630$ when buy new iPhone 15
GateIO.gomymobi.com
Free Airdrops to Claim, Share Up to $150,000 per Project
https://tooly.win
Open tool hub for free to use by any one for every one with hundreds of tools
chatGPTaz.com, chatGPT4.win, chatGPT2.fun, re-chatGPT.com
Talk to ChatGPT by your mother language
Dall-E-OpenAI.com
Generate creative images automatically with AI
AIVideo-App.com
Render creative video automatically with AI
Cool Domains for Sale!
javascriptbank.com javascripton.com gomy.mobi gomymobi.com
choose.works
war.money
ApexBTC.com
index.services
pornID.net
ZWVQ.com
ChatTotal.com
Card.rip
this.bid
XMQV.com
eChainBank.com
system.money
YeuNu.com
ChainTutor.com
CTRCoin.com
ABP3.com
choose.exchange
CoinHolo.com
CreditCard.rip
CryptoKD.com