Jump to content

[SOLVED] onmouseover


asmith

Recommended Posts

guys i am more than a noob in JAVA . till now i prevented coding with JAVA , but now i've faced something i must do with JAVA.

 

i want to show some links for example 3 links  when the mouse cursor goes on a picture. 

 

again  i want to know how can i open a square (not a new window, oh yea , like php freaks when your mouse goes on a function name)

 

and in that square i show the links or show a little html code and the user be able to click on those links  .

 

 

any simple code i could apply ?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/85822-solved-onmouseover/
Share on other sites

this is javascript; not java - there two different languages.

 

<script language="javascript">

function showLinks()
{
document.getElementById('myLinks').style.display='block';
}

function hideLinks()
{
document.getElementById('myLinks').style.display='none'
}

</script>

<img src="" onmouseover="showLinks()" onmouseout="hideLinks()">

<div id="myLinks" style="display:none" onmouseover="showLinks()" onmouseout="hideLinks()">

<a href="http://www.google.com">Google</a>
<a href="http://www.yahoo.com">Yahoo</a>
<a href="http://www.msn.com">MSN</a>

</div>

Link to comment
https://forums.phpfreaks.com/topic/85822-solved-onmouseover/#findComment-438353
Share on other sites

thanks i understood it whole !

but some prolblems i've got with it . it is hard with it to move the mouse cursor to the new links . i have to click a few times on the image to make the links be fix on the screen , so i could navigate to them nd click on them .

 

1. how can i make it when the mouse go on the image , when the links appear i could easy goto the links ?

 

2. when te div part is displayed it mess up other elements in the page. you know what i mean  ? when the div is shown , it will be placed between other sites elements. i just want it shows up div "over" the html page. not "in" the html page . like phpfreaks on functions .

 

thanks a bunch

Link to comment
https://forums.phpfreaks.com/topic/85822-solved-onmouseover/#findComment-438611
Share on other sites

this should solve your first point..

 

<script language="javascript">

function showLinks()
{
document.getElementById('myLinks').style.display='block';
}

function hideLinks()
{
document.getElementById('myLinks').style.display='none'
}

</script>

<div id="myLinks1" onmouseover="showLinks()">
<img src="" onmouseover="showLinks()" onmouseout="hideLinks()">
<div id="myLinks" style="display:none" onmouseover="showLinks()" onmouseout="hideLinks()">



<a href="http://www.google.com">Google</a>
<a href="http://www.yahoo.com">Yahoo</a>
<a href="http://www.msn.com">MSN</a>

</div>
</div>

Link to comment
https://forums.phpfreaks.com/topic/85822-solved-onmouseover/#findComment-438613
Share on other sites

 

1.) If you move your mouse vertically down from the image, to the div that has that contains the links; then you shouldn't have any problems - this is how a vertical menu works.

 

2.) You need to set the css style for the div; with a position of "absolute" and a z-index higher then all the other elements in your page (I usually set mine to 1000).

Link to comment
https://forums.phpfreaks.com/topic/85822-solved-onmouseover/#findComment-438640
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.