onmouseover()

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
rash28
Forum Commoner
Posts: 38
Joined: Wed Aug 01, 2007 1:21 am

onmouseover()

Post by rash28 »

How to hide the orange tooltip. It should be displayed only when mouse over the text in li

Code: Select all

 <style type="text/css">
.roundcont {
        width: 250px;
        background-color: #f90;
        color: #fff;
}
.roundcont p {
        margin: 0 10px;
}
.roundtop {
        background: url(tr.gif) no-repeat top right;
}
.roundbottom {
        background: url(br.gif) no-repeat top right;
}
img.corner {
   width: 15px;
   height: 15px;
   border: none;
   display: block !important;
}

</style>

Code: Select all

<script>
function showdiv(){
var tip;
tip = document.getElementById("one");
tip.style.display ="block";
}

function hidediv(){
var tip;
tip = document.getElementById("one");
tip.style.display ="none";
}

</script>



Code: Select all

<div id="one">
<li onMouseOver="javascript:showdiv(); onMouseOut="hidediv();>--Somename
<div class="roundcont">
   <div class="roundtop">
         <img src="tl.gif" width="15" height="15" class="corner"  style="display: none" />
   </div>

<p> On mouse over</p>
      <div class="roundbottom">
         <img src="bl.gif" width="15" height="15" class="corner" style="display: none" />
      </div>
   </div>
 </li>
</div>
</div>
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Firstly, your question is uninformative, and is basically asking us to decipher what you're doing and write your code for you. That's a no-no. Be more descriptive.

What on earth is that even doing? What is div#one?
RhapX
Forum Commoner
Posts: 30
Joined: Mon Dec 05, 2005 5:24 pm
Location: Seattle, Washington

Post by RhapX »

superdezign wrote:Firstly, your question is uninformative, and is basically asking us to decipher what you're doing and write your code for you. That's a no-no. Be more descriptive.

What on earth is that even doing? What is div#one?
Completely agree. If you were more informative, maybe we could help. Also, learn how to use proper tags. You're using an LI when there isn't even a UL.

One more thing, less <div>'s
miro_igov
Forum Contributor
Posts: 485
Joined: Fri Mar 31, 2006 5:06 am
Location: Bulgaria

Post by miro_igov »

<li onMouseOver="javascript:showdiv(); onMouseOut="hidediv();>

Must be:

<li onMouseOver="showdiv();" onMouseOut="hidediv();">
Post Reply