I think I understand your question.  I don't think you need to define
a variable as a new draggable as MochiKit will do that for you.  But
you gotta have the MochiKit libraries accessible.

To have the MochiKit libraries available you could link to MochiKit.js
in the <head> like any regular js file

or

If you're running TurboGears (are you?  if not, I'll stop mentioning
it) in app.cfg make sure you have this line uncommented:

tg.include_widgets = ['turbogears.mochikit']

And then to set a variable to a draggable <DIV>:

var d = getElementsByTagAndClassName('DIV', 'draggable');   (this is
in draggable.js)

where 'draggable' is the CSS class... you could change 'draggable' to
something else from your CSS file.

Then the MochiKit magic kicks in and makes all DIVs draggable.

I'm still pretty new at this myself, so sorry if this is confusing.
I've been using turbogears for 2 months and MochiKit sproadically
during that time.  :-)



On Mar 16, 10:36 am, "[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....
>
> On Mar 16, 2:19 pm, "Steve" <[EMAIL PROTECTED]> wrote:
>
> > Are you using TurboGears?  If so, this link will take you to a page
> > with sample code.  The link is for MochiKit 1.3.1.
>
> >http://svn.mochikit.com/mochikit/branches/MochiKit-1.3.1/examples/dra...
>
> > You can check the version of MochiKit by opening MochiKit.js (usually
> > lives in /python24 directory somewhere) and the version number will be
> > at the very top.
>
> > Hope this helps.
>
> > -Steve
>
> > On Mar 16, 7:53 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > > Hi , I am very new to this whole toolkit thing... I was writing
> > > javascript from scratch and now came across tollkits... i really have
> > > a problem getting my head around it... can someone explain to me in
> > > easy steps how I can for example implement a drag and rop on a
> > > div .... the way I can THINK it shouls be done is...
> > > <html>
>
> > > <head>
> > > <title></title>
> > > <script language="javascript" type="text/javascript" src="js/
> > > Base.js"></script>
> > > <script language="javascript" type="text/javascript" src="js/
> > > Iter.js"></script>
> > > <script language="javascript" type="text/javascript" src="js/
> > > Color.js"></script>
> > > <script language="javascript" type="text/javascript" src="js/
> > > Visual.js"></script>
> > > <script language="javascript" type="text/javascript" src="js/
> > > Signal.js"></script>
> > > </head>
>
> > > <body>
> > > <div id="mydrag" style="background-color:black;width:100;height:
> > > 50;">Mike</div>
>
> > > <script language="javascript" type="text/javascript">
> > > new Draggable('mydrag');
> > > </script>
>
> > > </body>
>
> > > </html>
>
> > >  I might be very very far from the "truth" so .... any suggestions???


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
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