open shadowbox on mouseover instead of click?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

open shadowbox on mouseover instead of click?

adjosh
Hello!

Is it possible to make the shadowbox open up when the user hovers the mouse over the link rather than clicking on it?

I want to pull an inline div element into the shadowbox when the user hovers over a certain word in the text, so I tried adding a "onMouseOver" Behavior (in Dreamweaver CS5) to go to a URL, the URL being the #div-element, but no joy.

Any ideas?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: open shadowbox on mouseover instead of click?

HenzeBerkheij
that's possible using the javascript method..but you can start with onmouseover="Shadowbox.open(Shadowbox.gallery);"

this will open the first element in your gallery. which is no problem if you have just one element. if you have more elements you can create a function like this:

function openOnMouseover(id){
    Shadowbox.open(Shadowbox.gallery);
    Shadowbox.change(id);
}

your onhover: onmouseover="openOnMouseover(1);"
Reply | Threaded
Open this post in threaded view
|

Re: open shadowbox on mouseover instead of click?

adjosh
Thank you very much for your solution!

For some reason I cannot yet figure out, the first element I hover on is what opens up when I hover on any subsequent link on the page. (I tried the function solution.) Any ideas?

For e.g. suppose I have 5 links and click on #3 first when the page loads for the first time. If I then hover on #1, it is element #3 that loads in the shadow box, if I hover on #4 it is #3 that loads, etc.

Huh?

Here's a sample page of what I am trying to accomplish:
http://www.sarah-ashley.com/iPoetry/poem1.html

Thanks again!
Reply | Threaded
Open this post in threaded view
|

Re: open shadowbox on mouseover instead of click?

HenzeBerkheij
I think something goes wrong because you don't have a gallery...try putting them in a gallery (you can disable controls etc)...
Reply | Threaded
Open this post in threaded view
|

Re: open shadowbox on mouseover instead of click?

adjosh
Ah, thanks! That fixed it!
I appreciate your direction.

Best regards!