如何顺利替换jgrowl框中的文本?
我正在 jgrowl 消息框中设置文本。 这是一个例子:
function findID(whichID, command){
if($(whichID).length)
{
var url='<script>\n\
$("'+whichID+'").fadeOut().load("include/common.php?q='+command+'&p='+username+'", function(response, status, xhr) { $(this).fadeIn(); });<\/script>';
$(whichID).fadeOut().html(url).fadeIn();
}
}
var myID0="myID0";
var data='<div id="'+myID0+'" class="arm-info"></div>';
$('#rightcolumn').jGrowl(data, {sticky:true });
mytimerID0=window.setInterval(findID, 3000, '#'+myID0, "show_queue");
它可以工作,但替换后确实很不稳定。
如何在两次加载调用之间平滑过渡?
谢谢阿曼。
I am setting the text inside the jgrowl message box.
Here is the example:
function findID(whichID, command){
if($(whichID).length)
{
var url='<script>\n\
$("'+whichID+'").fadeOut().load("include/common.php?q='+command+'&p='+username+'", function(response, status, xhr) { $(this).fadeIn(); });<\/script>';
$(whichID).fadeOut().html(url).fadeIn();
}
}
var myID0="myID0";
var data='<div id="'+myID0+'" class="arm-info"></div>';
$('#rightcolumn').jGrowl(data, {sticky:true });
mytimerID0=window.setInterval(findID, 3000, '#'+myID0, "show_queue");
It works but the replacement is really jerky.
How to make a smooth transition between two load calls?
Thanks Arman.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许在淡出完成后替换 html,然后再次淡入。
如果你这样做,
它会在 html 开始淡出的同时替换它。
编辑:
你不能直接写在findID函数中吗?我认为你不需要脚本标签:
maybe replace the html after the fadout is complete, then fadeIn again.
if you do
it'll replace the html the same time it starts fading out.
edit:
couldn't you just write in the findID function? I don't think you need the script tag: