Jump to content

Hello(An image problem)


anushka

Recommended Posts

Hii

 

i have a situation .i kept button has an image type(and the image will be of forward/backward).whenever the user clicks on the backward button the image should go show that particular image And i Am using sliding show also

and the code which i have written is here

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>continuous scrolling images</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
body 
#container {
     position:relative;
     width:500px;
     height:300px;
     overflow:hidden;
     border:5px double #000;
     background-color:#fff;
     margin:100px auto 0 auto;
 height:300px;
}
#div1 {
     position:absolute;
     left:0px;
     top:0px;
     width:500px;
     height:500px;
}
#div2 {
     position:absolute;
     left:424px;
     top:0px;
     width:500px;
     height:500px;
}
  #div3 {
    
 position:absolute;
   bottom:0;
   width:100%;
   background:#F6F6F6;
   height:20px;   /* Height of the footer */
   

}

   #div4 {
     position:absolute;
     bottom:0;
   width:100%;
   
    
}
img {
     border:1px solid #000;
     margin:2px;
     float:left;

  }
</style>

<script type="text/javascript">

  var m=0;
  var n=424;
  var speed=20;
function scrollPics() {
     document.getElementById('div1').style.left=m+'px';
     document.getElementById('div2').style.left=n+'px';
   m--;
   n--;
if(m==-424) {
   m=424;
}
if(n==-424) {
   n=424;
}
setTimeout('scrollPics()',speed);
} 
window.onload=function() {
   scrollPics();
}



</script>

</head>
<body>

<div id="container">

<div id="div1">
<img src="snow trees.jpg" height="200" width="200" alt="">
<img src="homepage.jpg" height="200" width="200" alt="">

</div>

<div id="div2">

<img src="windows 2000.jpg"height="200" width="200" alt="">
<img src="solar eclipse.jpg"height="200" width="200" alt="">
</div>

</script>


<div id="div3">
<INPUT TYPE="image" SRC="forward.jpg"  align= "left" VALUE="Submit now"
ALT="Submit now" NAME="Submit now" >
</div>

<div id="div4">
<INPUT TYPE="image" SRC="backward.jpg"   align="right" VALUE="Submit now1"
ALT="Submit now1" NAME="Submit now1" >
</div>
</body>
</html>

 

 

Please tel how to do  this

 

EDIT:Code tags...use em'

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.