function fnSetSliders() { iH = ((window.innerHeight * 100) / 100); $('.carousel .item').css('height', iH); $('.slider-container').css('height', iH); } function fnSetEyes() { $oLeft = $('.eye-left'); $oRight = $('.eye-right'); iW = ((window.innerWidth * 15) / 100); iTop = $(this).scrollTop(); iLeft = iW - (iTop); iRight = iW - (iTop); $oLeft.css('left', iLeft+'px'); $oRight.css('right', iRight+'px'); iSize = ((window.innerWidth * 30) / 100); $oLeft.css('width', iSize); $oLeft.css('height', iSize); $oRight.css('width', iSize); $oRight.css('height', iSize); }; $(document).ready(function() { //iMargin = (($(window).height() * 90) / 100); //iMargin = $(window).height(); //$('.slider-container').css('height', iMargin); iT = (($('.slider-container').height() * 50) /100) $('.slide-title').css('top', iT); $.supersized({ slide_interval: 10000, transition_speed: 1500, random: 1, slides : [ {image : '/data/banners/1.jpg', title: 'ZibiClinic', description: 'Z pasji do off-roadu' },{image : '/data/banners/2.jpg', title: 'ZibiAdventure', description: 'Z pasji do off-roadu' }, ] }); $('#prevslide').click(function(){ api.prevSlide(); }); $('#nextslide').click(function(){ api.nextSlide(); }); fnSetSliders(); fnSetEyes(); $('.eye').on('click', function(){ iScroll = $('#' + $(this).data('id')).offset().top - 90; $('html, body').animate({ scrollTop: iScroll }, 750); }); theme = { _init : function(){ var sTitle = api.getField('title'); var sDescr = api.getField('description'); $('#slide-title').html(sTitle); $('#slide-description').html(sDescr); }, afterAnimation:function(){ var sTitle = api.getField('title'); var sDescr = api.getField('description'); $('#slide-title').html(sTitle); $('#slide-description').html(sDescr); } }; }); $( window ).resize(function() { fnSetSliders(); fnSetEyes(); }); $(document).scroll(function () { fnSetEyes(); });