Click here to Skip to main content
15,891,033 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Ball to Ball collision handling Pin
Kenneth Haugland26-Mar-13 15:29
mvaKenneth Haugland26-Mar-13 15:29 
GeneralRe: Ball to Ball collision handling Pin
dusty_dex26-Mar-13 21:00
dusty_dex26-Mar-13 21:00 
GeneralRe: Ball to Ball collision handling Pin
Kenneth Haugland26-Mar-13 22:01
mvaKenneth Haugland26-Mar-13 22:01 
AnswerRe: Ball to Ball collision handling Pin
SRJ9227-Mar-13 4:04
SRJ9227-Mar-13 4:04 
QuestionAjax request call using jquery Pin
Raj G121-Mar-13 2:49
Raj G121-Mar-13 2:49 
GeneralRe: Ajax request call using jquery Pin
dusty_dex21-Mar-13 8:33
dusty_dex21-Mar-13 8:33 
GeneralRe: Ajax request call using jquery Pin
jkirkerx21-Mar-13 9:24
professionaljkirkerx21-Mar-13 9:24 
GeneralSlide show Pin
Tichaona J21-Mar-13 0:10
Tichaona J21-Mar-13 0:10 
I’m trying to get my website to show images one after the other using java script I got from www.javascriptkit.com/howto/show2.shtml and have followed there example as closely as I can but with no luck.

HTML
<head>
 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 <title>Acrele - Home</title>
 <meta name="keywords" content="" />
<meta name="description" content="" />
<link href="CSS1.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">

        var image1=new Image()
        image1.src="16.jpg"

        var image2=new Image()
        image2.src="employee-training.jpg"

        var image3=new Image()
        image3.src="Real_Estate_Investment_Education.jpg"

        var image4=new Image()
        image4.src="Unti2tled.jpg"

        var image5=new Image()
        image5.src="Untitled.jpg"

        var image6=new Image()
        image6.src="zclassroom.jpg"

</script>

</head>



2. Added the html code were I want the image to show:

HTML
<div id="left-feature-colum">

                     <div id="slider-bg">

                        <div id="slider">


                                    <img src="16.jpg" id="slide" width="600px" height="300px">

                         </div>

               </div>

            </div>


3. Edited there javascript accordingly to the number of images I’m using:

JavaScript
<div id="left-feature-colum">

                     <div id="slider-bg">

                        <div id="slider">

                                    <img src="16.jpg" id="slide" width="600px" height="300px">

                                    <script>
                                    var step=1;

                                  //if browser does not support the image object, exit.
                                  var img = document.getElementById('slide');
                                  img.src = "image" + step + ".src";
                                  console.log(img.src);
                                  if (step < 6) step++;
                                      else step = 1;
                                      //call function "slideit()" every 2.5 seconds
                                      setTimeout(slideit, 3500);


                             </script>
                         </div>

               </div>

            </div>


This isn’t working, it only load the first image “16.jpg” only…Help
GeneralRe: Slide show Pin
Graham Breach21-Mar-13 1:37
Graham Breach21-Mar-13 1:37 
GeneralRe: Slide show Pin
jkirkerx21-Mar-13 7:55
professionaljkirkerx21-Mar-13 7:55 
GeneralRe: Slide show Pin
alisener198022-Mar-13 9:41
alisener198022-Mar-13 9:41 
QuestionA question to dust_dex Pin
Hakan Bulut20-Mar-13 22:51
Hakan Bulut20-Mar-13 22:51 
AnswerRe: A question to dust_dex Pin
dusty_dex21-Mar-13 5:29
dusty_dex21-Mar-13 5:29 
GeneralRe: A question to dust_dex Pin
Hakan Bulut24-Mar-13 21:13
Hakan Bulut24-Mar-13 21:13 
GeneralRe: A question to dust_dex Pin
dusty_dex24-Mar-13 21:53
dusty_dex24-Mar-13 21:53 
GeneralRe: A question to dust_dex Pin
Hakan Bulut24-Mar-13 23:47
Hakan Bulut24-Mar-13 23:47 
GeneralRe: A question to dust_dex Pin
Hakan Bulut25-Mar-13 1:11
Hakan Bulut25-Mar-13 1:11 
GeneralRe: A question to dust_dex Pin
dusty_dex25-Mar-13 7:25
dusty_dex25-Mar-13 7:25 
GeneralRe: A question to dust_dex Pin
Hakan Bulut25-Mar-13 3:21
Hakan Bulut25-Mar-13 3:21 
GeneralRe: A question to dust_dex Pin
Hakan Bulut25-Mar-13 3:22
Hakan Bulut25-Mar-13 3:22 
GeneralRe: A question to dust_dex Pin
dusty_dex25-Mar-13 8:53
dusty_dex25-Mar-13 8:53 
GeneralRe: A question to dust_dex Pin
Hakan Bulut25-Mar-13 21:21
Hakan Bulut25-Mar-13 21:21 
GeneralRe: A question to dust_dex Pin
dusty_dex25-Mar-13 11:58
dusty_dex25-Mar-13 11:58 
GeneralRe: A question to dust_dex Pin
Hakan Bulut26-Mar-13 21:58
Hakan Bulut26-Mar-13 21:58 
GeneralRe: A question to dust_dex Pin
dusty_dex27-Mar-13 8:14
dusty_dex27-Mar-13 8:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.