Friday 13 December 2013

swapping/changing image of image button in javascript on ClientClick

//// set value = "expand" in your image button tag, get this value to swap image randomly.

function swapimagesrc()
    {
      if(document.getElementById("imgbuttonExpand").value =="expand")
      {
         document.getElementById("imgbuttonExpand").src = '../CRMImages/close_view.fw.png';
         document.getElementById("imgbuttonExpand").value = "close";
      }
      else if(document.getElementById("imgbuttonExpand").value =="close")
      {
          document.getElementById("imgbuttonExpand").src = '../CRMImages/expand_view.fw.png';
            document.getElementById("imgbuttonExpand").value = "expand";
      }
    }

No comments:

Post a Comment