Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with image switch

Status
Not open for further replies.

diederikvanveen

Technical User
Sep 15, 2005
5
NL
hi, have some issues regarding an image switch. I want 2 images to change depending on the state of my application. I have play en pause image, they should either on active/inactive. This is the code i have, but however results in an error. any hel would be much appriciated.

Code:
<script type="text/javascript">

function PlayPauseFunc(imgref)
{
  if (imgref.nameProp=='images_template/slideshow_pause.gif')
  {
    var res = document.VirtoolsATL.DoCommand('Pause');
    imgref.nameProp='images_template/slideshow_play.gif';
  } else
  {
    var res = document.VirtoolsATL.DoCommand('Play');
    imgref.nameProp='images_template/slideshow_pause.gif';
  }
}

and for image itself:

Code:
<img src="images_template/slideshow_pause.gif" onclick="PlayPauseFunc(this)">
 
tried that before, didn't work for some reason ??

Code:
<script type="text/javascript">

function PlayPauseFunc(imgref)
{
  if (imgref.src=='images_template/slideshow_pause.gif')
  {
    var res = document.VirtoolsATL.DoCommand('Pause');
    imgref.src='images_template/slideshow_play.gif';
  } else
  {
    var res = document.VirtoolsATL.DoCommand('Play');
    imgref.src='images_template/slideshow_pause.gif';
  }
}
 
edit: OK, just notice I had one '=' to much, if (imgref.src=='images_template/slideshow_pause.gif'), and now my composition pause, however the image stays on || (pause.gif), and doesn't respond to extra click (which should be play again) ;( . So were progressing, but still not there ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top