我正在从数据库中提取图像以将其显示在我的页面上,但它不会显示。为了确认图像是从数据库中调用的,我在 title= 上输出图像名称,当您将鼠标放在看不见的图像上时,您可以看到图像名称,但图像本身根本不显示。该网站是这样的: http ://clicktravelnstay.com/desti_list.php?details=19
<div id="imgdisplay">
<div class="pagecontainer">
<div class="galleryCredit">Hotel Photos</div>
<div class="galleryType">Preview</div>
<div class="clear_both"></div>
<div class="galleryContent">
<!--image goes herewidth:650px; height:300px;-->
<!--This is Where the wide image and the caption icon will be placed-->
<div class="galleryThumbnail">
<?php
$query = "SELECT * FROM image WHERE hotel_id = {$hotel['hotel_id']}";
$image_set = mysql_query($query,$connection);
while($image = mysql_fetch_array($image_set)){?>
<a href=\"img/photos/<?php $image['image_url'];?>" title="<?php echo $image['image_url']?>">
<img src="img/photos/<?php echo $image['image_url'];?>" width="75" height="75"/></a>
<?php } ?>
<div class="clear_both"></div>
</div>
<div class="galleryPreview">
</div>
<div class="clear_both"></div>
<div class="clear_both"></div>
<div class="gallery_preload_area"></div>
</div>
<!--image goes herewidth:650px; height:300px;-->
</div>
以下代码是图片库的 Jquery 代码。
$(document).ready(function(){
$(".galleryThumbnail a").click(function(e){
e.preventDefault();
//update thumbnail
$(".galleryThumbnail a").removeClass("selected");
$(".galleryThumbnail a").children().css("opacity","1");
$(this).addClass("selected");
$(this).children().css("opacity",".4");
//setup thumbnails
var photoCaption = $(this).attr('title');
var photofullsize =$(this).attr('href');
$(".galleryPreview").fadeOut(500, function(){
$(".gallery_preload_area").html("")
// this is what is going to happen after the fadeout
$(".galleryPreview").html("<a href='"+ photofullsize +"' style=' background-image:url("+photofullsize+");'></a>");
$(".galleryCaption").html("<p><a href='"+photofullsize+"' title='Click to view large'>View Large</a></p><p></p>")
$(".galleryPreview").fadeIn(500);
});
});
});