var fullpageActive = false;
$(window).resize(function() {
if ($(window).width() > 1100 && !fullpageActive) {
$('#fullpage').fullpage({
anchors: ['header', 'services-section', 'portfolio-section', 'blog-section', 'contact-section'],
menu: '#menu',
navigation: true,
navigationPosition: 'right',
navigationTooltips: [],
responsiveWidth: 1100,
scrollBar: true,
normalScrollElements: '.section-five, .section-three',
responsiveHeight: 769,
fitToSection: false,
});
fullpageActive = true;
} else if (fullpageActive) {
$.fn.fullpage.destroy('all');
fullpageActive = false
}
});
function hideTop() {
$(".top")
.css("left", "-300px")
.removeClass('openned');
}
function hideBasket() {
$(".basket")
.css("right", "-300px")
.removeClass('openned');
}
function attachMouseupEvent() {
var $document = $(document);
$document.on("mouseup.hideTop", function(evt) {
var $target = $(evt.target);
var $oppenedTop = $(".openned");
if ($oppenedTop.length > 0 && $target.closest($oppenedTop).length === 0) {
hideTop();
hideBasket();
$document.off("mouseup.hideTop");
}
});
}
jQuery(function($) {
attachMouseupEvent();
$(".top").on("click.showTop", function(evt) {
// some code...
attachMouseupEvent();
})
});
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);
});
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();
});
});