سلام.
شما نوشتید با "کمترین کد"، من میخونم "ساده و با کمترین کد" !
پس فایل ضمیمه رو ببینید. یه اسلایدر ساده که قابل گسترش هست...
کد HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>slider</title>
<script src="jquery.js" language="javascript"></script>
<script>
function slideSwitch() {
var $active = $('div#slideshow IMG.active');
activeIndex = $( 'div#slideshow IMG.active' ).index();
if(activeIndex== $('div#slideshow IMG').last().index())
$next= $('div#slideshow IMG').first();
else
$next = $active.next();
$next.addClass('active');
$active.removeClass('active');
}
$(function() {
setInterval( "slideSwitch()", 2000 );
});
</script>
<style type="text/css">
.active{
z-index:99;
}
</style>
</head>
<body>
<div id="slideshow">
<img src="1.jpg" style="position:absolute;" class="active" />
<img src="2.jpg" style="position:absolute;" />
<img src="3.jpg" style="position:absolute;" />
</div>
</body>
</html>