简体   繁体   中英

Zoom into div on page load with javascript

Bit of a strange issue but I couldn't find anything about this on Google. I have a scene I'd like to zoom into when the page loads.

Imagine the below image is 100% window width on page load, then after a delay the window zooms in so the monitor in the scene is 100% of the browser window. and the iframe is what you now see.

Does this make sense?

I'm unsure of the best way to do this, I tried to use transform property with scale but I've had no luck and I'm unsure how this would render the iframe? would the contents also scale?

http://jsfiddle.net/LLmaP/1/

在此处输入图片说明

you should do something like this:

http://jsfiddle.net/LLmaP/18/

$('.monitor').load(function() {
   setTimeout(function() {
       $('.page').addClass('fullscreen');
}, 1000);
});

but you have to set your cubic-bezier to make the background-size and the iframe height agree. this website can help you

http://cubic-bezier.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM