我需要帮助合并两个 jQuery ui 的可选(网格)和花式框(灯箱解决方案)。
现在这个花哨的盒子让一个 ajax 帖子变得非常简单(ahref="link to page"
)并显示它!问题是 jQuery ui 可选为我抓取数据并将其附加到页面,但我想用 ajax 将其发布到fancybox,以便在我的 php.ini 分析数据后弹出提示。
这是我到目前为止所拥有的
$x = array();
while($row = mysql_fetch_array($bq)){
$x[]= "
<li class=\"ui-widget-content\"
data-morph=\"".$row['morph']."\"
data-price=\"".$row['price']."\"
id=\"".$row['id']."\">
$ ".$row['price'].".00
".$row['morph']."
".$row['sex']."
</li>";
}
}
<p id="feedback">
<span>You've selected:</span> <span id="select-result">none</span>.
</p>
<ol><? echo "Total Snakes ($ts)"; if($ts != '0'){echo "<button class=\"ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all\">
<span class=\"ui-button-text\" href=\"?ready\">Buy</span>
</button>";} ?></ol>
<ol id="selectable">
<?php
shuffle($x);
foreach($x as $z){
echo $z;
}
?>
</ol>
<script>
$(function() {
$( "#selectable" ).selectable({
stop: function() {
var result = $( "#select-result" ).empty();
$( ".ui-selected").each(function() {
var id = $( this ).attr('id');
var morph = $(this).attr('data-morph');
var price = $(this).attr('data-price');
result.append( (id)+',' );
/// this gets displayed on the page but i want this data to be passed to fancy box ....
});
}
});
});
$('button span').fancybox({
// maybe somebody would kno how ?
});
</script>