我有这个:
$("#OpenMap").click(function(){
$.ajax({
type: "GET",
url: "_Ajax.AdQuestions.php",
data: "OpenMapID=<?php echo $_SESSION[SESSION_ADS_ID]; ?>",
success: function(data){ $("#OpenMap").html(data); }
});
});
所以现在地图会显示在<div id="">#OpenMap</div>
我怎么能意识到我的地图将在fancybox中打开它?
例如。像这样?
$("#OpenMap").click(function(){
$.ajax({
type: "GET",
url: "_Ajax.AdQuestions.php",
data: "OpenMapID=<?php echo $_SESSION[SESSION_ADS_ID]; ?>",
success: function(data){ $(".fancybox").fancybox(data); }
});
});
答案 0 :(得分:1)
尝试
$("#OpenMap").click(function(){
$.ajax({
type: "GET",
url: "_Ajax.AdQuestions.php",
data: "OpenMapID=<?php echo $_SESSION[SESSION_ADS_ID]; ?>",
success: function(data){
$.fancybox(data,{
// fancybox API options here
});
}
});
});
假设你的html中有某个地方
<a id="OpenMap" href="javascript:;">open map</a>