PDA

View Full Version : How to do that cool onMouseover effect on Microsoft's site?


wox3-iO
04-28-2003, 02:50 PM
I've tried imitating that, but I haven't succeeded.

Doing something as simple as the following (this is just a rough example)...:

function hilite(targ) {
document.all[targ].style.border = "solid 1px #B5B5B5";
document.all[targ].style.backgroundColor = "#FAFAFA";
}
... won't do the trick, because it will push the other cells/layers away from itself.
brothercake made a nice menu script that looks and acts just like the MS menu, but I couldn't find the solution from his code.
Any help is appreciated.

beetle
04-28-2003, 03:00 PM
You have to either have the padding or the border already set on the element, so it occupies the correct height before the rollover.

So add a 1px border of the same color as the BG -or- set the padding or margin to 1px -- but make sure to zero that with the rollover.