473,668 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Div tag moving script onmouseover not working in netscape and firefox

8 New Member
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 2296
acoder
16,027 Recognized Expert Moderator MVP
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
cjparis
8 New Member
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 Recognized Expert Moderator MVP
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
4809
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 command in some type of array. I added the mailbox in the lower left corner (see link below)http://www.aamechanical.com/indextemp.htm but I cannot get it to swap. Here is the code for the page: Thanks for your help in advance
5
1655
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. Can anyone point out which one it is and how to make it both netscape and MS browser compatible? I hope if I can make the script compatible for those two at extreme, it will probably work with most browser out there. As you would notice, this form...
3
2564
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 Mac) MSIE 5.1 (PC) No on my office PC (chgImg works, but MoveDIV doesn't) FireFox (Mac) No (chgImg works, but MoveDIV doesn't)
2
1780
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
2589
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 Firefox, the cursor is just the "vertical line." Does anyone know why this isn't working with Netscape or Firefox? Thanks!
6
3548
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
5202
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 position:fixed over it (position:absolute in IE 5 and 6). The menue consists of two parts: an image and a header, both external links, in the upper div;
10
6767
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 from Netscape. IE is ok but the Netscape browser including Firefox and Safari are not working now. Not sure why. The idea is that when you mouseover the arrows the gallery div moves to left and right. I have changed the script and now the image...
0
8462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8382
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8802
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.