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

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -