我在5秒钟间隔内向php脚本调用jquery ajax请求,该脚本生成并返回html表。然后,我将返回的表格放到网页上的div中。用户然后单击网页上的表行(此表是从ajax请求获得的),我想淡出该行。
这该怎么做?
// put data to prepared div obtained from ajax request
var divid="#tabloidOutput";
function refreshdiv() {
var jqxhr = $.ajax({
url: "data/output.php",
cache: false
})
.done(function(msg) {
// msg contains <table>...</table>
$(divid).html(msg);
setTimeout('refreshdiv()', seconds * 1000);
})
}
//webpage structure
<body>
<div id="tabloidOutput"></div>
</body>
// row fading out
$( "tr" ).click(function() {
$(this).fadeOut( "slow" );
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句