Hey, I'm new here and I'm not that good with javascript, but it would be really nice if someone could help me out here. Currently I'm using this script for my drop down, but the question is, is it possible to edit it, so if you open it, it will open smoothly? Here's the script: Thanks in advance.
Not sure what kind of effect you want. Did you want it to fade on or did you want more of an accordian effect? Look here http://www.switchonthecode.com/tutorials/javascript-and-css-tutorial-accordion-menus
Well I guess this animation could work, quote from that page you sent. var ContentHeight = 200; var TimeToSlide = 250.0; var openAccordion = ''; function runAccordion(index) { var nID = "Accordion" + index + "Content"; if(openAccordion == nID) nID = ''; setTimeout("animate(" + new Date().getTime() + "," + TimeToSlide + ",'" + openAccordion + "','" + nID + "')", 33); openAccordion = nID; } Code (markup): function animate(lastTick, timeLeft, closingId, openingId) { var curTick = new Date().getTime(); var elapsedTicks = curTick - lastTick; var opening = (openingId == '') ? null : document.getElementById(openingId); var closing = (closingId == '') ? null : document.getElementById(closingId); if(timeLeft <= elapsedTicks) { if(opening != null) opening.style.height = ContentHeight + 'px'; if(closing != null) { closing.style.display = 'none'; closing.style.height = '0px'; } return; } timeLeft -= elapsedTicks; var newClosedHeight = Math.round((timeLeft/TimeToSlide) * ContentHeight); if(opening != null) { if(opening.style.display != 'block') opening.style.display = 'block'; opening.style.height = (ContentHeight - newClosedHeight) + 'px'; } if(closing != null) closing.style.height = newClosedHeight + 'px'; setTimeout("animate(" + curTick + "," + timeLeft + ",'" + closingId + "','" + openingId + "')", 33); } Code (markup): But question is, how to implant it? Thanks in advance.
I'm outta here for today. But do a view source on that web page and find out how they are creating the (probably) <ul><li> etc. And look to see where they are calling those scripts. I have never used this. I just thought is was pretty cool.