我正在尝试循环和淡入/淡出表格中的随机记录到我的网页中。
这是我的代码:
SQL:
SELECT businessid, bsalias, bsname, bswebsite, bsarea, bsstrapline
FROM businesses WHERE businessid >= (SELECT FLOOR( MAX(businessid) * RAND())
FROM businesses) ORDER BY businessid LIMIT 1
HTML:
<div class="divRHSlinksml">
<h1 class="bss">
<a href="http://www.letsgowild.co.uk/business/<?php echo $row_rsBusiness['bsalias']; ?>"><?php echo $row_rsBusiness['bsname']; ?></a>
</h1>
<p class="nomarginbase bss">
<?php if ($row_rsBusiness['bsstrapline'] != ""){
echo $row_rsBusiness['bsstrapline'];
} else {
echo $row_rsBusiness['bsarea'];
} ?>
</p>
</div>
jQuery(在页面末尾):
<script src="http://malsup.github.com/jquery.cycle.all.js" type="text/javascript"></script>
<script type="text/javascript">
// Slideshow
jQuery('.bss').cycle({
fx: 'fade',
speed: 1000,
random: 1
});
</script>
目前随机记录被引入,但它不会淡入/淡出到另一条记录。
非常感谢。