i have 3 links... (eg. stomach, brain and heart). and also 3 images (stomach.gif, brin.gif and hear.gif) when i click stomach i want to display the image of stomach and hide the rest. ALSO there are another 2 links (view cross-section, and view inside) and images associated with this
if stomach is selected, clicking the 'view corss-section' should display corss-section image of the stomach (together with the stomach image).....if brain is selected, clicking 'view corss-section' should display corss-section image of the brain....and so on...Hope you got the question....Can any pls tel how to write some javascrip code to this...i am somewhat new programming...thanks in advance
i have 3 links... (eg. stomach, brain and heart). and also 3 images (stomach.gif, brin.gif and hear.gif) when i click stomach i want to display the image of stomach and hide the rest. ALSO there are another 2 links (view cross-section, and view inside) and images associated with this
if stomach is selected, clicking the 'view corss-section' should display corss-section image of the stomach (together with the stomach image).....if brain is selected, clicking 'view corss-section' should display corss-section image of the brain....and so on...Hope you got the question....Can any pls tel how to write some javascrip code to this...i am somewhat new programming...thanks in advance
Hi. The short answer is you can detect which images are currently visible and choose which ones to show or hide accordingly.
Thank you very much...Thats what i wanted..In the same Can i have two accompanying button for 1 image. I mean one to 'view inside' (the stomach) and other one to 'view cross-section'...Loads of thanks once again
Thank you very much...Thats what i wanted..In the same Can i have two accompanying button for 1 image. I mean one to 'view inside' (the stomach) and other one to 'view cross-section'...Loads of thanks once again
Yes, you can use the "arguments" object that javscript provides. It represents all arguments passed into a function so you don't have to declare each one specifically in the function definition. You can therefore pass in as many element IDs as you want, and then display only those.
Once again thanks a lot....One more thing..Referring to the FIRST reply, how can i make the ' Show Accompanying image' button to change its text...Once some1 click this button i want to change its text to 'Hide Accompanying image' AND when click it should hide the accompanied image changing AND change text back to 'Show Accompanying image'
Once again thanks a lot....One more thing..Referring to the FIRST reply, how can i make the ' Show Accompanying image' button to change its text...Once some1 click this button i want to change its text to 'Hide Accompanying image' AND when click it should hide the accompanied image changing AND change text back to 'Show Accompanying image'
You can change the button's text by passing a reference to the button, in to the function that runs when you click it. You can pass an element's reference to one of its event functions using the "this" keyword (see example at address below).
Then in the button's onclick function you can manipulate its contents and behaviour, for example
button.firstChild.nodeValue = "new text";
button.onclick= function(){do_something_different();}
I've modified the previous example so that if you click the "show accompanying images" button it changes its text to "hide accompaying images" and changes it onclick function as well.
Loads of thanks again...i need another button... i tried... please help
with what u gave i have made a sample page here...http://www.scicomonline.com/dnmic/sample.html#
i want if the flower is selected clicking for lesson notes to load flower.html (or a url) if brain is selected clicking lesson notes take u to brain.html
Bookmarks