Center position:absoulute box?

tanit

New Member
I made an simple slideshow with jquery and now i have the problem that i cannot center the div box in wich the slideshow is, the name of the is fadein:\[code\]<style>body,html {margin:0; padding:0; width:100%; height:100%}.fadein { position:relative; width:auto; height:100%; }.fadein img { position:absolute; left:0; top:0; }</style><script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script><script>$(function(){ $('.fadein img:gt(0)').hide(); setInterval(function(){$('.fadein :first-child').fadeOut().next('img').fadeIn().end().appendTo('.fadein');}, 3000); });</script></head><body><div class="fadein"> <img src="http://stackoverflow.com/questions/15811109/1.png" width="auto" height="100%"> <img src="http://stackoverflow.com/questions/15811109/2.png" width="auto" height="100%"> <img src="http://stackoverflow.com/questions/15811109/3.png" width="auto" height="100%"> <img src="http://stackoverflow.com/questions/15811109/4.png" width="auto" height="100%"> <img src="http://stackoverflow.com/questions/15811109/5.png" width="auto" height="100%"> <img src="http://stackoverflow.com/questions/15811109/6.png" width="auto" height="100%"> <img src="http://stackoverflow.com/questions/15811109/7.png" width="auto" height="100%"> <img src="http://stackoverflow.com/questions/15811109/8.png" width="auto" height="100%"></div></body>\[/code\]I know that the problem that i cannot simply center is that it position is relative and the position of the img absolut! Somehow somebody knows how to make it work! Thanks
 
Back
Top