SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2008
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Prototype $$() counting hidden rows

    I'm using the Scriptaculous fade() function to remove a table row. It works fine and just after I call a function that uses $$('tbody tr').each to iterate through each row in order to reset an alternating background.

    What I've noticed is that the $$() iterates through even removed rows as if they're still there. Is this the typical behavior or is it a timing issue with when the fade() or remove() finishes? How do I avoid the counting of removed rows, as it's throwing off my alternating backgrounds.

  2. #2
    SitePoint Addict richtestani's Avatar
    Join Date
    Nov 2003
    Location
    Bridgeport
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The Fade effect doesn't remove elements from the document but sets it its display value to none.

    you'd want to use the Prototype method remove() to actually remove the elements.

    if you are just hiding and showing, you potentially could set a className 'inactive' and check for that.
    RichTestani
    -------------------------------
    http://www.junkdepot.com
    http://www.rareoopdvds.com | The Movie Poster Site


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
  •