JQUERY卷轴内容

时间:2013-06-01 19:19:10

标签: php javascript jquery customization

我有一个包含来自我的数据库的内容的页面,但我希望能够显示像这样的内容http://www.htmldrive.net/items/show/244/Amazon-style-image-and-title-scroller-with-jQuery我已经下载了脚本而且我(我认为)就像教程一样,但是它根本不起作用。我确定我做的很蠢,但我不知道是什么。

<link href="css/amazon_scroller.css" rel="stylesheet" type="text/css"></link>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/amazon_scroller.js"></script>


<script language="javascript" type="text/javascript">
        $(function() {
            $("#amazon_scroller").amazon_scroller({
                scroller_title_show: 'enable',
                scroller_time_interval: '0',
                scroller_window_background_color: "#CCC",
                scroller_window_padding: '10',
                scroller_border_size: '1',
                scroller_border_color: '#000',
                scroller_images_width: '150',
                scroller_images_height: '100',
                scroller_title_size: '12',
                scroller_title_color: 'black',
                scroller_show_count: '2',
                directory: 'images'
            });
        });
    </script>

<div id="amazon_scroller1" class="amazon_scroller">

<div class="amazon_scroller">
        <div class="amazon_scroller_mask">
            <ul>

 <li>
<?php do { ?>

<div align="center" id="thumb"><a href="legendofgames/gameview.php?recordID=<?php echo $row_GameData['idGames']; ?>"><img src="../legendofgames/documentos/games/<?php echo $row_GameData['strImage']; ?>" width="165" height="120"/></a>
<div align="center" id="gametext"><?php echo $row_GameData['strNome']; ?> </div>
</div> 


<?php } while ($row_GameData = mysql_fetch_assoc($GameData)); ?>
</div>

</li>
</ul>
        </div>
        <ul class="amazon_scroller_nav">
            <li></li>
            <li></li>
        </ul>
        <div style="clear: both"></div>
    </div>

1 个答案:

答案 0 :(得分:0)

示例代码将每个项目(链接+图片)放在<li>中,而您的代码将所有项目放在同一个<li>中。尝试:

<div id="amazon_scroller1" class="amazon_scroller">

<div class="amazon_scrolle  r">
<div class="amazon_scroller_mask">

<ul>
<?php do { ?>
<li>
<div align="center" id="thumb"><a href="legendofgames/gameview.php?recordID=<?php echo $row_GameData['idGames']; ?>"><img src="../legendofgames/documentos/games/<?php echo $row_GameData['strImage']; ?>" width="165" height="120"/></a>
<div align="center" id="gametext"><?php echo $row_GameData['strNome']; ?> </div>
</div>
</li>
<?php } while ($row_GameData = mysql_fetch_assoc($GameData)); ?>



</ul>
</div>
</div>
        <ul class="amazon_scroller_nav">
            <li></li>
            <li></li>
        </ul>
        <div style="clear: both"></div>
</div>