Good day! Tell me please! Why can't I assign absolute positioning to a slide? For some reason, with absolute positioning, the first pictures and the rest of the pictures become visible. How can this be fixed?

<html> <head> <title>Слайд</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> <Link rel="stylesheet" type="text/css" href="css/slide.css"> <script type="text/javascript" src="jquery-1.10.2.min.js"></script> <script> window.onload = function() { start(0,0); } var slide = 5; var now_slide = 1; var speed = 3000; var width = 500; function slider(ml) { $("#slide").animate({marginLeft:ml+"px"},{queue: false},500); } function start(px,step) { if(step == 0) { slider(px); px = px - width; now_slide++; if(now_slide == slide)setTimeout("start("+px+",1);",speed); else setTimeout("start("+px+",0);",speed); } if(step == 1) { slider(px); px = px + width; now_slide--; if(now_slide == 1)setTimeout("start("+px+",0);",speed); else setTimeout("start("+px+",1);",speed); } } </script> </head> <body> <div style="height:334px;width:500px;border:1px solid #000;overflow:hidden;"> <table id="slide" cellpadding="0px" cellspacing="0px" border="0px"> <tr> <td width="500px"><img src="img/ime.jpg" border="0px"></td> <td width="500px"><img src="img/imr.jpg" border="0px"></td> <td width="500px"><img src="img/ims.jpg" border="0px"></td> <td width="500px"><img src="img/imt.jpg" border="0px"></td> <td width="500px"><img src="img/imv.jpg" border="0px"></td> </tr> </table> </div> </body> </html> 
  • @ Arty21, i need jsfiddle. - vkovalchuk88
  • one
    @ Arty21, To format a code, select it with the mouse and click on the {} button of the editor. - zb '
  • tell me how to add manual control? - Arty21
  • there was a similar question. Even there is a fiddle, look, maybe you can take something for yourself - jsfiddle.net/Barton89/sbbdF/2 - Barton
  • In the above marked fiddle there is a glitch, if you turn the manual control to the end, and when you try to enter a new circle, the slide is wedged and stops showing the photo until you press f5. Inexplicably? - Arty21

1 answer 1

Try to make the table position:relative;

  • Everything broke due to the fact that I pulled out a slide from the window, which hid everything superfluous. Thank you you were almost right. In css, I set position: absolute for the div style and everything turned out, but before that I tried to set position: absolute for the table. - Arty21
  • If you can tell me please. How can I set manual slide control in this code? If you can help! - Arty21
  • the easiest way to id do the id of the form slide + i onclick = "$ ('# slide tr td'). next ('td'). slide show" something like this, why make the slider have a bunch of ready-made solutions? and I also advise you to remove the table to do everything on divas, it will be easier and more convenient - sergeyJqueryUser