var przesun = 0; /* $(window).load(function(){ $('.contentGaleria img').lazyload({ threshold: 200, effect: 'fadeIn' }); $('.contentCategory img').lazyload({ threshold: 200, effect: 'fadeIn' }); }); */ var tabScale = {}; tabScale[7] = [1100,960,850,750,500,400,350,300]; tabScale[6] = [960,850,750,500,400,350,300]; tabScale[5] = [850,750,500,400,350,300]; tabScale[4] = [750,500,400,350,300]; tabScale[3] = [500,400,350,300]; tabScale[2] = [400,350,300]; $(function() { $( ".contentGaleria a" ).mouseout(function(event) { var opis = $(this).find('.opisDiv'); $(opis).css('display','none'); przesun = 0; }).mousemove(function(event) { var opis = $(this).find('.opisDiv'); if(typeof $(opis)[0] != 'undefined'){ if($(document).width()>768) showDivOpis(opis,event,this); } }); }); function showDivOpis(opis,event,el){ if(przesun == 0){ createDivOpis(opis,event,el); przesun = 1; } else{ ustawDivOpis(opis,event,el); } } function createDivOpis(opis,event,el){ var img = $(el).find('img'); imgW = $(img).width(); $(img).attr('title',''); $(img).attr('alt',''); $(opis).css('width',imgW); $(opis).css('display','block'); ustawDivOpis(opis,event,el); } function ustawDivOpis(divInfo,event,el){ var posX = event.pageX; var posY = event.pageY; var pElem = $(el).offset(); //var heightWin = $(window).scrollTop()+$(window).height(); //var widthWin = $(window).scrollLeft()+$(window).width(); var heightWin = ($(el).parent().parent().parent().parent()).outerHeight(); var widthWin = ($(el).parent().parent().parent().parent()).outerWidth(); $(divInfo).css('left',parseInt(0)); $(divInfo).css('top',parseInt(0)); if((posX+$(divInfo).outerWidth()) > widthWin){ $(divInfo).css('left',parseInt((posX)+3-$(divInfo).outerWidth()-pElem.left)); } else{ $(divInfo).css('left',parseInt(posX)+3-pElem.left); } if((posY+$(divInfo).outerHeight()) > heightWin){ $(divInfo).css('top',parseInt((posY)-10-$(divInfo).outerHeight()-pElem.top)); } else{ $(divInfo).css('top',parseInt(posY)+10-pElem.top); } } /* $(window).load(function(){ //console.log($('.gallery2').find('li').eq(2).outerHeight(true)); //$('.contentGaleria').find('.bottomTitle').css('visibility','visible'); $('.contentGaleria').each(function(){ var el = this; if(!$(this).hasClass('noParse')){ //var maxLi = Math.max.apply( null, // $(el).find('li').map(function(){ return $(this).height(); }).get() ); //$(el).find('li').css('height',maxLi); $(el).find('li img').css('height',''); } }); */ /* $('.contentCategory').each(function(){ var el = this; if(!$(this).hasClass('noParse')){ var maxLi = Math.max.apply( null, $(el).find('li').map(function(){ return $(this).height(); }).get() ); $(el).find('li').css('height',maxLi); $(el).find('li img').css('height',''); } }); */ //}); var przesun = 0; var imgW = 200; var imgH = 200; $(function() { $( ".imgZoom a" ).mouseout(function(event) { //if(event.target.tagName.toLowerCase() == 'a') return false; $('.divInfo').remove(); przesun = 0; }).mousemove(function(event) { var img = $(this).find('img'); var imgSrc = $(img).attr('src'); $(img).attr('title',''); $(img).attr('alt',''); imgW = parseInt($(img).width())+100; imgH = parseInt($(img).height())+100; //xp50 var reg = new RegExp('\/image[0-9]+x[0-9]+(xs[0-5])?(xp[0-9]+)?\/'); var nReq = reg.exec(imgSrc); var newSrc = imgSrc.replace(nReq[0],'/image'+imgW+'x'+imgH+'xs5/'); if($(document).width()>768) showDivInfo(newSrc,event,this); }); }); function showDivInfo(newSrc,event,el){ if(przesun == 0){ createDivInfo(newSrc,event,el); przesun = 1; } else{ ustawDivInfo(event); } } function createDivInfo(newSrc,event,el){ var divInfo = $('
'); divInfo.addClass('divInfo'); $(divInfo).css('top',event.pageY); $(divInfo).css('left',event.pageX); var imgDiv = $(''); $(imgDiv).attr('src',newSrc); $(divInfo).append(imgDiv); $('body').append(divInfo); ustawDivInfo(event); } function ustawDivInfo(event){ var divInfo = $('.divInfo'); var posX = event.pageX; var posY = event.pageY; var heightWin = $(window).scrollTop()+$(window).height(); var widthWin = $(window).scrollLeft()+$(window).width(); if((posX+$(divInfo).outerWidth()) > widthWin){ $(divInfo).css('left',parseInt((posX)+3-$(divInfo).outerWidth())); } else{ $(divInfo).css('left',parseInt(posX)+3); } if((posY+$(divInfo).outerHeight()) > heightWin){ $(divInfo).css('top',parseInt((posY)-10-$(divInfo).outerHeight())); } else{ $(divInfo).css('top',parseInt(posY)+10); } } //function getViewport(){var a=null,b=null;if(window.innerWidth){a=window.innerWidth;b=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientWidth;b=document.documentElement.clientHeight}else{if(document.body){a=document.body.clientWidth;b=document.body.clientHeight}}}return{width:a,height:b}};