Please help: js/css
- Started
- Last post
- 8 Responses
- kodap
I have a "onmouseover" and "onmouseout" function on a div (id="topbar") and inside its tag, that is supposed to scale down/up and show/hide child content below - kinda like ajax fx.
So far so good. It scales down and shows the content and on mouse out it scales to the original onload size. :)
but when scaled and when I hover and step out of the limits of a any of the child elements contained within "topbar", it scales again ...
is it a problem of my css'ed nested elements? or is it a Javascript malfunction?
this is how it's supposed to look like :
(hover the red bar at the top)
http://webdesignbook.net/whitesp…here's mine f*ckd up:
http://www.fitacola.com/index.ph…
please don't spread, it's not finished and it's only for testing my new customized wordpress theme..I'm stuck here for about 3 hours on this..
shishhhPlease give me a hand on this... Thanks
(I hope I made mysef clear)
- caseyc0
I'm not familiar with the scriptaculous stuff but the simple solution that comes to mind is to just check the height of the panel.
Something like
if( topbar.height >= targetHeight ) {
return;
}
- weestu0
maybe it's better to make it onclick rather than onmouseover. The only explanation I can think of is that the child elements of the topbar div are taking on the functions of the topbar. You could try overriding these functions with null onmouseout and onmouseover functions for any a tags inside the topbar. I dunno if this would work or not though. Site looks nice btw :)
- blaw0
i think weestu has it (the child elements are inheriting the parent's properties).
i'd try his suggestion of the 'null' events, vs. on click, as i missed the menu on the first link, and i was looking for it.
- kodap0
thanks for your help, I'll try the onclick and maybie stick to it, since I've wasted a lot of time trying to strip the styles on the inherited elements to avoid losing the mouseover of the parent...
- kodap0
finally got it.. adjusting child divs, h2, ul's and li's adding display:block to fit the whole area of the parent div, so no chance to re-hover the parent... while inside it
thanks for your help
- jakeyj0
dude! you're ripping Lokesh!!!
- jakeyj0
am i the only one who thinks so?
- figit0
Go with onclick bro and have it exposed by default. That's how I set it up on my site.. I also ducmented the custom accordion I made using scriptaculous here.