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 8385169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:36:08+00:00 2026-06-09T17:36:08+00:00

I believe it’s possible to pass an array of DOM objects to jQuery’s selector

  • 0

I believe it’s possible to pass an array of DOM objects to jQuery’s selector so you can manipulate multiple objects at the same time. I’ve tried doing this as follows but can’t get it to work for some reason…

$(Sel).animate({
        backgroundColor: "#FF0000"
    }, 250, 'linear', function() {

        $(this).animate({
            backgroundColor: "#FFFFFF"
        }, 250, 'linear');

    });

Is it actually possible to do this or am I barking up the wrong tree?

I’ve put together this jsFiddle to test things out. The aim is to make a booking system where slots of half hour are selected so I need to manipulate “this” and the cell below on the next row.

Any advice greatly appreciated.

Code from fiddle:

function HighlightCells() {

    $('table#Calendar tbody tr td:not(".TimeCell")').live('mouseenter', function() {
        var Sel = new Array();
        Sel[1] = $(this);

        // Count number of previous TDs. Resut is base 0
        var NumIn = $(this).prevAll('td').length;

        // Increment count to compensate for nth-child being base 1
        NumIn++;

        var NextRow = $(this).closest('tr').next('tr');

        Sel[2] = $(NextRow).children("td:nth-child(" + NumIn + ")");

        // Animate the cell background colour red to white
        $(Sel).animate({
            backgroundColor: "#FF0000"
        }, 250, 'linear', function() {

            $(this).animate({
                backgroundColor: "#FFFFFF"
            }, 250, 'linear');

        });


        $('table#Calendar tbody td').live('mouseleave', function() {
            $(this).text("");
        });

    });

}

HighlightCells();
  • 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-09T17:36:09+00:00Added an answer on June 9, 2026 at 5:36 pm

    You can do this

    var Sel = new Array();
    Sel[1] = this;
    

    and

    Sel[2] = NextRow.children("td:nth-child(" + NumIn + ")")[0]; 
    //  retrieves the DOM element  
    // Also no need to wrap NextRow with $() since it's already a jQuery object
    

    http://jsfiddle.net/wirey00/AX3C8/27/

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

Sidebar

Related Questions

I believe one can define covariance (at least, for objects) as 'the ability to
I believe I have a syntax error, but I have tried everything and can't
I believe I've set this up correctly. Can somebody see anything wrong with this
I believe I've looked everywhere possible and already feel to silly because I spent
I believe Wordpress stores multiple entries of posts as revisions but I think thats
Believe it or not, I can't find the answer to what I would think
I believe this is possible but unsure how to go around it, I need
I believe the default behavior when loading assembly is into the same application domain
I believe this is trivial, but I can't for the life of me, figure
I believe I have a simple question.... but for me as beginner, I can't

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.