javascript - Qhen mousing over a link I want the div that contains the link and other content to increase in height then back down to 19px on mouse out -



javascript - Qhen mousing over a link I want the div that contains the link and other content to increase in height then back down to 19px on mouse out -

i'm customizing forum software

each page has 20 threads each thread contained within div class="threadpreview" inside of each "threadpreview" divs links total thread, , 500 character preview of thread right beneath link when page loads up, have divs' height set 19px , overflow:hidden preview of thread hidden , can see link divs "rolled up" when user mouses on link thread, threadpreview div should "unroll" it's original height show content, , onmouseout should roll 19px hide content.

(i'm not using jquery)

edit: if jquery can i'll give shot

something should point in right direction:

function init() { var ldivs = document.getelementsbytagname("div"); for(var = ldivs.length; i--;) { if(ldivs[i].classname == "threadpreview") { ldivs[i].onmouseover = function() { this.style.height = ""; } // improve utilize ldivs[i].addeventlistener("mouseover", ..., false); ldivs[i].onmouseout = function() { this.style.height = "19px"; } } } } window.addeventlistener("load", init, false); // or window.attachevent ie, or window.onload = ...

you'll have utilize appropriate event-attachment function (or switch between them).

javascript javascript-events

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -