Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ![]() Interested in joining? Click here. If you are already a member of ZBCode, feel free to login right here: |
| [ZB] Resolution Code | |
|---|---|
| Topic Started: Dec 8 2009, 04:13 PM (86 Views) | |
| theschoot | Dec 8 2009, 04:13 PM Post #1 |
![]()
Want to learn Javascript
:)
![]()
|
i was trying to do something like a resolution code (which edit one width), if the resulution is >=1024, but i can't figure that out:
what i'm making wrong? |
| |
![]() |
|
| Gorgor | Dec 8 2009, 05:04 PM Post #2 |
|
Hello
![]()
|
Well all of the stuff you enter in the board template is before the copyright, so when it's executed there is no copyright there. You need to use $(function(){
Edited by RedBldSandman, Dec 8 2009, 05:17 PM.
|
|
This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc | |
![]() |
|
| RedBldSandman | Dec 8 2009, 05:18 PM Post #3 |
![]()
ZIPPY!
![]()
|
Also, you can't have semicolons after the if and else statements. I've edited Gorgor's example so just use that. |
![]() "To iterate is human, to recurse divine." | |
![]() |
|
| Gorgor | Dec 8 2009, 05:33 PM Post #4 |
|
Hello
![]()
|
Thanks. I didn't read the code, just saw that it needed the $(function(){ }) thing.
|
|
This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc This forum is closed. Please visit http://zetascript.co.cc | |
![]() |
|
| theschoot | Dec 11 2009, 10:43 AM Post #5 |
![]()
Want to learn Javascript
:)
![]()
|
great thanks , but can i ask why i need to make a function there?
|
| |
![]() |
|
| Reid | Dec 11 2009, 05:15 PM Post #6 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
Basically, a browser runs scripts as it comes across them. Since your script was either Above the Copyright or Below the Board that means that the code was ran before a copyright existed. Since when the code was ran there was no copyright, there wasn't an element to put the text node in front of - so it did nothing. $(function() {}) is a shorthand for "when the DOM is ready." That means that the very second that all of the elements on the page are able to be accessed, it will run the code inside of it. $(function() {}) is roughly equivalent to the onload attribute on the body. The problem with onload is that it will wait until all of the images on the page are done loading to execute code: that means that if you have big images on the page, the browser could have to wait until all of those are done loading to run your code. $(function() {}) bypasses this problem and runs the code when all of the elements are ready to be edited - not when all images, etc have loaded. I do hope that makes sense.. |
| |
![]() |
|
| Vitality | Dec 12 2009, 12:31 AM Post #7 |
|
Tabula Rasa
![]()
|
Cool, I did not know that. And yes it makes sense Reid. Thank you for sharing
|
![]() |
|
| theschoot | Dec 12 2009, 11:24 AM Post #8 |
![]()
Want to learn Javascript
:)
![]()
|
wow thanks for that answer , easy to understand
|
| |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · InvisionFree and Zetaboards Support · Next Topic » |




















, but can i ask why i need to make a function there?




5:20 PM Sep 3