/* ######################################################################################################## * Modifiziertes Skript by Reber IT - 2013 * ######################################################################################################## * ORIGINAL-SKRIPT: * Image preview script * powered by jQuery (http://www.jquery.com) * * written by Alen Grakalic (http://cssglobe.com) * * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery * ######################################################################################################## */ //Hilfsvariablen var mouseOnThumb = 0; var mouseOnZoom = 0; var ivFlag = ""; var iiFlag = ""; this.imagePreview_lbFx_zoom = function(){ var xOffset = ; //Std: 10 var yOffset = ; //Std: 30 bind2item = ""; //mouse | img showTitel = false; fit2screen = false; fx = ""; fxtime = ; onklick = ""; //# Funktion zum Bild-Einblenden $("a.ritLightBox_zoom").bind("mouseenter", function(e){ $(this).addClass("gotIt"); var baseObject = this; var textLoader = false; setTimeout(function() { baseObject.t = baseObject.title; baseObject.title = ""; if ($(baseObject).hasClass("gotIt")) { if ($(baseObject).hasClass("rit_tlbz")) { var picPageX = parseInt($(baseObject).offset().left); var picPageY = parseInt($(baseObject).offset().top); var picHeight = parseInt($(baseObject).height()); var picWidth = parseInt($(baseObject).width()); textLoader = true; } else { var picPageX = parseInt($(baseObject).find("img").offset().left); var picPageY = parseInt($(baseObject).find("img").offset().top); var picHeight = parseInt($(baseObject).find("img").height()); var picWidth = parseInt($(baseObject).find("img").width()); } removeZoomImage_force(); var c = (baseObject.t != "") ? "
" + baseObject.t : ""; if (showTitel==false) { c=""; } $("body").append("
Bildvorschau wird geladen.."+ c +"
"); $("img#img_fxZoom").load(function() { // ALLES IM READY-HANDLER verstauen var screenW = parseInt($("body").width() + $(document).scrollLeft() ); var screenH = parseInt($("body").height() + $(document).scrollTop() ); var actualPos_top = picPageY; var actualPos_left = picPageX; var zoomPicW = parseInt($("div#ritLightBox_zoom_box").width()); var zoomPicH = parseInt($("div#ritLightBox_zoom_box").height()); var cssPaddingY = parseInt($("div#ritLightBox_zoom_box").css("padding-top")) + parseInt($("div#ritLightBox_zoom_box").css("padding-bottom")); var cssPaddingX = parseInt($("div#ritLightBox_zoom_box").css("padding-left")) + parseInt($("div#ritLightBox_zoom_box").css("padding-right")); var cssBorderC = parseInt($("#ritLightBox_zoom_box").css("border-left-width")) + parseInt($("#ritLightBox_zoom_box").css("border-right-width")); alignX =0; alignY = 0; space_right = screenW - (actualPos_left) // Pixel nach rechts (Standard) space_left = actualPos_left // Platz nach links space_top = actualPos_top // Platz nach oben space_btm = screenH - (actualPos_top) // Platz nach oben var freeSpaceX = space_right var freeSpaceY = space_btm if ((space_right < zoomPicW) && (space_left > space_right)) { alignX = 1; freeSpaceX = space_left; } if ((space_btm < zoomPicH) && (space_top > space_btm)) { alignY = 1; freeSpaceY = space_top; } //alert("alignX: " + alignX + " | alignY: " + alignY); $("div#ritLightBox_zoom_box").css("width", zoomPicW + "px"); $("div#ritLightBox_zoom_box").css("height", zoomPicH + "px"); var workSetX=0; var workSetY=0; var startEdge="" if ((alignY==0) && (alignX==0)) { workSetX=-1 * xOffset; workSetY=-1 * yOffset; startEdge="leftTop"; } // von links oben (Std) | x+ | y- | if ((alignY==0) && (alignX==1)) { workSetX=(-1 * xOffset)+(cssPaddingX+cssBorderC); workSetY=-1 * yOffset; startEdge="rightTop"; } // von rechts oben | x- | y- | if ((alignX==0) && (alignY==1)) { workSetX=(-1 * xOffset); workSetY=-1*(yOffset)+(cssPaddingY+cssBorderC); startEdge="leftBottom"; } // von links unten | x+ | y+ | if ((alignX==1) && (alignY==1)) { workSetX=-1 * (xOffset-(cssPaddingX+cssBorderC)); workSetY=-1*(yOffset-(cssPaddingY+cssBorderC)); startEdge="rightBottom"; } // von rechts unten | x- | y+ | var myOffsetX=workSetX; var myOffsetY=workSetY; var myOffsetX2=workSetX; var myOffsetY2=workSetY; if (alignX==1) { myOffsetX = -1 * (workSetX + zoomPicW); } if (alignY==1) { myOffsetY = -1 * (workSetY + zoomPicH); } if ((alignY==0) && (alignX==0)) { myOffsetX2=workSetX; myOffsetY2=workSetY; startEdge2="leftTop"; } // von links oben (Std) | x+ | y- | if ((alignY==0) && (alignX==1)) { myOffsetX2=myOffsetX + picWidth + cssBorderC; myOffsetY2=myOffsetY; startEdge2="rightTop"; } // von rechts oben | x- | y- | if ((alignX==0) && (alignY==1)) { myOffsetX2=workSetX; myOffsetY2=myOffsetY + picHeight; startEdge2="leftBottom"; } // von links unten | x+ | y+ | if ((alignX==1) && (alignY==1)) { myOffsetX2=myOffsetX + picWidth + cssBorderC; myOffsetY2=myOffsetY + picHeight; startEdge2="rightBottom"; } // von rechts unten | x- | y+ | var ll_top = e.pageY + myOffsetY; var ll_left = e.pageX + myOffsetX; var ll_topM = picPageY + myOffsetY2; var ll_leftM= picPageX + myOffsetX2; // Item-Bindungen $("#ritLightBox_zoom_box") .css("top",(ll_topM) + "px") .css("left",(ll_leftM) + "px") .bind("mouseleave", function (e) { mouseOnZoom=0; removeZoomImage(); } ) .bind("mouseenter", function (e) { mouseOnZoom=1; removeZoomImage_cancel(); } ); // Einblend-Effekt $("#ritLightBox_zoom_box").slideDown(fxtime, function() { $("div#waitLoader").remove(); }); }); // READY-Handler ENDE } //Focus-IF ENDE },); }); $("a.ritLightBox_zoom").mouseleave(function(e){ $(this).removeClass("gotIt"); }); // Hilfsfunktion für Titelanzeige (Tooltip) // function(){ // if (showTitel==true) {this.title = this.t; } // //alert("out"); // }); } // Weitere Hilfsfunktionen // *********************** function removeZoomImage_off() { //kleine Verzögerung beim Ausblenden //ivFlag=window.setTimeout("removeZoomImage_now()", 200); } function removeZoomImage_cancel() { //Abbruch der Verzögerung //window.clearTimeout(ivFlag); } function removeZoomImage() { // Entfernen wenn freigegeben if ((mouseOnZoom==0) && (mouseOnThumb==0)) { removeZoomImage_force(); } } function removeZoomImage_force() { // Entfernen wenn freigegeben var rmvItem=$("#ritLightBox_zoom_box"); rmvItem.remove(); } Number.random = function(min,max){ return Math.floor(Math.random()*(max-min+1)+min); }; // Skript laden $(document).ready(function(){ imagePreview_lbFx_zoom(); });