當我點擊一個圖像上,在下面的DIV代碼的工作,但不能沒有刷新頁面重複 - jQuery的
<img src='uploads/<? echo $dir; ?>/<? echo $file; ?>/<? echo $file1; ?>' width='100px' height='100px' style='margin-left:5px; margin-bottom:5px; border:#fff solid 2px;' id='<? echo $i; ?>' class="ind_img">
使用此jQuery代碼
$('.ind_img').bind('click',function(f){
var img_large = f.target.id;
var img_src = $('#'+img_large).attr('src');
var disp = '<div style="margin:0px;"><img src="'+img_src+'"></div>';
$('#display').html(disp);
});
在將圖像放大以下的div替換<? include('gallery.php'); ?>
與<div style="margin:0px;"><img src="'+img_src+'"></div>
(上面的代碼)
<div id="display" style="overflow-y:scroll; overflow-x:none height:598px;">
<? include('b.php'); ?>
</div>
但是,當我cli來在<div id=all>All</div>
<div style="margin:0px;"><img src="'+img_src+'"></div>
CK由
<? include('gallery.php'); ?>
<div id="display" style="overflow-y:scroll; overflow-x:none height:598px;">
<? include('b.php'); ?>
</div>
這是所有罰款代替,但我不能夠重複此步驟,而無需刷新該頁面,爲什麼呢?
感謝 讓
我們需要知道的(我認爲)是您正在使用的jQuery代碼以及生成的(x)html。如果你可以查看源代碼,然後粘貼(x)html的相關部分就可以了。一旦頁面位於客戶端的機器上,即使有的話,PHP也沒什麼作用。 – 2010-07-03 19:31:49