DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   Image Swapping (http://www.daniweb.com/forums/thread116610.html)

shashipkiran Mar 31st, 2008 11:00 am
Image Swapping
 
I want to swap two images back and forth based on a mouse click. eg + and -.
i am doing this on a tree structure based on the values extracted from the database.
eg

+ English
- Maths
- Trignometry
+ Chemistry

and the code which i am using is

<script language='javascript' type='text/javascript'>
intImage = 2;
function swapimage() {
switch (intImage) {
 case 1:
  imgname.src = "plus.gif"
  intImage = 2
  return(false);
case 2:
  imgname.src = "minus.gif"
  intImage = 1
  return(false);
 }
}
</script>



Now the problem is that i am only able to do this image swapping on 'English'. But i want this for the entire TREE Structure based on the node which the user clicks.

Please help.....


All times are GMT -4. The time now is 4:51 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC