I only have very basic knowledge on Javascript and I want to be able to make my more/less button that displays/hides content be an animated slide instead of an instant change. Here is the Javascript I currently have:
function doMenu(item) {
obj=document.getElementById(item);
col=document.getElementById("x" + item);
if (obj.style.display=="none") {
obj.style.display="block";
col.innerHTML="[-] Less";
} else {
obj.style.display="none";
col.innerHTML="[+] More";
}
}
Does anyone know how I can change this Javascript to slide instead?
EDIT An example of the link I use to show/hide content
<a href="JavaScript:doMenu('main');" id=xmain>[+] More</a>
check out the jquery library(slidedown): w3 schools jquery- jquery.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With