www.webdeveloper.com
Results 1 to 2 of 2

Thread: JS problem in MooTools

  1. #1
    Join Date
    Sep 2011
    Posts
    2

    JS problem in MooTools

    Ok, here goes..
    It's probably a pretty easy fix, I'm not that good with JS though.
    I'm implementing the Sortable future from MooTools, currently, I'm tweaking it so I'll be able to use nested lists, just in the way I want it.


    --------------------------------
    var sublist1 = document.id('sortable-sublist1');
    var sublists = [sublist1, sublist2, sublist3]; // Actually, these will be filled by a PHP statement

    new Sortables(sublists,{
    constrain (..)
    sublists[%].getElements((..));
    }
    --------------------------------

    Ok, I've simplified it.
    In this Sortables object, I need to retreive some elements from this CURRENT sublist. As you can see, for the moment I've placed a % sign, where normally an integer or another key would fit.

    In PHP, we know the function "current()" for this. But how do I fix this in JavaScript?

    Thanks in advance!

  2. #2
    Join Date
    Sep 2011
    Posts
    2
    Quote Originally Posted by MennoH View Post
    var sublist1 = document.id('sortable-sublist1');
    var sublists = [sublist1, sublist2, sublist3]; // Actually, these will be filled by a PHP statement

    new Sortables(sublists,{
    constrain: true,
    (..)
    onComplete: function(el,clone) {
    sublists[%].getElements((..));
    }
    }
    This is the correct code!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles