javascript - Image preview overflow the browser height -


using image preview plugin, need preview automatically goes when thumbnail way bottom of screen. tried code, doesn't work well.

if((e.pagex <= $(document).width()/2) && (e.pagey <= $(document).height()*0.75)) {     $("#preview")         .css("top",(e.pagey - xoffset) + "px")         .css("left",(e.pagex + yoffset) + "px"); } else if((e.pagex > $(document).width()/2) && (e.pagey <= $(document).height()*0.75)) {     $("#preview")         .css("top",(e.pagey - xoffset) + "px")         .css("right",($(document).width() - e.pagex + yoffset) + "px");          } else if((e.pagex <= $(document).width()/2) && (e.pagey > $(document).height()*0.75)) {         .css("bottom",($(window).height() - e.pagey + xoffset) + "px")         .css("left",(e.pagex + yoffset) + "px"); } else {     $("#preview")         .css("bottom",($(window).height() - e.pagey + xoffset) + "px")         .css("right",($(document).width() - e.pagex + yoffset) + "px");          } 


Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -