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?
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
In addition to epascarello's answer.
var randomnumber=Math.floor(Math.random()*11)
That's the code for a random number between 0 and 10. Change 11 to whatever you want for an increased/decreased range.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With