Scrolling script and mouseover image script problems. - Please help! (Posted by SabrinaP)
Hello,
At http://www.bratta.com, at the dhtml section, under scripts, I want to create the same effect of when the mouse goes over the arrow, that the webpage scrolls down. I know how to create the scrolling down page effect. I got the main coding for that under the scripts area. I want the mouseover effect, because the image changes apon mouseover. I attempted to do this with the javascript coding. But I had a problem while doing this and i can't figure out how to fix it.
This is the html part of my web page of the button images that when the mouse cursor goes over it, it will scroll down the web page.
Here, in red, is the scrolling part, it works fine on the webpage. The mouseover image effect didn't load up at all (i placed the required javascript coding in the <head> tag too):
<a href="#" [red]onmouseover="loop=true; oScroll.up(2)" onmouseout="noScroll()" [/red]onMouseover="lightup('pic1')" onMouseout="turnoff('pic1')"><img src="layout/scrollup.gif" name="pic1" border=0 alt="scroll up" width=20 height=30></a>
Now here, when I place the mouseover image effect before the scrolling code, the mouseover effect loads up fine in my webpage, but the scrolling doesn't work at all!:
<a href="#" onMouseover="lightup('pic1')" onMouseout="turnoff('pic1')" [red]onmouseover="loop=true; oScroll.up(2)" onmouseout="noScroll()"[/red]><img src="layout/scrollup.gif" name="pic1" border=0 alt="scroll up" width=20 height=30></a>
What I realized is that which ever coding comes first, is the only one that works well. I want to fix this so both codings work.
Please help!
Thank you, Sabrina
P.S. This problem is not located on my webpage, it's all being done on my hard drive.
----------
[red]Digital-Fx[/red] = http://fxdigital.cjb.net
Your daily digital source for your Photoshop and Paint Shop Pro needs.
Jim Shilt posted this at 03:10 — 26th October 1999.
They have: 268 posts
Joined: May 1999
You need to put both onmouseover events together separated by semicolons. Also if you are not linking anywhere I like to use the A HREF="javascript://" this allows you to get a link without any javascript errors. Try the following code
<a href="javascript://" onmouseover="loop=true; oScroll.up(2); lightup('pic1')"
onmouseout="noScroll(); turnoff('pic1')"
Try this and let me know if it works.
----------
My goal in life is found in Phillipians 4:8-9
My goal in life is found in Phillipians 4:8-9
shoutingrock.org/troop214
Anonymous posted this at 03:10 — 26th October 1999.
They have: 5,633 posts
Joined: Jan 1970
I think that your scripts may be fine but the problem is within the <A HREF> tag. I am not absolutely sure about this but I don't think you can have two onMouseOver event handlers within the same tag. The same will apply for the onMouseOut. You can call your rollover code from the same event handler as the scrolling code. Please see below.
<a href="#"
onmouseover="loop=true;oScroll.up(2);lightup('pic1')" onmouseout="noScroll();turnoff('pic1')"><img src="layout/scrollup.gif" name="pic1" border=0 alt="scroll up" width=20 height=30></a>
If this doesn't solve your problem, then you should post both the scripts and the HTML code you are using so we can take a better look at it.
----------
[email protected]
http://go.to/hass
Anonymous posted this at 03:11 — 26th October 1999.
They have: 5,633 posts
Joined: Jan 1970
<Jim Shilt> You beat me by a few seconds!!!
SabrinaP posted this at 03:40 — 26th October 1999.
They have: 318 posts
Joined: Mar 1999
Phew! Thanks a lot for your help, both your help, the mouseovers and scrolling works great. This will be for my new site that'll be devoted to Photoshop 5.5. It'll be posted in the Website Critique Area soon.
Thanks again! Sabrina
----------
[red]Digital-Fx[/red] = http://fxdigital.cjb.net
Your daily digital source for your Photoshop and Paint Shop Pro needs.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.