473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

DHTML InnerHTML problem

http://insideout.fcsjobshop.co.uk/cart/search.asp

If you follow this link, click 'Search jobs...', you'll see there are
'more info...' buttons against each job, this changes the 'InnerHTML'
of the display text to a longer version of the same. for some reason
the expanding of the text makes the whole page go screwy.

It doesn't happen on the first 'more info...' button so maybe theres
something about that, that causes it, dunno. absolutely stumped.

Cheers.

AsciiSmoke

Jul 24 '05 #1
2 3484
Well, I've simplified the issue right down now.

If you paste this into a fresh HTML file you'll be able to reproduce it
and I'm sure you'll be as shocked as I was at the fix:
<DIV style="OVERFLOW: auto; HEIGHT:80px">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top">
<script>function ExpandBoxJ000800(){MiniDescJ000800.innerHTML =
LongDescJ000800.innerHTML;}</script>
<a href="javascript://" onClick="ExpandBoxJ000800();">CLICK</div>
<div id="MiniDescJ000800">123<br>456<br>789</div>
<div id="LongDescJ000800" style="position:absolute;
top:-1000000px;
visibility:hidden">123<br>456<br>789<br>ABC<br>DEF <br>GHI123<br>456<br>789</div>
</td>
</tr>
</table>
</DIV>
When you run this you'll notice that the text shifts downwards when you
click the 'CLICK' link. If you change the 'align="center"' code on the
second line to 'align="left"' the problem dissapears!.

It seems that when IE has to re-align the page when dynamically adding
a scrollbar it get's it wrong in this case.
This can also be proved by removing the <div> tag that surrounds the
table (thus removing the dynamically added scroll bar)

So, in the end I've found a way around my issue, but there still seems
to be a bug in IE.

AsciiSmoke

Jul 24 '05 #2
As********@gmail.com wrote:
http://insideout.fcsjobshop.co.uk/cart/search.asp

If you follow this link, click 'Search jobs...', you'll see there are
'more info...' buttons against each job, this changes the 'InnerHTML'
of the display text to a longer version of the same. for some reason
the expanding of the text makes the whole page go screwy.

It doesn't happen on the first 'more info...' button so maybe theres
something about that, that causes it, dunno. absolutely stumped.

Cheers.

AsciiSmoke


Firefox reports use of "MainMenu" in global scope rather than as an
ID (this is an IE-ism). The comp.lang.javascript FAQ suggests a fix:

<URL:http://jibbering.com/faq/#FAQ4_15>

There also seems to be no point in using innerHTML to change the
description. Why change the display property of the div containing
the extended description to 'none' onload. Then when the user clicks
'More information...' change it to ''.

That way users can show/hide whatever, you don't need an explicit
function to hide and show each individual extended description and
non-JavaScript users can see the descriptions too.

--
Rob
Jul 24 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris | last post by:
Can anyone help me on this one? I have a giant (couple thousand rows) HTML table. Im trying to modify some of the cells innerHTML and/or innerText, but it is taking a VERY long time to do so....
2
by: RWD | last post by:
I am trying to figure out how to change the target frame in my hyperlink on a DHTML menu. The menu is in one frame and the target frame is called "main" The code is below: Thanks in advance...
3
by: Chris Ryan | last post by:
Is there a way to change the displayed text on a web page using some combination of Javascript and DHTML? NOT in a text box. As far as I know (with my limited knowledge) the only way you can do...
6
by: Jon Davis | last post by:
I recently learned how to do an <OBJECT> alternative to <IFRAME> in current browsers using: <object id="extendedhtml" type="text/html" data="otherpage.html" width="250" height="400"></object> ...
5
by: gimme_this_gimme_that | last post by:
I'd like to create my own version of google suggest GS. If you haven't seen GS check it out at : http://www.google.com/webhp?complete=1&hl=en I've reviewed several AJAX write-ups on the...
3
by: Mahmoud | last post by:
When I wrote the following code to create a dynamic table with styles associated with each row, it worked in Firefox. But when this was tried in IE, the result was a table with no styles that were...
2
by: kae | last post by:
Hi there, this may not be an advanced problem but to me it is i got a great looking slide show script from this site (http://www.dhteumeuleu.com) but am having a lot of trouble adapting it to my...
0
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along...
12
by: Rahaman sharif | last post by:
Hi All, I have some problem in innerHtml. I have the textbox in innerHtml, In the innerHtml textbox was read only. I want make it to enable. if user enter the text that text will be retrieved, so...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.