473,395 Members | 1,823 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,395 software developers and data experts.

Compatibility problems with offsetParent and offsetWidth

Hi,

I have reimplemented the non-standard <marquee> element (in a very
simplified fashion), moving around a DIV using offsetParent and
offsetWidth.
It works fine in Mozilla (1.7.5) and Safari (1.2.4), but fails
miserably in IE6/Win : the content scrolls off screen to the right hand
side, although it should be going to the left.

I've put up a simplified test case here :
http://ned.idsland.com/2005/marquee.html

Any suggestions ?

Thanks.

Jul 23 '05 #1
1 2021
Ned Baldessin wrote:
Hi,

I have reimplemented the non-standard <marquee> element (in a very
simplified fashion), moving around a DIV using offsetParent and
offsetWidth.
It works fine in Mozilla (1.7.5) and Safari (1.2.4), but fails miserably
in IE6/Win : the content scrolls off screen to the right hand side,
although it should be going to the left.

I've put up a simplified test case here :
http://ned.idsland.com/2005/marquee.html

Any suggestions ?

Thanks.


Add "position: relative;" to the marquee class.

You can ditch the 'parseInt' stuff too:

s.style.left = (posS-posM-2) + 'px';

You could use:

s.style.left = posS-posM-2 + 'px';

but I think that's less readable. Subtraction forces the
variables to be numbers, parseInt has certain characteristics
best avoided altogether if not needed.
--
Rob
Jul 23 '05 #2

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

Similar topics

1
by: Vittore Zen | last post by:
Hi, a little question. I have some nested tables with some divs (so default set is relative - ok?) Now, i need to draw a line from one div to another. The problem is to find the position of...
1
by: parksch2 | last post by:
I know there are a lot of articles out there about this subject but I have been reading for 3 hours and still can't find the answer. I have some text in a bunch of hidden spans. I need to find the...
2
by: Bundy | last post by:
Hi I am trying to learn Javascript by creating small projects. I am trying to create a drop down menu but I am having problems hiding the <div> when the mouse is no longer on the <div>. Your...
2
by: amattie | last post by:
Anyone know what the specific difference is between the offsetParent and parentNode properties of a DOM element are? Mozilla's docs on the DOM element...
2
by: David McDivitt | last post by:
resending with better URL At the URL http://www.spfldcycling.org/miles/06_12_detail.htm , I'm having difficulty resizing a DIV object when the window resizes. I want to get the left and top...
2
by: spinow | last post by:
Hi there, My current project has a div with a table inside it. In this table I have a cell. In this cell images are loaded using a javascript function and the images are resized to fit the cell with...
1
by: inteli | last post by:
Hey anybody can help me out wid this code..Its working well in IE but nt in firefox.The problem lies in offset,clientX,clientY part but I dnt know how to resolve it .. var zxcDockAry=new Array();...
2
by: T0mm0 | last post by:
I'm trying to set the offsetParent property of an object to a reference to document rather than the relatively positioned container that it's in. The reason for this is that the object is a...
1
by: ehud37new | last post by:
this script work fine in IE but not in FireFox where is the problem? here is the script /*------------------------------------------------------------------ File: menu.js ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...

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.