How do i duplicate this javascript code with two different messurments?
this javascript code written drop down menu, cannot figgure out how duplicate can have 2nd drop down different messurments. please help?
function enlarge(id)
{document.getelementbyid(id).style.height = '220px';}
function shrink(id)
{document.getelementbyid(id).style.height = '130px';}
function toggle(id)
{if(document.getelementbyid(id).style.height == "130px")
{document.getelementbyid(id).style.height = "220px";}
else{document.getelementbyid(id).style.height = "130px";}}
the code works fine, need have identicle block of code different messurements. because 2nd drop down menu smaller.
function enlarge(id,newheight,oldheight)
{document.getelementbyid(id).style.height = newheight;}
function shrink(id)
{document.getelementbyid(id).style.height = oldheight;}
function toggle(id)
{if(document.getelementbyid(id).style.height == oldheight)
{document.getelementbyid(id).style.height = newheight;}
else{document.getelementbyid(id).style.height = oldheight;}}
then make each call include newheight , oldheight values, e.g.,
<a href="javascript:enlarge('foo','220','130')">menu option</a>
More discussions in Dreamweaver support forum
adobe
Comments
Post a Comment