Jquery-Ajax弹出窗口
我有一张桌子Jquery-Ajax弹出窗口,jquery,Jquery,我有一张桌子 Userid username 3 Carlione Raymond viewmore 2 Rich Ronalds viewmore 6 Stephen viewmore 当用户单击viewmore时,将打开该特定用户ID的弹出窗口 任何人都可以在jquery/ajax中向我推荐这一点。我会很高兴,如果你们提到任何链接,以便我可以学习你们的支持 PHP代码 $sql = mysql_query('SELEC
Userid username
3 Carlione Raymond viewmore
2 Rich Ronalds viewmore
6 Stephen viewmore
当用户单击viewmore时,将打开该特定用户ID的弹出窗口
任何人都可以在jquery/ajax中向我推荐这一点。我会很高兴,如果你们提到任何链接,以便我可以学习你们的支持
PHP代码
$sql = mysql_query('SELECT * FROM user');
echo '<table>
<tr>
<th>Userid</th>
<th>Username</th>
</tr>
foreach($sql as $s)
{
$thisuser = $s->userid;
$username = $s->username;
echo '<tr><td>'.$thisuser.'</td>
<td>'.username.'</td>
<td><a class="osx" href="#">Viewmore</a>
<div id="osx-modal-content">
echo $thisuser;
</div>
</td></tr>';
}
echo '</table>';
css如果您想在弹出窗口中显示详细信息,我认为您不需要ajax。你在后台使用什么技术???这是上面更新的代码,但一切都很好,但弹出显示用户的公共用户ID,我需要一个特定用户的弹出信息
jQuery(function ($) {
var OSX = {
container: null,
init: function () {
$("input.osx, a.osx").click(function (e) {
e.preventDefault();
$("#osx-modal-content").modal({
overlayId: 'osx-overlay',
containerId: 'osx-container',
closeHTML: null,
minHeight: 80,
opacity: 65,
position: ['0',],
overlayClose: true,
onOpen: OSX.open,
onClose: OSX.close
});
});
},
open: function (d) {
var self = this;
self.container = d.container[0];
d.overlay.fadeIn('slow', function () {
$("#osx-modal-content", self.container).show();
var title = $("#osx-modal-title", self.container);
title.show();
d.container.slideDown('slow', function () {
setTimeout(function () {
var h = $("#osx-modal-data", self.container).height()
+ title.height()
+ 20; // padding
d.container.animate(
{height: h},
200,
function () {
$("div.close", self.container).show();
$("#osx-modal-data", self.container).show();
}
);
}, 300);
});
})
},
close: function (d) {
var self = this; // this = SimpleModal object
d.container.animate(
{top:"-" + (d.container.height() + 20)},
500,
function () {
self.close(); // or $.modal.close();
}
);
}
};
OSX.init();
});