How to use jQuery to horizontally scroll all the way to the right on a narrow pop-up window -
i looking solution first open jquery browser window separate html file @ far right of screen within narrow new window, need scroll way far right.
what have working far script below opening of separate html file (which same site on, want present narrow section of it) @ far right of screen , width of 350px. looking accomplish horizontally scrolling contents of new windw way right. can find solutions horizontal scrolling in parent window not pop-up child window.
<html> <head> <title></title> <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.jsnewwindow').click(function() { // opens in new window far right, accounting multiple monitors window.open(this.href, "customwindow", "width=350, height=900, top=0, left=9000"); return false; }); }); </script> </head> <body> <a href="box.html" class="jsnewwindow">click me</a> </body> </html>
wrap instance of child dom in jquery element , call .scrollleft() on giving scrollleft int of pixels scroll (possibly 9000 given left attribute defined in question)
something like:
var popup = window.open(this.href, "customwindow", "width=350, height=900, top=0, left=9000"); $(popup.document).ready(function () { $(popup.document).scrollleft(9000); });
Comments
Post a Comment