Computing.Net > Forums > Web Development > random div dimensions

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

random div dimensions

Reply to Message Icon

Name: rrrrrrui
Date: March 26, 2006 at 07:29:21 Pacific
OS: win
CPU/Ram: 222
Product: 222
Comment:

maybe a strange question, but is it possible to a site to set diferent/random divs dimensions (not position) on load? .. this would be nice for a site im trying to do, give a little "mutante" style to the whole thing ... strange? possible? with a simple code?

thansk..




Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: March 26, 2006 at 13:08:22 Pacific
Reply:

Here's what I would do.

First, give the div an id. Something like this:

<div id="theDiv">Content</div>

You can then change the DIV's width using JavaScript like this:

document.getElementById('theDiv').style.width = "50px";

However, you must call the javascript AFTER the div has been created for it to work.

Michael J


0
Reply to Message Icon

Related Posts

See More


Internet posters creation streaming MP3 title and a...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: random div dimensions

Div tag www.computing.net/answers/webdevel/div-tag/365.html

Confict using two JavaScript tools www.computing.net/answers/webdevel/confict-using-two-javascript-tools/2036.html

Random spacing between DIVs in Firefox www.computing.net/answers/webdevel/random-spacing-between-divs-in-firefox/4179.html