Hi there! I'm an amateur who's been struggling with this for several hours: I'm trying to update a portfolio page and am having trouble figuring out how to infuse two actions into a single Javascript command. When the user clicks on an image pointing to "biztext," I want to get the existing "vidtext" to disappear and "biztext" to appear in its place. I can get either the appear or disappear commands to work on their own, but I don't know how to join them at "onclick" to get both to happen at once.
{The page is set up with three sections. The first appears on the page when it first uploads. If a user clicks on buttons for the other two sections, the javascript should take away the first section and display the one the user clicked. I think the way I've arranged this, it should work as long as I can make one "onclick" command create more than a single action.}
Code that performs "appear" action for "biztext":
Code that should make "vidtext" disappear:Code:<a href="javascript:;" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('bizblack','','../images/subhead images/Work Buttons/workbutton-biz-green.png',1)" onClick="document.getElementById('biztext').style.display='block';"><img src="../images/subhead images/Work Buttons/workbutton-biz-black.png" width="200" height="26" id="bizblack" /></a>------------Code:onClick="document.getElementById('vidtext').style.display='none';"
Full set of Javascript commands used in this part of the document:
---------Code:<a href="javascript:;" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('bizblack','','../images/subhead images/Work Buttons/workbutton-biz-green.png',1)" onClick="document.getElementById('vidtext').style.display='none';"><img src="../images/subhead images/Work Buttons/workbutton-biz-black.png" width="200" height="26" id="bizblack" /></a> <img src="../images/subhead images/Work Buttons/workbutton-vid-green.png" width="194" height="26" id="vidblack" /> <a href="javascript:;" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('printblack','','../images/subhead images/Work Buttons/workbutton-print-green.png',1)" onClick="document.getElementById('printtext').style.display='block';" onClick="document.getElementById('vidtext').style.display='none';"><img src="../images/subhead images/Work Buttons/workbutton-print-black.png" width="112" height="26" id="printblack" /></a>
Thanks for your help! Much appreciated.


Reply With Quote


Bookmarks