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

  • SEARCH
  • Home
  • 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 350335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:32:28+00:00 2026-05-12T11:32:28+00:00

I’m using tables in my document, and I want to be able to have

  • 0

I’m using tables in my document, and I want to be able to have a user submit a new item to a list, then have it “automagically” appear at the top of the list (yes, this would be easier with DIVs but working with what I have).

I’m using jQuery, and clone() to create a copy of the most recent table row, then using fadeIn() to display the new item after I update and add it to the top of the list. Because internally jQuery converts elements (assuming DIVs) to ‘block’, I’m also changing the css class to ‘table-row’. It works fine.

The whole code is here:

    var row = $("tbody tr:first").clone().hide(); // clone and then set display:none
    row.children("td[class=td-date]").html("today");
 // set some properties
    row.children("td[class=td-data]").html("data");
    row.children("td[class=td-type]").html("type");
// fadeIn new row at the top of the table.
    row.insertBefore("tbody tr:first").stop().fadeIn(2000).css("display","table-row"); 

The problem is that if I run the process too quickly – i.e. before the fadeIn completes, the “clone()” command ends up cloning the opacity as well.

I can actually get it to work in Firefox using by adjusting the first line above:

 var row = $("tbody tr:first").clone().css("opacity","1").hide();

My concern now is that I’m not sure that any of this is being done efficiently, and/or that “opacity” is cross-browser safe to rely upon.

Has anyone done something like this before, and can offer any pointers on a more reliable approach?

  • 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-05-12T11:32:28+00:00Added an answer on May 12, 2026 at 11:32 am

    opacity as a jQuery css attribute is safe cross-browser as it irons out the browser differences in the implementation. Here’s the source

    // IE uses filters for opacity
    if ( !jQuery.support.opacity && name == "opacity" ) {
      if ( set ) {
        // IE has trouble with opacity if it does not have layout
        // Force it by setting the zoom level
        elem.zoom = 1;
    
        // Set the alpha filter to set the opacity
        elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
        (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
      }
    
      return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
      (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '': "";
    }
    

    The following works.
    Working Demo – add /edit to the URL to play with it.

      // stop previous animation on the previous inserted element
      var prevRow = $("tbody tr:first").stop(true,true);
    
      var row = prevRow.clone();
      row.children("td.td-date").text("today");
      row.children("td.td-data").text("data");
      row.children("td.td-type").text("type");
    
      row.fadeIn(2000).prependTo("tbody");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.