Results 1 to 2 of 2

Thread: Switch Content Script I Help

  1. #1
    Join Date
    Mar 2007
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Switch Content Script I Help

    1) Script Title:
    Switch Content Script

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...tchcontent.htm

    3) Describe problem:

    Hi I am trying to put the cross image after the question instead of begining. how can I do that??
    Lets says default is:
    [x]What is Javascript?
    But I want to put the [x] image at the end like this:
    What is Javascript? [x]

    Thanks in advance

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    You can easily do this, though the change would affect every switch content instance on your site. Inside switchcontent.js, find the line:

    Code:
    header.firstChild.innerHTML=status
    and change that to:

    Code:
    header.lastChild.innerHTML=status
    And also:

    Code:
    this.headers[i].innerHTML=this.headers[i].innerHTML+' <span class="status"></span>' //Add a span element to original HTML to store indicator
    and change that to:

    Code:
    this.headers[i].innerHTML='<span class="status"></span> '+this.headers[i].innerHTML //Add a span element to original HTML to store indicator
    You may want to look at using Switch Content script II instead, which lets you place the toggling icon anywhere you like on your page.

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
  •