progpars
چهارشنبه 03 خرداد 1391, 10:43 صبح
سلام من میخوام یک اسلاید شو رو اتوماتیک کنم اسلاید شو هم توی این سایت به کار رفته :
respinaseir.ir
آشنایی کمی با جی کوئری دارم و فقط میدونم با استفاده از متود setInterval() میشه این کارو کرد و فک میکنم از حلقه هم باید توش استفاده بشه کدهای من :
<script type="text/javascript">
$(document).ready(function() {
var imgWrapper = $('.slideshow > img');
// only show the first image, hide the rest
imgWrapper.hide().filter(':first').show();
$('ul.recentlist li a').click(function (){
// check if this item doesn't have class "current"
// if it has class "current" it must not execute the script again
if (this.className.indexOf('current') == -1){
imgWrapper.hide();
imgWrapper.filter(this.hash).fadeIn(500);
$('ul.recentlist li a').removeClass('current');
$(this).addClass('current');
}
return false;
});
});
</script>
لطفاً راهنمایی فرمایید در مورد کدنویسی مذکور
respinaseir.ir
آشنایی کمی با جی کوئری دارم و فقط میدونم با استفاده از متود setInterval() میشه این کارو کرد و فک میکنم از حلقه هم باید توش استفاده بشه کدهای من :
<script type="text/javascript">
$(document).ready(function() {
var imgWrapper = $('.slideshow > img');
// only show the first image, hide the rest
imgWrapper.hide().filter(':first').show();
$('ul.recentlist li a').click(function (){
// check if this item doesn't have class "current"
// if it has class "current" it must not execute the script again
if (this.className.indexOf('current') == -1){
imgWrapper.hide();
imgWrapper.filter(this.hash).fadeIn(500);
$('ul.recentlist li a').removeClass('current');
$(this).addClass('current');
}
return false;
});
});
</script>
لطفاً راهنمایی فرمایید در مورد کدنویسی مذکور