Jump to content
Killersites Community
  • Announcements

    • administrator

      New Forum is Live!   10/18/2017

      Welcome to the rebirth of the KillerSites community! Much to come as we clean house and get the new sections in place. Stef  
piers

Dynamically scale div according to user window resize?

Recommended Posts

Ok...

 

I'm a total amateur trying to figure out how to resize a div to a set percentage of the users browser - regardless of how they resize it. And I want to do it dynamically (in that it resizes as the user resizes their browser).

 

So far then...

 

I'm using the setMovie function to embed a quicktime called when clicking on a thumbnail using onClick, as in:

 

onClick="setMovie('Quicktimes/mov1.mov')"

 

The code I'm using to embed is:

 


 

(Part of the preceding code I intend to wrangle into showing a title of what's playing, I hope)

 

It's based on the Prototype framework with the prototype script referenced at the bottom of the doc:

 



Share this post


Link to post
Share on other sites

Give the div a CSS flexible deffinition. Div {height:100%, width: 100%} or use width :auto; if it is to resize to the content.

 

Remeber the mobile market is growing and almost none of them support JS.

Share this post


Link to post
Share on other sites

Thanks, LSW... the problem is that the quicktime file either has a set height and width already, or is set to scale to it's container. Since the container div is not contained within a set dimension, the '100%' value doesn't mean much unless I can make it some %age of the users browser window height/width, right?

 

I have a code snippet:

 


 

But I can't get it to work.....

 

btw.. I'll probably get around to an iPhone redirect site at some point since it requires .m4v Quicktimes anyway.

Edited by piers

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×