我使用Wordpress顯示縮略圖列表,當使用AJAX單擊時將加載頁面。我使用的是隱藏div來存儲特定縮略圖的頁面名稱,就像這樣:使用jquery/javascript選擇單擊元素的內容
<div class="load_image">
<div class="image_path" style="display:none">portfolio-1</div>
<img src="..here is the thumbnail source" />
</div>
這裏是AJAX代碼:
var ajax_load = "<img src='img/load.gif' alt='loading...' />";
var loadUrl = "ajax/load.php";
$(".load_image").click(function(){
//Get the hidden-div-content from class image_path.....somehow
$("#ajax_result").html(ajax_load).load("<?php bloginfo('url') ?>/image_path");
});
我將如何去獲得的內容點擊隱藏的div,以便我可以將它傳遞給AJAX調用?