JavaScript
- 8 ответов
- 0 вопросов
6
Вклад в тег
function repeatWithInterval(callback, interval, repeatCount) {
repeatCount = repeatCount != null ? repeatCount : Infinity;
var count = 0;
var timer = setInterval(function() {
callback();
if(++count >= repeatCount) {
clearInterval(timer);
}
}, interval);
}
repeatWithInterval(function() { show_animate(2); }, 1100, 4);
$(function() {
$('.flipbook').turn({
width: 1000,
height: 349,
elevation: 50,
gradients: true,
autoCenter: true
});
$(".flipbook").on("turned", function() {
var $popovers = $('[data-toggle="popover"]');
$popovers.popover("destroy");
$popovers.popover();
});
});
function location() {
return new Promise(function(resolve, reject) {
navigator.geolocation.getCurrentPosition(resolve, reject);
});
}
location()
.then(function(position) {
console.log({
lat: position.coords.latitude,
lng: position.coords.longitude
});
})
.catch(function(error) {
console.log(error);
});