jQuery:
- I kind of gave up on the thing which will add something at the pointer when you click, because it was really finnicky and glitched out a lot
- Now I am trying to have elements fade in and out at random locations on a loop, which works, but I can not remove the elements at the end, which causes the page to eventually have an infinite number of elements
- The main problem I'm having is an inability to distinguish between different elements of the same class. For example, I want to remove a specific element of the "mlg" class 800ms after creation, but the only thing I can do is $(".mlg").remove(), which will remove all elements. I need some sort of data binding scheme in order to get this stuff to work.
jQuery:
- Made my homepage just a bit more MLG
- It was really frustrating, though. I've been learning about onclick events, setTimeout(), element creation, image loading, and other stuff for the last two days, and by far the most frustrating stuff has just been the wierd quirks in javascript
- For example, you cannot get the width or height of an image directly, only after it has been added to the page. You also have to make at least one integer a float when dividing in order to get a decimal answer (seen when setting the height variable in mlg.js).
- The setTimeout method was also really confusing because you can't pass a variable into the method within setTimeout, or it will not delay. I was trying to pass this in and it would not work. It took me like 20 minutes to figure out the proper way to do it, even with googling, which ended up being setTimeout(function() { element.remove(); }, 125); where element = $(this).
- Getting the cursor position from the mousemove event was also really confusing, as a guy on stackoverflow said that you needed to use event.offsetX to get mouse position from the event variable. Then someone else said that on firefox, you needed to use event.layerX. I tried both of these and neither worked, so I investigated and I believe that these two methods are for getting mouse position relative to an element, whereas I wanted location relative to the page. I ended up using event.pageX, which I should have just done from the beginning.
- All this stuff can be seen in the file here (UPDATE: changed to mlg_old.js), which is loaded into index.html
Ruby:
- Worked on arguments parsing, improved clarity of program function to the user
- DRYed out repeated code
- Commit is here
jQuery:
- Started working on a javascript file to enhance the website experience
jQuery:
- Started adding javascript to website
Javascript:
- Worked on two way data structures from the jQuery example here.
- It took a bit to get working, but I eventually figured it out. Basically if you have a textbox or whatever with an attribute called data-bind-123="name" and change the value in it, it will update the name attribute of a User class that has a uid 123 as well. Likewise, if you use console to update the name in the object, it will also update in the textbox.
jQuery:
- Worked on the movable window thing
- Combined the 2 way datastructures thing with the movable windows, and wrote a function to assign uids on demand.
- I'm not really that good with javascript syntax though.
jQuery:
- Worked on the movable window thing some more, but I'm kind of out of my depth because I'm trying to create an object which binds itself to a div, so that someone interfacing with the object can change stuff in the div
- This functionality seems pretty complex to implement.