Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9155859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:40:13+00:00 2026-06-17T12:40:13+00:00

I have a questions. I search for a solution for these. Wanna use el

  • 0

I have a questions.
I search for a solution for these.
Wanna use el with child function.
But didn’t work sofar.
If i clear the el it works but then i have all elements class last.

Mootools Script

 $$('ul#portfolio li, .ce_id').each(function(el) {  
                    if(!el.hasClass(filterVal)) {  
                        el.fade('out').setStyle('display', 'none').addClass('hidden');

                    } else {  
                      el.setStyle('display', 'block').fade('in').removeClass('hidden');
                      $$(el':nth-last-child((4n+4)').addClass('last');
                    } 

Hope you guys can help me. Or its not possible to use el or VAR with :nth-last-child together?

Update: But didn’t work.

              else {  
               el.setStyle('display', 'block').fade('in').removeClass('hidden');
               el.getElements(':nth-last-child(4n+4)').addClass('last');
             }

Update 2:

Here the Code
So i want when i click on print that every 4 li witch not hidden and has the class witch clicked get the class last.
http://jsfiddle.net/6whd9/1/

Best reagards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:40:14+00:00Added an answer on June 17, 2026 at 12:40 pm

    I’m cutting down on the code a bit, but you cant but the el in the selector. Instead you should use el.getChildren or el.getElements. Here is an example:

    $$('#parent > div').each(function(el){
        el.getChildren(':nth-last-child(4n+4)').addClass('last');
    });
    

    Here is a working example: http://jsfiddle.net/ZxMUh/

    Edit: It’s really hard to understand from your question what works and not. However, if you try to animate you can not just fade it in. You need to hide it first.

    $$('#parent div.hidden').fade('hide');
    
    
    $$('#parent > div').each(function (el) {
        el.removeClass('hidden').fade('in');
        el.getChildren(':nth-last-child(4n+4)').addClass('last');
    });
    

    Here is the example: http://jsfiddle.net/ZxMUh/2/

    Edit (After getting the fiddle): In my example I thought you where changing the nth-child in the “li”. The problem is that you can’t do it in your each-statement. Do it separate.

    Here is fiddle when using :nth-last-child: http://jsfiddle.net/6whd9/2/

    However, is’t not probably going to do what you want, and it’s not really possible to use the :nth-child in this case. You have to make the selection by your self.

     var visable = $$('ul#portfolio li:not(.hidden)').reverse();
     visable.each(function (item, index) {
         // same as 4n + 4
         if (index % 4 == 3) {
             item.addClass('last');
         }
     });
    

    Here is a fiddle demonstrating it: http://jsfiddle.net/6whd9/4/
    (I added the last class to the style with a solid red border so it would be visable)

    I hope I finally understood your question…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am going to be making a small user system but I have questions.
similar questions have been asked before but I cant find an exact match to
I have just asked these two questions, one on flash seo url best practices
I have the following pseudo-code in my book for a breadth-first search: function breadth_first_search:
I know similar questions have been asked, e.g. here , but having done a
I have seen many somewhat similar questions, but nothing quite what I'm looking for.
I've seen like 10239218301 other questions about this but NO solution has worked for
I have a question about IPTC metadata. Is it possible to search images that
I have a question. How could I get the data from a google search
The question raised from the question here . In order to have search engines

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.