Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 15th, 2006, 7:19 PM   #1
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3 Jimbo is on a distinguished road
Render a div smaller than it's contents?

I have a page where I'm trying to allow the user to draw a box, creating a dynamically sized div. The interface consists of clicking at the coordinates for one corner, then for the opposite corner. This allows for a box with an height and/or width of 0, which is fine with me. My problem is that the box has some text in it (instructions, really), and IE (6) refuses to let the div be smaller than the space needed to enclose the instructions. Opera (9) will render it with a width down to 0, but doesnt let the height go smaller than the instructions (two lines in this case). Firefox works great.

I'm doing the resizing with JavaScript, but it's mostly manipulating the CSS. Is there a way around this problem, or do I need to keep the text out of the div?

If code would help, I can post it, but I didn't want to hunt down everything (from the .js and the Smarty template) if I don't have to :p
Jimbo is offline   Reply With Quote
Old Aug 15th, 2006, 7:43 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Why don't you put your instructions in a just-right div anchored at the same upper-left point, but with a different z-index.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Aug 16th, 2006, 2:19 AM   #3
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Maybe specifying an overflow will keep IE happy?
Arevos is offline   Reply With Quote
Old Aug 16th, 2006, 3:09 AM   #4
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3 Jimbo is on a distinguished road
I tried setting overflow and that didn't do it. I'm going to change all the JavaScript to work with two divs like DaWei suggested in the morning, and that should work out.
Jimbo is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
viewing contents of array RemoteC2 C++ 6 Aug 13th, 2006 9:46 PM
Using sys/stat.h and listing directory contents in C... smoothdogg00 C 3 Mar 13th, 2006 11:30 PM
Displaying contents of an array Wizard1988 Assembly 3 Oct 12th, 2005 9:15 PM
Capturing the contents of a print request from another program faLLeN Visual Basic 1 Mar 8th, 2005 1:25 AM
opening and modifying contents of war file jayanthony Bash / Shell Scripting 1 Feb 27th, 2005 4:36 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:23 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC