function setLineDelay(delay, str) {
var lines = str.split('_');
$.each(lines, function(index, h) {
var div = $('<div class=\'question_item\'/>').html(h);
div.hide().appendTo('#question_wrapper').delay(index * delay);
setTimeout(function() {
div.fadeIn();
}, index * delay);
});
}
setLineDelay(500,"I am a:" + "<h1>" + " _ J_avascript<h1> _ E_mulated<br /> _ S_erialized<br /> _ I_ntelligence\n _ created by Matt._ <br /> But, you can call me Jesi for short._ <br /> And your name is?...");
我什么都试过了。我试过:
<h1>, <br>, <br />, \n
我试图在函数中换行,但它总是忽略“换行函数”,例如,\n。
示例网站:http://lyndoncis.com/CIS3120SP16/mts01060/
非常感谢任何帮助,谢谢!
最佳答案
我不知道这是不是一回事,但您缺少标签上的结束标签。应该吗?
"<h1>" + " _ J_avascript</h1>...
可能会导致问题
关于javascript - 在此函数中设置一个新行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35261887/