-
-10 16
-

<?php
header("Content-Type:text/html; charset=utf-8");
require_once('config.inc.php');
require_once('include/dbConnection.class.php');
require_once('inc/sql.fun.php');
$db = new dbConnection(DSN);
$ac = $_REQUEST['ac'];
$query = "select * from product";
$db -> execute($query);
$result = $db -> fetch();
?>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<script src="js/jquery.js" type="text/javascript"></script>
<style>
#preview{border:1px solid #cccccc; background:#333333; padding:5px; display:none; position:absolute;}
</style>
<BODY><script type="text/javascript">
this.imagePreview = function(){
xOffset = 10;
yOffset = 30;
$("a.preview").hover(function(e){
this.t = this.title;
this.title = "";
var c = (this.t != "") ? "<br/>" + this.t : "";
$("body").append("<p id='preview'><img width='100' heitht='100' src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");
$("#preview")
.css("top",(e.pageY - xOffset) + "px")
.css("left",(e.pageX + yOffset) + "px")
.fadeIn("normal");
},
function(){
this.title = this.t;
$("#preview").remove();
});
$("a.preview").mousemove(function(e){
$("#preview")
.css("top",(e.pageY - xOffset) + "px")
.css("left",(e.pageX + yOffset) + "px");
});
};// starting the script on page load
$(document).ready(function(){
imagePreview();
});
</script>
<table width="200" border="1">
<?php
foreach($result as $v){
?>
<tr>
<td><a class="preview" href="images/<?php echo $v['pic'];?>"><img src="images/<?php echo $v['pic'];?>" height="20" width="20" /></a>
</td>
</tr>
<?php
}
?>
</table>
</BODY>
</HTML>

本文来源于php爱好者:php教程 —http://www.phplover.cn/
原文地址:http://www.phplover.cn/post/jqueyshubiaoyishangqufangdatupian.html
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
- 评论(0)
发表评论 TrackBack