首 页  >>  E商学院  >>  zencart百科  >>  zencart新进产品滚动

zencart新进产品滚动

下面是whats'new的代码,红色为加上去的代码!!!

<?php

$content = "";   
$whats_new_box_counter = 0;    
$content .= '<marquee behavior= "scroll" align= "center" direction= "up" height="200px" scrollamount= "1" scrolldelay= "5" onmouseover='this.stop()' onmouseout='this.start()'><center>';     
while (!$random_whats_new_sidebox_product->EOF) {    
$whats_new_box_counter++;    
$whats_new_price = zen_get_products_display_price($random_whats_new_sidebox_product->fields['products_id']);    
$content .= '<div class="sideBoxContent centeredContent">';    
$content .= '<a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($random_whats_new_sidebox_product->fields['master_categories_id']) . '&products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product->fields['products_image'], $random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);    
$content .= '<br />' . $random_whats_new_sidebox_product->fields['products_name'] . '</a>';    
$content .= '<div>' . $whats_new_price . '</div>';    
$content .= '</div>';    
$content .= '<br />';    
$random_whats_new_sidebox_product->MoveNextRandom();    
}

$content .= '</center></marquee>';   
?>

这样就可以将里面的产品为滚动的,如果这样动不起来,可以将marquee里面的参数定意成变量,在里面调用就可以了!!!


点击次数:2128  发布日期:2013-04-13  【打印此页】  【关闭