SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict SLEE's Avatar
    Join Date
    Aug 2003
    Location
    uk
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    fadeIn not working in IE

    Hi all,

    I am working on what I thought would be a simple and quick project where I have built a table and I need to be able to allow the user to add another row or more by clicking a button.

    First off I got the adding a row and removing a row pretty easily. THen i wanted the new row to fade in which after some jigging with the code and finding that Ie does not like the fade in i came up with the following:

    Code:
     $(".addnew").click(function() {
    	lastRow = $('#hazardtable tr:last').clone();
       $("#hazardtable").append(lastRow);
       $('#hazardtable tr:last').hide();
       $('#hazardtable tr:last td').fadeIn('slow');
       $('#hazardtable tr:last').show();
       $('#hazardtable tr:last td').show();
      });
    In short the above code clones that current last row in the table and appends it to the end of the table and fades it in.
    This works perfectly in Safari and Firefox and 99% in Ie, however in some of the cells of the table I have set a background colour.
    For some very odd reason when these cells are faded in they lose the border on the table. If i use show() it shows the borders no problem but i would very much like to use the fadeIn() as it looks much nicer.

    here is one of the cells that I am having trouble with:

    Code:
    <td align="center" valign="middle" bgcolor="#006600"><input name="riskoutcome5" type="radio" class="radio" id="riskoutcome_7" value="hi" /></td>
    On the table itself i have border="1"

    Can anyone help?

  2. #2
    SitePoint Guru Jason__C's Avatar
    Join Date
    Oct 2009
    Location
    Racoon City
    Posts
    660
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It's because you are hiding it before you fade in...


    Code JavaScript:
     $('#hazardtable tr:last').hide();
     $('#hazardtable tr:last td').fadeIn('slow');

    Can't show the fade In if it is hidden.

  3. #3
    SitePoint Addict SLEE's Avatar
    Join Date
    Aug 2003
    Location
    uk
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply.
    Unfortunately without that it does not fade in at all.
    When it clones the last row it is already visible so I have to hide it to then fade it in.
    Then just for IE i have to also use show() to make it visible even though it has been faded in.


Bookmarks

Posting Permissions

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