Results 1 to 3 of 3
  1. #1
    Pandemonium
    Join Date
    Feb 2010
    Posts
    7,622
    BG Level
    8
    FFXI Server
    Sylph

    Java Script. Lord help me.

    I volunteered to take on a java script/greasemonkey project at work and have no idea what I'm doing. I mean that literally.

    I've never touched java script before.

    How do I get started, can anyone give any guidance. At the moment I'm trying to figure out how to put an element next to another element on the screen, instead of at the bottom of the screen using the appendchild.body function. I want to put it higher on the screen and have it automatically move as we have people at work with different size screens, so it can't always be at same point.

    Any guidance on any of that would be appreciated.

  2. #2
    Salvage Bans
    Join Date
    Feb 2007
    Posts
    811
    BG Level
    5
    FFXIV Character
    Orinthia Warsong
    FFXIV Server
    Excalibur
    FFXI Server
    Bahamut

    You can attach things to div fields, so somewhere in the body place a <div id="derp"></div> somewhere and append to it. You can just have a handful of these with different ids and then attach/remove/clear things from them whenever you want. This might help a little: http://dustindiaz.com/add-and-remove...th-javascript/

    About the only thing you can do is jump in, plan out what it is you're looking to do, maybe draw it out on paper, and then see what parts of the idea javascript can handle (css manipulation might handle other things, like hiding elements without destroying them, moving them around, etc, mixed with other scripts). You'll be visiting stackoverflow a lot for chunks of code, but at least try to understand what it is the poster was trying to do with it and play with it in those online js/css editors. You may also take a look at bootstrap css for some responsive design (page can react to the size of the browser window), and jquery for certain added functionality.

    Also, be weary of ie/firefox/chrome compatibility, you'll run into it eventually so just hope you have a somewhat standard browser.

  3. #3
    Sandworm Swallows
    Join Date
    Jul 2008
    Posts
    7,147
    BG Level
    8

    ok so I wrote something and then deleted it thinking the thread was old... I really need to go to bed.

    here it is again:

    there are a couple basic intro to js courses here and here, I don't know if they will help you but they are what I'm using to learn it.

    But what you are trying to do sounds like it should be possible in css, as it can be configured to handle viewport resizing and the behavior of specific elements should also be programmable there.

Similar Threads

  1. Replies: 14
    Last Post: 2009-09-11, 13:12