fancybox как поменять контент
count=100;
displayProgress();
function displayProgress() {
$msg = 'Sorry need to wait ' + count + ' sec ';
$.fancybox({ type: 'inline', content: $msg });
count--;
if (count > 0) {
setTimeout(displayProgress, 1000);
} else {
$.fancybox({ type: 'inline', content: 'stop' });
}
}
счас fancybox мигает при перерисовке, как сделать без мигания? мне нужно показать в fancybox сколько осталось ждать |
fancybox смена контента
гуня,
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>demo</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.css">
<script type='text/javascript' src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.js"></script>
<script>
$(function() {
!function() {
var a = 100;
$.fancybox({
type: "inline",
afterLoad: function() {
this.content = "";
var b = $(".fancybox-inner");
!function c() {
var d = a ? "Sorry need to wait " + a + " sec " : "stop";
a--;
b.html(d);
0 <= a && setTimeout(c, 1E3)
}()
}
})
}()
});
</script>
</head>
<body>
</body>
</html>
|
| Часовой пояс GMT +3, время: 06:56. |