Monkey Albino

Linux altar53.supremepanel53.com 4.18.0-553.8.1.lve.el8.x86_64 #1 SMP Thu Jul 4 16:24:39 UTC 2024 x86_64
/ home/ bdapparelinfo/ www/ slidbar/

//home/bdapparelinfo/www/slidbar/css_preview.js

this.preloadIm = function() {
	var img = new Array;
	$('a.preview').each(function() {
		/*
		imgP = new Image();
		imgP.src = $(this).attr("path");
		img[$(this).attr("iid")] = imgP;
*/
		img[$(this).attr("iid")] = $(this).attr("path");
	});
	return img;
};

this.imagePreview = function(img){	
		offX = 25;
		offY = 25;

	$("a.preview").hover(function(e){
		$("body").append("<div id='preview'><img id='pi' src='images/loadingAnimation.gif' alt='Image preview loading' /></div>");
		$('#pi').attr('src', img[$(this).attr("iid")]);
		//$("body").append("<p id='preview'><img src='"+ $(this).attr("path") +"' alt='Image preview loading' /></p>");
		var tpWd = $('#preview').width();
		var tpHt = $('#preview').height();
		var winWd = $(window).width()+$(window).scrollLeft();
		var winHt = $(window).height()+$(window).scrollTop();
		var _left;
		var _top;
		
		if ((e.pageX+offX+tpWd)>winWd) 
			 _left = e.pageX-(tpWd+offX)+"px";
		else  _left = e.pageX+offX+"px";
		if ((e.pageY+offY+tpHt)>winHt) 
			 _top = winHt-(tpHt+offY)+"px";
		else  _top = e.pageY+offY+"px";
		$("#preview")
			.css("top",_top)
			.css("left",_left)
			.fadeIn("fast");						
    },
	function(){
		$("#preview").remove();
    });	
	$("a.preview").mousemove(function(e){
		var tpWd = $('#preview').width();
		var tpHt = $('#preview').height();
		var winWd = $(window).width()+$(window).scrollLeft();
		var winHt = $(window).height()+$(window).scrollTop();
		var _left;
		var _top;
		if ((e.pageX+offX+tpWd)>winWd) 
			 _left = e.pageX-(tpWd+offX)+"px";
		else _left = e.pageX+offX+"px";
		if ((e.pageY+offY+tpHt)>winHt) 
			 _top = winHt-(tpHt+offY)+"px";
		else  _top = e.pageY+offY+"px";
		$("#preview")
			.css("top",_top)
			.css("left",_left);
	});
};

$(document).ready(function() {
	var img = preloadIm();
	imagePreview(img);
});