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 divclass="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
Post a Comment