Easy A
Would you like to react to this message? Create an account in a few clicks or log in to continue.


 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

Share
 

 looking for a specific java script code

View previous topic View next topic Go down 
AuthorMessage
Error.
Member
Member
Error.

Posts : 2
Join date : 2011-07-05

looking for a specific java script code Empty
PostSubject: looking for a specific java script code   looking for a specific java script code EmptySat Dec 10, 2011 4:30 am

hello, i am looking a a specific javascript code for a school project. what the code does is it re-sizes your window to a specific size, and then makes it jump around to the four corners of your screen. a perfect example of this would be the rick roll site called
http://www.20b.org/rickroll.html
its best viewed in internet explorer, and will take effect after you allow it on the top pop up window. it seems that the latest version of firefox disables the window resizing and movement, so use IE. after examining the page source, i managed to find this code.

window.resizeTo(640,625);
window.moveTo(0,0);
for (i = 1; i <= 9; i++){
setTimeout('window.moveTo(1599,1199);', i+"000");
i++;
setTimeout('window.moveTo(0,1199);', i+"000");
i++;
setTimeout('window.moveTo(1599,0);', i+"000");
i++;
setTimeout('window.moveTo(0,0);', i+"000");
}

the code worked perfectly on the macs used at school. but however, when i took it home and tried it on my PC, which has a different sized monitor, it didnt work right. my copied code section seemed to jump off the edges of the screen, like it was using the size of a Macs monitor, yet the original website works fine. this led me to believe that the source code seems to find the size of the monitor and adjust the position of where it moves. i cant seem to find that part of the code. any help would be appreciated
Back to top Go down
Speak
Member
Member
Speak

Posts : 15
Join date : 2011-07-05

looking for a specific java script code Empty
PostSubject: Re: looking for a specific java script code   looking for a specific java script code EmptySat Dec 10, 2011 4:30 am

No, the source code is *ASSUMING* the size of the Mac monitor.

That's why all the moveTo() numbers are *HARD CODED*. They aren't calculated, at all.

window.resizeTo() doesn't work in MSIE 9 or Chrome. It does work on FF3.x.

I'm not sure there is a universal function that allows you to resize a window. You *could*, however, open a *new* window of a specified size in any browser.
Back to top Go down
Error.
Member
Member
Error.

Posts : 2
Join date : 2011-07-05

looking for a specific java script code Empty
PostSubject: Re: looking for a specific java script code   looking for a specific java script code EmptySat Dec 10, 2011 4:31 am

why is it then that when i wrote the code on a mac, by copying it directly from the source, it worked, and bringing it home made it not work properly, yet the website i got the source from works fine on both computers. i must be missing something important somewhere.
Back to top Go down
Speak
Member
Member
Speak

Posts : 15
Join date : 2011-07-05

looking for a specific java script code Empty
PostSubject: Re: looking for a specific java script code   looking for a specific java script code EmptySat Dec 10, 2011 4:31 am

Show the website URL. I hope you don't mean that rickroll site. I'm not touching it again! Only way I could kill it was with task manages, and then it closed all my Firefox windows. That site is *EVIL*. It should be banned.
__________________
"The world can bring you gifts, or poison in a jewelled cup."
-- Chen Liu, as quoted by his brother Chen Tai, in Under Heaven by Guy Gavriel Kay
Back to top Go down
Sponsored content




looking for a specific java script code Empty
PostSubject: Re: looking for a specific java script code   looking for a specific java script code Empty

Back to top Go down
 

looking for a specific java script code

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» Please format code in your posts using the [code][/code] tag!
» New to Ruby from Java
» Java and Databases
» Ruby Java Bridge
» [java] Share a variable?

Permissions in this forum:You cannot reply to topics in this forum
Easy A :: looking for a specific java script code Edit-trash Useless :: Trash-