ranger7
Новичок
Подскажите что не так с кодом?
Слайдшоу идет скачками
вот код:
Посмотреть можно ЗДЕСЬ
Слайдшоу идет скачками
вот код:
PHP:
<div id="premium-stage">
<?php if( osc_count_latest_items() == 0) { ?>
<p class="empty"><?php _e('No Latest Listings', 'refurbished_realestate') ; ?></p>
<?php } else {
$index = 0;
?>
<?php while ( osc_has_latest_items() ) {
?>
<div class="ui-item">
<div class="frame">
<a href="<?php echo osc_item_url() ; ?>"><?php if( osc_images_enabled_at_items() ) { ?>
<?php if( osc_count_item_resources() ) { ?>
<img src="<?php echo osc_resource_preview_url() ; ?>" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>"/>
<?php } else { ?>
<img src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" alt="" title=""/>
<?php } ?>
<?php } else { ?>
<img src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" alt="" title=""/>
<?php } ?>
<div class="type"><?php echo osc_item_category(); ?></div>
<?php if( osc_price_enabled_at_items() ) { ?><div class="price"><?php echo osc_item_formated_price() ; ?></div> <?php } ?>
</a>
</div>
<div class="info">
<div>
<h3><a href="<?php echo osc_item_url() ; ?>"><?php if(strlen(osc_item_title()) > 70){ echo substr(osc_item_title(), 0, 70).'...'; } else { echo osc_item_title(); } ?></a></h3>
</div>
<div class="data"><?php item_refurbished_realestate_attributes(); ?></div>
<div class="author">
<?php echo osc_format_date(osc_item_pub_date()); ?><br />
<?php echo osc_item_city(); ?> (<?php echo osc_item_region();?>)
</div>
</div>
</div>
<?php
$index++;
if($index == 5){
break;
}
}
?>
<div class="clear"></div>
<?php View::newInstance()->_erase('items') ;
} ?>
<script type="text/javascript">
/* <![CDATA[ */
var slides = $("#premium-stage .ui-item:not(:last)").hide();
if(slides.length >= 1){
slider = setInterval('showNext()',5000);
}
function showNext(){
$("#premium-stage .ui-item:last").prev().fadeIn(500);
$("#premium-stage .ui-item:last").fadeOut(500,function(){
$(this).remove().prependTo('#premium-stage');
});
}
function showSlide(el){
clearInterval(slider);
if('#'+$("#slider-stage .slider:last").attr('id') != el){
$(el).remove().insertBefore("#slider-stage .slider:last");
showNext();
}
}
/* ]]> */
</script>
</div>
Последнее редактирование: