$(window).load(function(){
$(".dot-wrapper").trigger("update.dot");
});
$(document).ready(function(){
$("#goto").change(function(){
if ($(this).val()!='') {
window.location.href=$(this).val();
}
});
$(".fancybox").jqPhotoSwipe({
galleryOpen: function (gallery) {
//with `gallery` object you can access all methods and properties described here http://photoswipe.com/documentation/api.html
//console.log(gallery);
//console.log(gallery.currItem);
//console.log(gallery.getCurrentIndex());
//gallery.zoomTo(1, {x:gallery.viewportSize.x/2,y:gallery.viewportSize.y/2}, 500);
//gallery.toggleDesktopZoom();
}
});
$('.flexslider').flexslider({
animation: "fade",
autoplay: true,
slideshowSpeed: 5000,
animationSpeed: 2000,
initDelay: 1500,
randomize: false,
pauseOnAction: true,
pauseOnHover: true,
touch: true
});
$(".dot-wrapper").dotdotdot({
watch: "window"
});
$('input#od, input#do').pickadate(
{
selectMonths: true,
selectYears: true
}
);
/*jQuery.extend( jQuery.fn.pickatime.defaults, {
clear: 'vymazat'
});*/
/* $(".flip").flip({
trigger: 'hover',
axis: 'x'
});*/
// ošetřujeme lazy loading obrázků
$( 'article img').not('img.banner').not('img.setmeup').each(function( index ) {
var src = $( this ).attr('src');
//prepend '/' to the relative 'uc/' path if not already there
var subSrc = src.substring(0,3);
if(subSrc === 'uc/'){
var changedSrc = src.replace('uc/', '/uc/');
src = changedSrc;
}
$( this ).attr('data-original', src);
$( this ).attr('src', '/ui/images/transparent.gif');
$( this ).removeClass( 'lazyload' );
$( this ).addClass( 'lazyload' );
});
$( 'img.lazyload' ).lazyload({
/*effect : "fadeIn"*/
});
$('.slick-news').slick({
slidesToShow: 4,
slidesToScroll: 4,
infinite: false,
prevArrow: '',
nextArrow: '',
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: false,
prevArrow: '',
nextArrow: '',
}
},
{
breakpoint: 860,
/*settings: "unslick"*/
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: false,
prevArrow: '',
nextArrow: '',
}
},
{
breakpoint: 640,
/*settings: "unslick"*/
settings: {
slidesToShow: 2,
slidesToScroll: 2,
infinite: false,
prevArrow: '',
nextArrow: ''
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
infinite: false,
prevArrow: '',
nextArrow: ''
}
}
// You can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
});
$('.flipper-strip').slick({
slidesToShow: 4,
slidesToScroll: 4,
infinite: true,
prevArrow: '',
nextArrow: '',
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: true
}
},
{
breakpoint: 860,
/*settings: "unslick"*/
settings: {
prevArrow: '',
nextArrow: ''
}
},
{
breakpoint: 840,
/*settings: "unslick"*/
settings: {
slidesToShow: 2,
slidesToScroll: 2,
infinite: true,
prevArrow: '',
nextArrow: ''
}
},
{
breakpoint: 480,
/*settings: "unslick"*/
settings: {
slidesToShow: 1,
slidesToScroll: 1,
infinite: true,
prevArrow: '',
nextArrow: ''
}
}
// You can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
});
//flipperSlider.slick("slickSetOption", "prevArrow", '', true);
//flipperSlider.slick("slickSetOption", "nextArrow", '', true);
/*$("footer .ico").mouseenter(function () {
console.log('hover');
var currentImage = $('img', this).attr("src");
var hoverImage = currentImage.replace('.svg', '-over.svg');
$('img', this).data("orig", currentImage)
.attr("src", hoverImage);
}).mouseleave(function () {
var original = $('img', this).data("orig");
$('img', this).attr("src", original);
});*/
$("a.b-lupa").on('click', function(event){
//prevent the default action for the click event
event.preventDefault();
$("form#top-query-form").submit();
});
$("a.b-date-clear").on('click', function(event){
//prevent the default action for the click event
event.preventDefault();
$(this).parent().parent().children('input#od').val('');
$(this).parent().children('input#do').val('');
});
$("a.b-date-clear.query").on('click', function(event){
//prevent the default action for the click event
event.preventDefault();
$(this).parent().children('input#query').val('');
});
$("a.openMarker").on('click', function(event){
//prevent the default action for the click event
event.preventDefault();
var id = $(this).attr('data-id');
var aTag = $("a[name='gMap']");
$('html,body').animate({scrollTop: aTag.offset().top}, 'slow', function () {
if (id) {
//console.log('bound click');
openMarker(id);
}
});
});
// FILTRY
$(".filtry-bar-up").on('click', function(event){
$(".filtry-bar-up").addClass('hidden');
$(".filtry-bar-down").removeClass('hidden');
$(".box-filtry").slideDown('slow', function(){
//$(".filtry-buttons").show();
$(".filtry-bar-up").unbind('click', function(){
});
});
});
$(".filtry-bar-down").on('click', function(event){
//$(".filtry-buttons").hide();
$(".box-filtry").slideUp('slow', function(){
$(".filtry-bar-down").addClass('hidden');
$(".filtry-bar-up").removeClass('hidden');
});
});
});