View Full Version : Trying again.

09-09-2005, 05:45 PM
I am having an issue on getting a delay on the hiding of some layers. Currently I have a show layers on a button. When they roll over this button it shows 2 layers the main layer and a layer that has a hide layer command on it. The hide layer is becuase there are also dropdowns associated with the buttons on the main layer. refer to this page http://www.firstingraphix.com/sri/repairservice.asp for an example. What I am trying to do is to add a delay on the mouseover command on the hide layer so that it does not immediately hide the layers. Any help would be greatly appreciated as I am still a novice programmer.

09-09-2005, 07:15 PM
onmouseover="setTimeout('hideLayer()', 5000);"
hideLayer() is the code to execute (don't miss the quotes); 5000 is the milliseconds to wait.

09-10-2005, 03:06 PM
I put the code into the page and put the names in the () brackets in quotes. The layers appear but do not hide on the roll over of the hide layer (the purple layer that appears. How do I get the layers to disappear. Thank for your help in advance. http://www.firstingraphix.com/sri/repairservice.asp

09-10-2005, 03:36 PM
If there are any quotes inside the code you put as the argument, you must escape them (put \ before them).

09-10-2005, 03:59 PM
I appreciate the help, I am kind of new to programming so I am having a bit of a time following. Here is what I have put in the code.

onmouseover="setTimeout('hideLayer('repairhide','repairservicesover','endoscopylist','ultrasoundlist','instrumentlist')', 2000);"

What am I doing wrong? This is the mouseover for the purple layer that pops up.

09-10-2005, 08:30 PM
onmouseover="setTimeout('hideLayer(\'repairhide\',\'repairservicesover\',\'endoscopylist\',\'ultrasoundlist\',\'instrumentlist\')', 2000);"
Simple as that.

09-11-2005, 02:51 AM

Still not quite working properly. I am inserting the whole code for the layer. it is as follows:

<div id="repairhide" style="position:absolute; left:0; top:64px; width:800px; height: 279px; z-index: 10; visibility: hidden; background-color: #990099; layer-background-color: #990099; border: 1px none #000000;" onmouseover="setTimeout('hideLayer(\'repairhide\',\'repairservicesover\',\'endoscopylist\',\'ultrasoundlist\',\'instrumentlist\')', 2000);"><img src="mm_assets/style1/h/closer.gif" width="803" height="281"></div>

can you help me dicifer this a bit more. I appreciate the help. I donot know if it makes a difference but I am showing the layer with the show/hide layer in Dreamweaver.

09-11-2005, 08:43 AM
Well, it all ought to work as far as I can see. I don't know how Dreamweaver works, though. How does it fail? What is the error you get?

09-11-2005, 09:24 AM
The layers pop up but when I roll onto the layer that is programmed to hide them nothing happens. The page does not throw any errors, the layers just do not disappear.

if you want to see whatit is doing you can look at the page http://www.firstingraphix.com/sri/repairservice.asp

roll over the Repair Service button on the left, when rolled over it show the layer with the replacememnt button and the hide layer, which currently is purple just for ease of showing. if you roll off the layer with the buttong on to the purple layer, all of them should disappear.

09-11-2005, 09:30 AM
actually I take that back once i roll over it, it gives me an error. When I roll over

it says
Line: 1
Char: 1
Error: Object Expected
Code: 0
URL: http://www.firstingraphix.com/sri/repairservice.asp

09-13-2005, 06:49 PM
onmouseover="setTimeout('MM_showHideLayers(\'repairhide\',\'repairservicesover\',\'endoscopylist\',\'ultrasoundlist\',\'instrumentlist\')', 2000);"

09-13-2005, 10:13 PM
This is the error i am getting now.

Error Could not get the visibility property. Invalid Argument.
Code: 0

What do you think

09-14-2005, 03:12 AM
this is the original normal mouseOver:


it does not contain the hide command in the previous one, I think that is why it is throwing the visibility error. I Tried the following and it is looking for a ')'

onmouseover="setTimeout('MM_showHideLayers(\'repairhide\','',\'hide\',\'repairservicesover\','',\'hide\',\'endoscopylist\','',\'hide\',\'ultrasoundlist\','',\'hide\',\'instr umentlist\','',\'hide\'),2000)

09-14-2005, 10:55 AM
I was basing the above on the code you provided earlier (
onmouseover="setTimeout('hideLayer('repairhide', 'repairservicesover', 'endoscopylist', 'ultrasoundlist', 'instrumentlist')', 2000);").

onmouseover="setTimeout('MM_showHideLayers(\'repairhide\',\'\',\'hide\',\'repairservicesover\',\'\',\'hide\',\'endoscopylist\',\'\',\'hide\',\'ultrasoundlist\',\'\',\'hide\' ,\'instrumentlist\',\'\',\'hide\')',2000);"

09-14-2005, 01:01 PM
You are awsome that works perfectly. Thank you so much for your help. :)

09-14-2005, 01:25 PM
Any time.

09-15-2005, 12:33 AM
One last thing, do you know if there is a way to stop the hide if they roll back over the other layer that they just rolled off of?

09-20-2005, 03:31 AM
I am still trying to see if there is some way to stop this action if the user rerolls back over the hiding layer.

09-20-2005, 03:24 PM
Somewhere on the page, above the layer tags, add:
<script type="text/javascript">
var timeout;
Put "timeout=" in front of the above setTimeout() code (onmouseover="timeout=setTimeout('MM_showHideLayers(\'repairhide\',\'\',\'hide\',\'repairservicesover\',\'\',\'hide\',\'endoscopylist\',\'\',\'hide\',\'ultrasoundlist\',\'\', \'hide\' ,\'instrumentlist\',\'\',\'hide\')',2000);").
Then, on the "cancelling" layer tag, add:
This will cancel the timeout.

09-21-2005, 04:00 AM
that seems to have worked thanks again