Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    [mootools] combining two effects?

    Hello everybody!

    I have a problem that you might not want to fix. I hope I can help you decide by telling you what it is, and what I want with it. I'll give it a try. Because I'm not even a half-decent coder I just can't work it out. I'm trying to do the following:

    I've got fx.scroll from a very, very fascinating site: http://www.melissahie.com. Ofcourse I have no intention of simply copying what she has so elegantly done, but I do want the same beautiful effect. I can't get the mootools original fx.scroll to work (http://demos111.mootools.net/Fx.Scroll) so I am currently using this one. Getting it to work was no real problem, as it works perfectly.

    But now, I also want to add an accordion-effect (http://demos.mootools.net/Accordion) to a portion of a page, where I am also using the fx.scroll. The problem is, that it doesn't work. I can get both effects working, but not in a single document. Seperate from each other, they work good!

    The problem has to be that I've got melissa's mootools.r420.js and I've got mootools.js that came with the accordion download. But what to do next?

    I realise I cannot simply paste one into the other, and refering to both doesn't seem to work.

    I've also tried to download the complete mootools.js and using that for both, but that I only thought that this would work, will tell you a lot about my skill.

    Does anyone know how I can resolve this?

  • #2
    Regular Coder
    Join Date
    May 2005
    Posts
    190
    Thanks
    1
    Thanked 2 Times in 2 Posts
    You only need one version of MooTools, get the full latest from the site and use that one only.

    The scroll effect is a simple one liner:

    //taken from the example site's html
    //define the scroll[skroll] element, which is the window
    var skroll = new Fx.Scroll(window, {duration: 1500, wait: false, transition: Fx.Transitions.quadInOut});

    //create the scroll actions
    $('gotohome').addEvent('click', function(){ skroll.toElement('start'); });

    Where gotohome and start are elements with those ids.

    Clashing version of MooTools is most likey your problem. That or clashing ids.

    Sidequestion - do you want to add the scroll effect to an accordion "page"?


  •  

    Posting Permissions

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