Jump to content

abdoel

New Members
  • Posts

    1
  • Joined

  • Last visited

abdoel's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi there, i'm busy with a project but know im stuck at some point. What i want to do is, when someone presses the home button it changes his color. How I wanted to do is swap from image 1 (white) to image 2 (blue). So the person can see on which page he/she is. But when i put this code into the website, it wont show nothing. When i press 2 times it will show the blue image. And when i press many times you see the white and blue image swapping. But it won't stand on the white image, only on the blue image Here is the code i use. --> <a href='' "<?php echo $this->createUrl("/admin/survey/sa/index"); ?>" onclick="edit()"><img id="img1" onclick="imageChange(this)"'<?php echo $sImageURL;?>home.png' alt='<?php $clang->eT("Default administration page");?>' /> <script type="text/javascript"> { var img1 = "/LimeSurvey/styles/scanyours/images/home.png"; var img2 = "/LimeSurvey/styles/scanyours/images/home1.png"; } { var imageChoice = 1; } function imageChange(element) { if (imageChoice == 1) { element.src = img2; imageChoice = 2; } else if (imageChoice == 2) { element.src = img1; imageChoice = 1; } } </script></a>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.