473,385 Members | 2,004 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,385 software developers and data experts.

Div tag moving script onmouseover not working in netscape and firefox

Hello All

I built a simple script to move a div tag with a MouseOver event handler. This worked fine in Safari but would not work in Netscape and Firefox

Can anyone help?

You can see it working in Safari on
http://observationist.co.uk

So far this is what I have

Expand|Select|Wrap|Line Numbers
  1. function moving(id){
  2. if (document.getElementById("slider").style.left<10000)
  3. document.getElementById("slider").style.left-=5
  4. moveid = window.setTimeout(moving, 5000, true);
  5. }
  6.  
  7. function stop(){
  8. window.clearTimeout(moveid);
  9. }
  10.  
  11. function moving2(){
  12. if (document.getElementById("slider").style.left<10000)
  13. document.getElementById("slider").style.left+=5
  14. moveid2 = window.setTimeout(moving2, 50, true);
  15.  
  16. }
  17. function stop2(){
  18. window.clearTimeout(moveid2);
  19. }
Sep 7 '07 #1
3 2277
acoder
16,027 Expert Mod 8TB
Please remember to use code tags when posting code.

You need to specify the values as a measurement, e.g. "px".

PS. changed the thread title too.
Sep 7 '07 #2
Oh dear I seem to be getting even asking the question wrong !! Help with the answer would be appreciated if anyone actually knows about this stuff.

I have had a couple of suggestions but non which actually work. When giving a suggestion maybe it would be good practice to TEST the thing first before assuming you know the answer ???!!!

This would save lots of space on this site and mean that maybe you learn something too.

I have no idea what is wrong here but have tried a couple of peoples suggestons mostly with regard the the declaration of the px withing the code but this has no effect. The answer is more subtle or more obvious than that it would seem.
Sep 7 '07 #3
acoder
16,027 Expert Mod 8TB
I have had a couple of suggestions but non which actually work. When giving a suggestion maybe it would be good practice to TEST the thing first before assuming you know the answer ???!!!
It would also be good practice to have faith in some of the suggestions! Try adapting this:
Expand|Select|Wrap|Line Numbers
  1. function moving(){
  2.       var left =
  3. parseInt(document.getElementById("slider").style.left);
  4.       if (left <10000)
  5.       document.getElementById("slider").style.left=(left-5) + "px";
  6.       moveid = window.setTimeout("moving()", 1000);
  7. }
  8.  
Sep 7 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Allen | last post by:
I am trying to add an additional photo/hyperlink to the company web site (I didn't create it) without any luck. The mouseover feature 'highlights' pics by swapping them with another pic using this...
5
by: zaw | last post by:
Hi I am working on implementing this script to shopping cart. Basically, it copies fill the shipping address from billing automatically. I believe one or more syntax is not netscape compatible....
3
by: François de Dardel | last post by:
The URL is: http://mapage.noos.fr/dardelf3/tintin/ListeAutos.html The JS is in the header This page behaves as follows: Safari (Mac) OK MSIE (Mac) OK MSIE 5.0 (PC) OK (on Virtual PC on the...
2
by: benfbox-google | last post by:
Hi, there. The following javascript is working perfectly with IE, but does not work with Firefox (no error, but displays nothing). Can somebody help ? Thanks in advance, Ben. The script :
1
by: Jordan | last post by:
I set the cursor property to change to the "hand" when the user performs an "onmouseover" event on a hyperlink object. This does work correctly with Internet Explorer, however, with Netscape and...
6
by: Eric Layman | last post by:
Is there a way to detect a held-down button while the mouse is moving? Thanks. Posted Via Usenet.com Premium Usenet Newsgroup Services
1
by: Ciuin | last post by:
Again I need your help. This is the test page I am working on: http://www.manfredkooistra.de/zeugs/test/test.php Description: The page shows a centered image and a navigation menue...
10
by: cjparis | last post by:
Hello everyone. If anyone can give me a hand I would be gratefull Am doing a site which requires a moving element and have used DHTML to do it. Have a simple Browser detect script to sort IE...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.