var arr = [];$("document").ready(function(){ function form1_submit() { // $(".fancybox-overlay-fixed").css("display", "block"); // var top = Math.max(Math.max(document.documentElement.clientHeight, window.innerHeight || 0) / 2 - 140, 0); // var left = Math.max(Math.max(document.documentElement.clientWidth, window.innerWidth || 0) / 2 - 140, 0); // $(".fancybox-desktop").css("top", top +"px"); // $(".fancybox-desktop").css("left", left +"px"); $.fancybox.showLoading(); $("#form1").submit(); } var new_width = $("#searchfilter").width(); function addSomeImages(limit) { for (var i = 0; i < limit; i++) { var imgIdx = i; $("#mygallery").append('
/leinwand/searchpreview/' + arr[imgIdx].src + '.jpg
' + arr[imgIdx].src+ ' - ' + arr[imgIdx].desc + '
'); } for (var z = 0; z < limit; z++) { arr.shift(); } $("#mygallery").justifiedGallery('norewind'); } $("#mygallery").justifiedGallery({ selector: 'figure, div:not(.spinner)', rowHeight : 160, maxRowHeight: false, lastRow: 'nojustify', waitThumbnailsLoad: true, margins: 20, border: 0, imagesAnimationDuration: 100 }); /* $("#mygallery").justifiedGallery({ selector: 'figure, div:not(.spinner)', rowHeight : 160, maxRowHeight: false, // randomize: true, lastRow: 'nojustify', waitThumbnailsLoad: true, margins: 20, border: 0, imagesAnimationDuration: 100 }); */ var anzahl_limit = 60; var arr_count = arr.length; // alert(arr_count); if(arr_count < anzahl_limit) { anzahl_limit = arr_count; } addSomeImages(anzahl_limit); $("#load_more").click(function(){ var anzahl_limit = 60; var arr_count = arr.length; if(arr_count < anzahl_limit) { anzahl_limit = arr_count; } if(anzahl_limit > 0) { var limit_endless_scroll_2 = 180+parseInt($("#endless_scroll").val()); $("#endless_scroll").val(limit_endless_scroll_2); addSomeImages(anzahl_limit); } else { $("#load_more").css("display", "none") } }); $(window).scroll(function() { if($(window).scrollTop() >= Math.floor($(document).height() - 1500)) { var anzahl_limit = 60; var arr_count = arr.length; if(arr_count < anzahl_limit) { anzahl_limit = arr_count; } var anzahla = $(".search_img_class").length; var limit_endless_scroll = $("#endless_scroll").val(); if(anzahl_limit > 0 && (anzahla <= limit_endless_scroll)) { addSomeImages(anzahl_limit); } if(anzahl_limit <= 0) { $("#load_more").css("display", "none") } } var new_height = $("header").height(); if ($(window).scrollTop() > new_height) { $("#searchfilter").css("position", "fixed"); $("#searchfilter").css("width", new_width); $("#searchfilter").css("max-width", new_width); $("#searchfilter").css("top", "5px"); $(".navi_beginn").css("top", "5px"); $(".navi_beginn").css("position", "fixed"); } else { $("#searchfilter").css("position", "relative"); $("#searchfilter").css("top", "-22px"); $("#searchfilter").css("width", ""); $("#searchfilter").css("max-width", ""); $(".navi_beginn").css("top", ""); $(".navi_beginn").css("position", ""); } }); $("#del_sort").click(function(){ $("input[name=\"sort\"]").prop("checked", false); $("input[name=\"sort\"]#search").prop("checked", true); $("#del_sort").parent().parent().children( "ul" ).css("display", "none"); $("#del_sort").parent().css("cssText","color: #7d7d7d !important;background: #ebebeb !important;font-weight: bold;padding: 5px 5px 5px 8px;font-size: small;"); form1_submit(); }); $("#del_genre").click(function(){ $("input[name=\"genre\"]").prop("checked", false); $("input[name=\"genre\"]#all").prop("checked", true); $("#del_genre").parent().parent().children( "ul" ).css("display", "none"); $("#del_genre").parent().css("cssText","color: #7d7d7d !important;background: #ebebeb !important;font-weight: bold;padding: 5px 5px 5px 8px;font-size: small;"); form1_submit(); }); $("#del_color").click(function(){ $("input[name=\"colorhsb[]\"]").prop("checked", false); // $("input[name=\"colorhsb[]\"]#format0").prop("checked", true); // $("#del_format").parent().parent().children( "ul" ).css("display", "none"); // $("#del_format").parent().css("cssText","color: #7d7d7d !important;background: #ebebeb !important;font-weight: bold;padding: 5px 5px 5px 8px;font-size: small;"); form1_submit(); }); $("#del_format").click(function(){ $("input[name=\"format\"]").prop("checked", false); $("input[name=\"format\"]#format0").prop("checked", true); $("#del_format").parent().parent().children( "ul" ).css("display", "none"); $("#del_format").parent().css("cssText","color: #7d7d7d !important;background: #ebebeb !important;font-weight: bold;padding: 5px 5px 5px 8px;font-size: small;"); form1_submit(); }); $("#del_resolution").click(function(){ $("input[name=\"resolution\"]").prop("checked", false); $("input[name=\"resolution\"]#resolution0").prop("checked", true); $("#del_resolution").parent().parent().children( "ul" ).css("display", "none"); $("#del_resolution").parent().css("cssText","color: #7d7d7d !important;background: #ebebeb !important;font-weight: bold;padding: 5px 5px 5px 8px;font-size: small;"); form1_submit(); }); $("#option_filter_on").click(function(){ $("#option_filter").fadeToggle(); }); }); $(".chzn-select_new").chosen({ create_option: true, persistent_create_option: true, create_option_text: "add", width: "100%", allow_single_deselect: true }); $("select#bildformate_new").multipleSelect({ isOpen: true, multipleType: true, keepOpen: true, width: 160, placeholder: "", selectAll: false }); $("#wert_box input:radio").radiocharm(); $("#Suchwort_exact input:radio").radiocharm(); $(".various_search_save").click(function(){ var savecount = $("#save_count").html(); new_savecount = parseInt(savecount)+1; $("#save_count").html(new_savecount); $(".various_search").removeAttr("disabled"); }); $(".various_search_image_info").fancybox({ aspectRatio: true, autoResize: true, autoCenter: true, // autoSize: true, // scrolling: "no", // width : "95%", // height : "70%", // fitToView : false, // maxWidth : "60%", // maxHeight : "95%", // closeClick : false, // openEffect : "none", // closeEffect : "none", padding : 0, // margin : 0 afterLoad: function() { setTimeout( function() { var fancy_height = $("#img1").height(); var fancy_width = $("#img1").width(); var table_height = $("#div1").height(); // alert(fancy_height + " -- " + table_height); if(fancy_height > fancy_width) { new_margin_top = ((fancy_height - table_height) / 2); if(new_margin_top > 0) { $("#div1").css("margin-top", new_margin_top); } } $.fancybox.update(); },1000); } }); $(".various_search_save").fancybox({ fitToView : true, maxWidth : "90%", maxHeight : "70%", autoSize : true, closeClick : false, openEffect : "none", closeEffect : "none", afterLoad: function(){ setTimeout( function() {$.fancybox.close(); },1000); // 3000 = 3 secs } });