SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    ********* Ornithologist AtomicPenguin's Avatar
    Join Date
    May 2002
    Location
    Vancouver, BC
    Posts
    459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    dynamically re-ordering page content

    Hi everyone,

    I have a very particular problem which I can solve using some of Microsoft's proprietary browser functionality ("innerHTML"), but I'd far rather a cross-browser solution. My problem is, I need to be able to change the ordering of a list of text in a web page.

    for example:

    [up] [down] line one
    [up] [down] line two
    [up] [down] line three

    So, when you click on [up] for line two, the page dynamically redraws itself to this:

    [up] [down] line two
    [up] [down] line one
    [up] [down] line three

    Anyone?

  2. #2
    ********* Ornithologist AtomicPenguin's Avatar
    Join Date
    May 2002
    Location
    Vancouver, BC
    Posts
    459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alrighty. Addendum to the above: I got it going using the DOM, but my way is really ugly: I'm parsing the table and swapping the contents of each <td> using the built in "nodeValue". Unfortunately this only works for text values.

    Here's my new question: does anyone know a way of referring to the WHOLE row - including the html, from the opening <tr> to the closing </tr> ?

    So, when you click "[up]" or "[down]", the relevant table rows are shifted.

    Thanks


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
  •