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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:53:36+00:00 2026-06-03T15:53:36+00:00

I have a table with about 15 tr’s and 11 td’s for each tr.

  • 0

I have a table with about 15 tr’s and 11 td’s for each tr. I which a could on hovering the tr to make only the td number 8 (from 0) to be styled through the .css() method.

Problem: with my code it selects the whole column , all the td’s with the .media class , not only the one in the hovered tr.

EDIT :

Here is the jsfiddle link: http://jsfiddle.net/XgH43/3/

CHANGED :
Here is what I tried:

note: MEDIA, LIGADO and HIDE are reference to classes I made.
note 2 : I don’t have access to the css or the php, I’m working separated from them, later they can implement classes and whatever they feel like it.

//MOUSE OVER:

    //MEDIA W/O .LIGADO:

    //W/O .HIDE:
    $("tr.destacar:not(.hide, .ligado)").mouseover(function (){
    $("td.media", $(this)).css(
    {
        'background'        : 'purple',
        'box-shadow'        : 'inset 0 10px 20px 5px #FFFFFF,0 1px 5px #929292',
        '-moz-box-shadow'   : 'inset 0 10px 20px 5px #FFFFFF,0 1px 5px #929292',
        '-webkit-box-shadow': 'inset 0 10px 20px #FFFFFF,0 1px 5px #929292',
        'text-decoration'   : 'underline'
    }
    );
    }
);

    //WITH HIDE:  
    $("tr.destacar.hide:not(.ligado)").mouseover(function (){
    $("td.media", $(this)).css(
    {
        'background'        : 'green',
        'box-shadow'        : 'inset 0 10px 20px 5px #FFFFFF,0 1px 5px #929292',
        '-moz-box-shadow'   : 'inset 0 10px 20px 5px #FFFFFF,0 1px 5px #929292',
        '-webkit-box-shadow': 'inset 0 10px 20px #FFFFFF,0 1px 5px #929292',
        'text-decoration'   : 'underline'
    }
    );
    }
);

//MOUSE OUT:

    //MEDIA W/O .LIGADO:

    //MEDIA W/O.HIDE:
    $(".destacar").not(".hide, .ligado").mouseout(function (){
    $("td.media", $(this)).css(
    {
        'background'        : 'red',
        'box-shadow'        : 'none',
        '-moz-box-shadow'   : 'none',
        '-webkit-box-shadow': 'none',
        'text-decoration'   : 'none'
    }
    );
    }
    );

    //MEDIA WITH .HIDE:
$(".destacar.hide").not(".ligado").mouseout(function (){    
    $("td.media", $(this)).css(
    {
        'background'        : 'yellow',
        'box-shadow'        : 'none',
        '-moz-box-shadow'   : 'none',
        '-webkit-box-shadow': 'none',
        'text-decoration'   : 'none'
    }
    ); 
}
);

// ON CLICK:
// 
    //MEDIA WITH LIGADO:

    $('.destacar.ligado').not(".hide").click(function () {

    //MEDIA W/O HIDE:
    $("td.media", $(this)).css(
    {
        'background'        :'red',
        'box-shadow'        :'none',
        'font-weight'       :'normal',
        'font-size'         :'default',
        '-moz-box-shadow'   :'none',
        'box-shadow'        :'none',
        '-webkit-box-shadow':'none',
        '-o-box-shadow'     :'none'
    }
    );
}
);

    //MEDIA WITH .HIDE:
    $('.destacar.hide.ligado').click(function () {
    $("td.media", $(this)).css(
    {
        'background'        :'yellow',
        'box-shadow'        :'none',
        'font-weight'       :'normal',
        'font-size'         :'default',
        '-moz-box-shadow'   :'none',
        'box-shadow'        :'none',
        '-webkit-box-shadow':'none',
        '-o-box-shadow'     :'none'
    }
    );
}
);

    //MEDIA W/O .LIGADO

    //MEDIA W/O .HIDE:
    $('.destacar').not(".hide, .ligado").click(function () {
        $(this).addClass(".ligado");
    $("td.media", $(this)).css(
    {
        'background'        :'purple',
        'box-shadow'        :'0 1px 5px #FFFFFF,inset 0 10px 20px #305775',
        'font-weight'       :'bolder',
        'font-size'         :'12pt',
        '-moz-box-shadow'   :'0 1px 5px #FFFFFF,inset 0 10px 20px #305775',
        'box-shadow'        :'0 1px 5px #FFFFFF,inset 0 10px 20px #305775',
        '-webkit-box-shadow':'0 1px 5px #FFFFFF,inset 0 10px 20px #305775',
        '-o-box-shadow'     :'0 1px 5px #FFFFFF,inset 0 10px 20px #305775'
    }
    );
    }
    );

    //MEDIA WITH .HIDE:
    $('.destacar.hide').not(".ligado").click(function () {
        $(this).addClass(".ligado");
    $("td.media", $(this)).css(
    {
        'background'        :'green',
        'box-shadow'        :'0 1px 5px #FFFFFF,inset 0 10px 20px #305775',
        'font-weight'       :'bolder',
        'font-size'         :'12pt',
        '-moz-box-shadow'   :'0 1px 5px #FFFFFF,inset 0 10px 20px #305775',
        'box-shadow'        :'0 1px 5px #FFFFFF,inset 0 10px 20px #305775',
        '-webkit-box-shadow':'0 1px 5px #FFFFFF,inset 0 10px 20px #305775',
        '-o-box-shadow'     :'0 1px 5px #FFFFFF,inset 0 10px 20px #305775'
    }
    );
    }
    );

It’s not the full code , but It’s the part that matters. I’ve changed it and now it almost works, but still not fully working.
PS.: It’s the tr that must not have the .hide and .ligado classes and not the td.

Jsfiddle full version code : http://jsfiddle.net/XgH43/3/

  • 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-03T15:53:38+00:00Added an answer on June 3, 2026 at 3:53 pm

    I’ve acctually used the tow previous answers – if you know how could I reward both the authors please tell me – and came up with the solution , but unfortunetly I had to edit the css file , which fails my goal to not do so, I could mess arround and find another solution , but really , to edit the css makes it much cleaner.
    Here it is the jsfiddle link of it (by the way , the colors are just for testing , I wouldn’t make it so ugly).
    Thanks again , Niclas and Sheikh.

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

Sidebar

Related Questions

We have a table with about 770,000 rows, in which only a few hundred
I have table which has about 50 rows. Each row has link, but I
I have a table with about 5,000 rows which I build dynamically with jQyuery.
I have a table with about 10K rows, which I am trying to alter
I have a mysql table with about 2,000,000 entries, with a primary key which
I have table containing information about a series of x number of quizzes. It
I have a table with about 35 million rows. each has about 35 integer
I have a table that has about 50 columns. To retrieve the variables from
I have a table about inverse gamma correction these are the values coresponding from
I have a table that has about 1/2 million records in it. Each month

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.