I have simple image preview on hover.
jQuery
jQuery('img').hover( function(){ jQuery('body').append('<div id="image_preview"><img src="'+ jQuery(this).attr('src') +'" alt="Image preview" /></div>'); jQuery('.camera_info img').mousemove( function(event){ jQuery('#image_preview').css('top', (event.pageY - 10) + 'px').css('left', (event.pageX + 30) + 'px').fadeIn('normal'); } ); }, function(){ jQuery('#image_preview').remove(); } ); CSS:
#image_preview { border: 1px solid #CCCCCC; display: none; padding: 5px; position: absolute; } The problem is that if the image is too close to the side of the browser it shows after it like here: 
I tried to play with right position, but with no luck... Can someone help me on this problem?