SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict buildakicker's Avatar
    Join Date
    Jun 2005
    Location
    NorCal
    Posts
    378
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Using Libraries... such as MooTools

    Hi all,

    JS is super new to me, but I've used it for popup windows and what not in html forever.

    So I am seeing that the MooTools library is full of great tools for sites, however, I am having a hard time implementing them.

    First off, I call mootools.js that I have downloaded from the site.

    Then do I make functions that use the effects in the library?

    ie...
    HTML Code:
    <script src="mootools.js"></script>
    <script>
    slide: function(){ 
    
         //got this from mooltools docs
         var mySlider = new Fx.Slide('myElement', {duration: 500});
         mySlider.toggle() //toggle the slider up and down.           }
    How do I attach this function to a div? Do I need to write a bit more on how the div will react when I click???

    Thanks.
    SKILEASES.COM - FREE rental listings!
    WILDFIREBLOG.COM - Wildland Fire microblog!

  2. #2
    SitePoint Zealot
    Join Date
    Apr 2007
    Location
    New London, CT
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my understanding from my use of mootols is that you load mootools in the head of you document. then you create your variables and call a new object like so:
    Code:
    window.addEvent('domready', function() {
    
    var el1 = myPanel1;
    
    //create new slider object
    var myEffect =  new Fx.Slide('el1', {duration: 500});
    //toggle slider
    mySlider.toggle() //toggle the slider up and down.
    }
    However, the best thing to do for mootools is first go to clientside dot cnet dot com and view the tutorials. they are really excellent. then if you have more questions view the docs on the site or visit the forums there. not trying to chase you away from sitepoint but the developers and the moderators there would likely be able to answer your question more thoroughly.

    here is the link to the effects tutorial on clientside: http://clientside.cnet.com/wiki/mootorial/05-effects
    Last edited by funktifyknow; Apr 25, 2007 at 10:12. Reason: clarification

  3. #3
    SitePoint Addict buildakicker's Avatar
    Join Date
    Jun 2005
    Location
    NorCal
    Posts
    378
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the link. I'll check it out!
    SKILEASES.COM - FREE rental listings!
    WILDFIREBLOG.COM - Wildland Fire microblog!

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    take a look at jQuery I'm not that great in javascript either and after looking at a few libraries.. it defintely was the easiest to use.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •