我從數據庫拉我的圖像,以顯示它在我的網頁上,但它不會顯示。要確認圖像正在從數據庫中調用,我將標題上的圖像名稱輸出到當您將鼠標放在不可見的圖像上時,您可以看到圖像名稱,但圖像本身完全不顯示。該網站是這樣的: 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);
});
});
});
我剛剛檢查它是在服務器 – 2012-08-11 18:21:39
只是爲了證實這一點。我的本地服務器發生同樣的問題。 – 2012-08-11 18:25:47
它返回404 - 未找到。仔細檢查路徑。你的第一步是獲得我發佈的鏈接返回圖像。然後您可以開始排查您的代碼。 – FJT 2012-08-11 18:26:31