来自数据库的自动滚动水平图像
我有以下代码,可以生成一些带有与数据库关联的网址的图像:
<html>
<head>
<title></title>
</head>
<body>
<div id="datacontainer">
<?php
ini_set('display_errors', 0);
header('Content-type: text/html; charset=UTF-8') ;
//Retriving informations from database
mysql_connect("****", "****", "*****");
mysql_select_db("*****);
$result = mysql_query("SELECT * FROM table ORDER BY RAND() LIMIT 52");
print "<table width='200' border='0' ><style>
td {overflow:hidden;}
</style> ";
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$link=$row['url'];
$title=$row['siteTitle'];
$thumb= $row['url'];
print " <tr>
<td><div style= 'text-align:center;height:90px;padding: 5px 5px 5px 5px;overflow:hidden;'><a href='$link' target='_blank'><img src='http://open.thumbshots.org/image.pxf?url=$thumb'/></a></div></td>
</tr>
<tr>
<td><div style= 'text-align:center;height:20px;padding: 5px 5px 5px 5px;overflow:hidden;'><a href='$link'target='_blank'><font color='0000ff'>$title </font></a></div></td>
</tr>";
}
print"</table>";
?>
</div>
</body>
</html>
我需要从左到右实现该图像的自动水平滚动器,容器的宽度可能最多为 4 个图像 我正在搜索图库图像脚本或类似内容 你能帮助我吗? 谢谢
i have the following code that generate some images with urls associated from database:
<html>
<head>
<title></title>
</head>
<body>
<div id="datacontainer">
<?php
ini_set('display_errors', 0);
header('Content-type: text/html; charset=UTF-8') ;
//Retriving informations from database
mysql_connect("****", "****", "*****");
mysql_select_db("*****);
$result = mysql_query("SELECT * FROM table ORDER BY RAND() LIMIT 52");
print "<table width='200' border='0' ><style>
td {overflow:hidden;}
</style> ";
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$link=$row['url'];
$title=$row['siteTitle'];
$thumb= $row['url'];
print " <tr>
<td><div style= 'text-align:center;height:90px;padding: 5px 5px 5px 5px;overflow:hidden;'><a href='$link' target='_blank'><img src='http://open.thumbshots.org/image.pxf?url=$thumb'/></a></div></td>
</tr>
<tr>
<td><div style= 'text-align:center;height:20px;padding: 5px 5px 5px 5px;overflow:hidden;'><a href='$link'target='_blank'><font color='0000ff'>$title </font></a></div></td>
</tr>";
}
print"</table>";
?>
</div>
</body>
</html>
i need of implement a auto horizontal scroller of this images from left to right possibly with a width of container of max 4 images
I'm searching a gallery image script or similar
can you help me?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜你提到的是图片库。嗯,有很多可用的(可以在这里找到一个 - http://www.dynamicdrive.com /dynamicindex14/leftrightslide.htm )。不过,您必须修改当前的代码才能合并图库并为图库代码提供所需的输入。
希望这有帮助。
I guess you are mentioning about an Image gallery. Well there are many of them available (one can be found here - http://www.dynamicdrive.com/dynamicindex14/leftrightslide.htm ). You will have to modify your current code though in order to incorporate a gallery and provide the gallery code with the inputs it expects.
Hope this helps.