因此,基本上,我试图在单击特定图像后显示引导模式。然后,我尝试在段落标记中显示一些文本和图像,该标记将每600毫秒更改一次,如下所示:
Playing -> Playing. -> Playing.. -> Playing...
一旦
text
变成
'Playing...'
,它将作为
'Playing'
,一次又一次,直到莫代尔
display
类变为
none
.
我是在一个
setTimeOut
函数,因为我需要等待Bootstrap Modal首先加载,以测试其类。
虽然,我的代码每次都会使浏览器崩溃,因此,我无法查看开发人员工具来找出问题。
$(".tutorial").click(function () {
$('#tutorialModal').modal('show');
$(this).toggleClass('playingGif'); //display 'playing' background image
$(this).toggleClass('tutorial'); //turn off regular background image
setTimeout(function () {
while ($('#tutorialModal').css('display') == 'block') {
var text = 'Playing';
$('p', this)
.delay(600)
.queue(function (n) {
$(this).html(text);
n();
});
if (text == 'Playing...') {
text = 'Playing';
} else {
text += '.';
}
}
}, 500);
});