SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Enlargin Div
-
Aug 1, 2007, 12:03 #1
- Join Date
- Jun 2007
- Posts
- 254
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Enlargin Div
Hi Folks,
Using JavaScript, how do I enlarge a div in Height upon an image being clicked?
-
Aug 1, 2007, 12:27 #2
- Join Date
- Jul 2007
- Location
- Virginia
- Posts
- 87
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Code:<html> <head> <title>test</title> <script language="javascript" type="text/javascript"> function set_new_height() { var newHeight = 500 + 'px'; document.getElementById('content').style.height = newHeight; } </script> </head> <body> <a href="#" onClick="set_new_height()"> click me to enlarge div </a> <div id="content" style="border:1px solid black;background:blue;padding:20px;color:white;padding:20px;"> this<br> is<br> dynamic<br> lol </div> </div> </body> </html>
-
Aug 1, 2007, 12:39 #3
- Join Date
- Jun 2007
- Posts
- 254
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Enlarging Div
markusmad,
Is it possible to scroll the div larger, so it enlarges gradually?
Also, is it possible to scroll the div smaller, upon clicking a different link?
Bookmarks