Welcome Guest ( Log In | Register)



 
Closed TopicStart new topic
> Javascript Help, Can't do simple variable functions ¬_¬
Dagoth Nereviar
post Aug 7 2006, 08:15 PM
Post #1


Privileged Member
*********

Group: [HOSTED]
Posts: 537
Joined: 19-May 06
From: Leeds, UK
Member No.: 23,963



Edit: Haha, nevermind....I've had it fixed now biggrin.gif an admin/mod can delete this if s/he feels like it tongue.gif



Slide show

So i'm trying to make my own slideshow, see above. I have the pictures showing depending what "num" equals...Well, the code's here:
CODE
<script TYPE="text/javascript">
<!--
var num = 1;
var pic = "pic.gif";

switch (num)
{
default:
document.write("<img src='pic1.gif'>");
break;

case 1:
document.write("<img src='pic1.gif'>");
break;

case 2:
document.write("<img src='pic2.gif'>");
break;

case 3:
document.write("<img src='pic3.gif'>");
break;
}

function next()
{
num ++;
alert("Done!");
}
-->
</SCRIPT>
<br>
<script TYPE="text/javascript">
<!--
document.write(num)
-->
</SCRIPT>
<br><br>
<form>
<input type="button" onclick="next()" value="Next">
</form>


(That's all in the body section, btw.)

But when I click "Next", the alert comes up, but num doesn't increase....I've tried using "num + 1" "num = num + 1" "num += 1" etc, etc, etc, but none of them work.

So my question is...How can I get it to work?

This post has been edited by Dagoth Nereviar: Aug 7 2006, 09:37 PM
Go to the top of the page
 
+Quote Post
BuffaloHELP
post Aug 8 2006, 05:07 AM
Post #2


Desperately seeking "any key" to continue...
Group Icon

Group: Admin
Posts: 3,481
Joined: 23-April 05
From: Trap17 storage box
Member No.: 6,042



It would have been nice to know how you fixed it. Topic closed.
Go to the top of the page
 
+Quote Post

Closed TopicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Php Calculator(17)
  2. Javascript Slideshow Tutorial(4)
  3. Image Preloader With Progress Bar Status(23)
  4. How To: Change Your Website's Index File(24)
  5. Verifying Email Addresses(9)
  6. Simple C File Handling In Action(4)
  7. Watermark Your Image With Simple Php Script(35)
  8. Playing Flash Movies Without The One-click Activation: Simple Insertion Of Javascript(4)
  9. Very Simple Online Now Script(4)
  10. Simple Php Login And Registration System(15)
  11. Php Functions To Send Mail(9)
  12. How Often Do You Use Css?(12)
  13. Simple Javascript And Password System(9)
  14. Do You Close The Javascript?(4)
  15. Functions(9)
  1. A Simple Preg_replace Help Please.(2)
  2. Vb Variable Help(2)
  3. Making A Picture Viewer Website(3)
  4. Finding Good Free Hosting Can Be Frustrating And Costly.(1)
  5. Javascript And Ajax For The Web, Sixth Edition Review(0)
  6. Creating A Floating Javascript Docking Menu(1)
  7. Browser Compatibility Problem With Firefox - Javascript + Css(3)
  8. Seeking Help With Javascript(1)
  9. Create Dynamic Html/php Pages Using Simple Vb.net Code(1)
  10. Flash Tutorial Simple Motion Tween(0)
  11. Video Play Like Youtube(3)
  12. Validating Javascript(2)
  13. Need Help With Javascript Drag And Drop Script(2)


 



- Lo-Fi Version Time is now: 8th October 2008 - 10:21 AM