Hi,

On 3/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> thanks man... but i am still not getting it.... the example you gave
> me has the actuall MochiKit example with drag_and Drop behavior...
> still I cant understand how i can call upon the functions of
> Mochikit... how can I say var mike = new Draggable or something like
> that....

What do you mean? If you include the scripts you can just call the
functions by their name. Like this:

map(alert, [1,2,3]);

You can also call functions with their full namespace:

MochiKit.Base.map(alert, [1,2,3]);

As for your example, that didn't work b/c you didn't pull in all the
dependencies - this should have been noted in your browser's
javascript console.

This does what you intend to I believe:
<html>

<head>
<title></title>
<script language="javascript" type="text/javascript"
src="MochiKit/Base.js"></script>
<script language="javascript" type="text/javascript"
src="MochiKit/Iter.js"></script>
<script language="javascript" type="text/javascript"
src="MochiKit/DOM.js"></script>
<script language="javascript" type="text/javascript"
src="MochiKit/Style.js"></script>
<script language="javascript" type="text/javascript"
src="MochiKit/Color.js"></script>
<script language="javascript" type="text/javascript"
src="MochiKit/Position.js"></script>
<script language="javascript" type="text/javascript"
src="MochiKit/Visual.js"></script>
<script language="javascript" type="text/javascript"
src="MochiKit/Signal.js"></script>
<script language="javascript" type="text/javascript"
src="MochiKit/DragAndDrop.js"></script>


<script language="javascript" type="text/javascript"
src="MochiKit/MochiKit.js"></script>
<script language="javascript" type="text/javascript"
src="MochiKit/DragAndDrop.js"></script>
</head>

<body>
<div id="mydrag" style="background-color:black;width:100;height:
    50;">Mike</div>

<script language="javascript" type="text/javascript">
// Create a draggable
new Draggable('mydrag');
</script>

</body>

</html>


To make your life easier, you can also just pull in
MochiKit/MochiKit.js and then the module you need and the dependencies
are taken care of for you. This works on most modern browsers I think.
So, instead of all those <script> tags above, just put these two:

<script language="javascript" type="text/javascript"
src="MochiKit/MochiKit.js"></script>
<script language="javascript" type="text/javascript"
src="MochiKit/DragAndDrop.js"></script>


Arnar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to