JavaScript and Jquery Experiments   Leave a comment

So, last time I read up on JavaScript and found that the syntax is pretty much the same as ActionScript except in a couple places. However, I got burned out before I could actually try anything, so I’m going to do that now.

I’d say the primary thing I want to try is making a context menu like I planned to make in Flash. I’d also like to have non-standard scrollbars, so that I can focus on style, but that can probably be a later development.

So, for now, I want to make it so that when the user clicks on a specially formatted anchor tag, they’ll pop up a tree of selection blocks.

*tinker tinker tinker* Well, I’ve got it making a fixed position div when I click on a tag, that’s a start. I kind of hope there’s an easier way than the silly looking code I just wrote to do it, though. Next I need to make it appear where the click was, and close if the user drags their mouse pointer off of it. First I’mma take a break though ’cause the sun in here is driving me nuts and I have a bag of chips.

*break break break* Ahh that’s better, I’ve broken for a little while and now the sun has decended behind the mall, so no more annoying beams. It’s kind of nuts that it’s already so late. It seems like I’ve been barely up at all! I guess I spent a long time playing Legend of Grimrock.

*experiment experiment jquery jquery*

Hmm… Okay so the onclick DOM event won’t give you the xy position of the element that was clicked.

I can use the jquery css position method to get the position of a span inside of a p, though, so that should do what I need.

*work work work work work*

Okey dokey, there we go. I now have a box that appears when you click certain text in a line, and disappears if your mouse leaves the box. I can expand on that to make a nice context menu tree. ^.^

Now that I’m sure I can do that, I want to be sure I can do the other things. So, my next test will be creating data objects for the world simulation. But, I’ll do that later. I’ve been at this for a while and I need another break.

Posted April 11, 2012 by Arthur Payne in TextWorld

Tagged with , , , , ,

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.