Chrome 확장 기능과 유사한 툴팁을 확인하십시오. 그러나 URL에 축소판 그림 및 전체 크기 이미지를 제공해야합니다. 다음은 원래 blog post입니다.
스크립트를 수정하여 커서와 오른쪽 브라우저 가장자리 사이의 거리에 맞게 이미지 크기를 조정하십시오. 완벽하지는 않지만 작동합니다. 여기에 demo이 있습니다. mouseover에
/*
* 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
*
*/
this.imagePreview = function(){
/* CONFIG */
xOffset = 10;
yOffset = 20;
// these 2 variable determine popup's distance from the cursor
// you might want to adjust to get the right result
/* END CONFIG */
$('a.preview').hover(function(e){
this.t = this.title;
this.title = '';
var p, c = (this.t != '') ? '<br/>' + this.t : '';
$('body').append('<p id="preview"><img src="' + this.href + '" alt="Image preview" />' + c + '</p>');
// load image and get size
p = $('#preview');
p
.fadeIn('fast')
.find('img').load(function(){
// get image dimensions after it has been loaded
p.data('widths', [ $(window).width(), p.find('img').width() ]);
// set image to 100% to fit in preview window
$(this).width('100%');
position(e);
});
},
function(){
this.title = this.t;
$('#preview').remove();
});
$('a.preview').mousemove(function(e){
position(e);
});
var position = function(e){
var w, prevw = $('#preview'),
w = $.data(prevw[0], 'widths');
if (w) {
prevw
.css('top', e.pageY + yOffset)
.css('left', e.pageX + xOffset)
.css('max-width', (e.pageX + prevw.outerWidth() > w[0]) ? w[0] - e.pageX - xOffset : w[1] || 'auto');
}
};
};
// starting the script on page load
$(document).ready(function(){
imagePreview();
});
에서 Kabbar 이미지 Zoomer에보기 ?? 그렇다면 코드를 공유하십시오 – Abhimanyu
샘플 문제는 여기에 있습니다. Javascript/Jquery보다는 CSS 트릭이 될 수도 있지만 여전히 어떻게 해야할지 모르겠다. – prince