Executing all JavaScript code before repainting a browser window -


i'd resize & move browser window using javascript. resizeto() , moveto() seem friends here:

window.resizeto(x,y); window.moveto(x,y); 

this works, visually, it's bit clunky. first, window moved desired location , window gets repainted on display. finally, window resized desired dimensions , gets repainted on display once more. happens within couple hundred milliseconds 2 discrete step noticeable , looks awkward.

what want these 2 methods atomic, such both return before browser window (ui , all,) gets repainted on display. can more cohesive presentation of window repositioning , resizing achieved using javascript?

use settimeout trick allow ui "catch-up".

window.settimeout(function() {window.resizeto(x,y)},0); window.settimeout(function() {window.moveto(x,y)},0); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -