|
Posted by Johnny Two Dogs on June 22, 2005, 4:37 pm
Please log in for more thread options
I'm strictly concerned with IE, so cross-browser compatibilty isn't
necessary.
If you view the code below, I almost get exactly what I'm
looking for:
- A table of four cells that expands/contracts to the width of the
browser window. When it contracts, the cell never gets smaller (in
width)
than the largest DIV item.
- When the DIV elements dynamically change, the table cells remain
the same in
width (and as a result, the left positioning of the text
doesn't change on
each dynamic DIV change).
But, here's my problem:
- The first DIV element appears on top, and the second appears below
when
made visible (I'd like the top and left positioning of the
dynamic elements to
appear in the same spot, based on where that is
per the table cell/browser
window size.
- If I use absolute positioning, the table cell is still drawn larger
(in
height) because it assumes the second line of the hidden DIV.
Although I've asked for a "DIV without line breaks" solution, now that
I think
of it, that last bullet-point might still pose a problem.
Can anyone please help? I'd prefer to solve this through straight
HTML/CSS
rather than some gimmicky JavaScript solution whereby I detect
the top-left
attributes of items, then move the second DIV to that
location.
I apologize if I've done a poor job of explaining what I'm trying to
accomplish.
Thanks in advance for any help you can offer me.
----------------------------------------------------------
<html>
<head>
<title>Header Work</title>
<script language="JavaScript">
var incArray = new Array (0,0,0,0);
function sfs (num) {
var a = document.getElementById(num+"a");
var b = document.getElementById(num+"b");
if (incArray[num]%2==1) {
a.style.visibility = "hidden";
b.style.visibility = "visible";
} else {
b.style.visibility = "hidden";
a.style.visibility = "visible";
}
++incArray[num];
}
</script>
</head>
<body>
<table border=1 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td nowrap>
<div id="0a"
style="visibility:hidden;">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
<div id="0b" style="visibility:visible;">aaaaaaaa</div>
</td>
<td nowrap>
<div id="1a" style="visibility:hidden;">cccccccc</div>
<div id="1b" style="visibility:visible;">aaaa</div>
</td>
<td nowrap>
<div id="2a" style="visibility:hidden;">##########</div>
<div id="2b" style="visibility:visible;">2</div>
</td>
<td nowrap>
<div id="3a" style="visibility:hidden;">cdcd</div>
<div id="3b"
style="visibility:visible;">aaaaaaaaawwwwwwwwwwwwwwaaaa</div>
</td>
</tr>
</table>
<a href="javascript:sfs(0);">Switch 1st space</a><BR>
<a href="javascript:sfs(1);">Switch 2nd space</a><BR>
<a href="javascript:sfs(2);">Switch 3rd space</a><BR>
<a href="javascript:sfs(3);">Switch 4th space</a>
</body>
</html>
--
Johnny Two Dogs
------------------------------------------------------------------------
Johnny
Two Dogs's Profile: http://www.highdots.com/forums/member.php?userid=316 View
this thread: http://www.highdots.com/forums/showthread.php?t=1543511
|
|
Posted by Leif K-Brooks on June 22, 2005, 9:50 pm
Please log in for more thread options
Johnny Two Dogs wrote:
> I'm strictly concerned with IE
Then perhaps you shouldn't be asking in a WWW authoring group.
|
|
Posted by Johnny Two Dogs on June 23, 2005, 3:07 am
Please log in for more thread options
I'm confused. Did I post to the wrong forum, or did you not like that
my
primary concern is a working solution for Internet Explorer? If
it's the
latter, please pretend that 1st sentence of mine never
existed. If it's the
former, would someone please direct me to the
proper forum? Either way, a
useful response would be fantastic.
--
Johnny Two Dogs
------------------------------------------------------------------------
Johnny
Two Dogs's Profile: http://www.highdots.com/forums/member.php?userid=316 View
this thread: http://www.highdots.com/forums/showthread.php?t=1543511
|
|
Posted by Mark Parnell on June 23, 2005, 6:27 pm
Please log in for more thread options
Previously in comp.infosystems.www.authoring.html, Johnny Two Dogs
> I'm confused. Did I post to the wrong forum, or did you not like that
> my primary concern is a working solution for Internet Explorer?
Yes to the first, because of the second. This is a group for discussing
HTML authoring for the WWW. If you are only interested in a sub-section
of that (e.g. only one browser), then your question really isn't
appropriate for the group.
--
Mark Parnell
http://www.clarkecomputers.com.au
|
|
Posted by Johnny Two Dogs on June 23, 2005, 9:40 am
Please log in for more thread options
I just figured I'd spare people the difficulty of coming-up with a
cross-browser solution. Never mind. If there exists a solution that
works for
all browsers, then that would obviously suit my needs even
better. Sheesh!
Again, if anyone knows a way to make it work (even if going about it a
different
way than what I've coded thus far), your help would be
greatly appreciated. I'm
not too keen on scripting the dynamic redraw,
since the finished product will
contain form fields, and re-setting them
each time would require extra hassle.
--
Johnny Two Dogs
------------------------------------------------------------------------
Johnny
Two Dogs's Profile: http://www.highdots.com/forums/member.php?userid=316 View
this thread: http://www.highdots.com/forums/showthread.php?t=1543511
|
| Similar Threads | Posted | | IE7 Display:BLock and line breaks | March 27, 2008, 2:41 pm |
| preserve line breaks in applet parameters | January 27, 2007, 10:10 pm |
| Thai text rendering issue in browser (line breaks) | March 10, 2005, 5:38 pm |
and and breaks | December 19, 2006, 3:09 pm |
| about menu using ul & li, with breaks and right aligned | June 13, 2006, 10:01 pm |
| "get flash" url breaks xhtml validation | October 24, 2007, 7:01 pm |
| XHTML DOCTYPE breaks JavaScript x.style.top and x.style.left? | July 5, 2005, 12:58 pm |
| How to keep this on one line? | May 9, 2007, 4:39 pm |
| Button on the same line. | July 20, 2005, 12:48 pm |
| Line dividers | December 29, 2005, 11:31 am |
|