views:

45

answers:

2

Ok on meebo.com there is instant messages that when you click at the top you can move around i wanna make something like that? So how do I make Movable forms in JS?

+1  A: 

I recommend the jQuery UI plugin called Draggable.

JacobM
+1  A: 

You first need to create your 'form'. Your form will most likely be a div (with solid color or image for the background). Within the div, you have all your 'form' content. The div will also need to be position absolutely (i.e. style="position:absolute")

The javascript is fairly straight forward; however, I would personally use something like jquery to do the work. I'm not sure how familiar with javascript you are, but even for an advanced user, using something like jquery just makes sense. There is a library of tons of already built forms etc with great instructions on how to use them. Let me know if you need more info on how to use a library like jquery (you can find it here:

http://jquery.com/

You can see all the plugins here: http://plugins.jquery.com/ (look at 'windows and overlays' - lots of them!)

Click on one that looks interesting, and click on 'demonstration' to see if you like it. For example, the third link down - (mb)ConteinersPlus, a jQuery component for full customizable and featured container layout (DIV box model) - would let you do this (with almost no work on your end) http://pupunzi.com/ (this is the example link)

Obviously if you want to learn how to script it by hand, let me know.

Liam