Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
177
rated 0 times [  182] [ 5]  / answers: 1 / hits: 37642  / 13 Years ago, tue, october 4, 2011, 12:00:00

I will create 5 buttons.
Example:



Button1's value : 640*480
Button2's value : 1024*600
Button3's value : 1600*900
Button4's value : 800*600


If the user clicks a button, I want it to change the browser window's size. I would like to do this via JQuery but JavaScript is fine too.



EDIT:



And how can i change windows' position for computer's screen.
Third question :) how can i create random number?


More From » jquery

 Answers
122

window.resizeTo() and window.moveTo()



function changeSize( w, h){    
window.resizeTo(w,h);
}
function movePosition( x, y){
window.moveTo(x,y);
}


Modern day browsers have settings that can prevent you have changing/moving/resizing the browser window.



[EDIT] Get yourself a good JavaScript reference. Math.random


[#89799] Sunday, October 2, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rianna

Total Points: 67
Total Questions: 113
Total Answers: 113

Location: French Polynesia
Member since Tue, Jul 7, 2020
4 Years ago
;