Results 1 to 5 of 5

Thread: SwitchContent Conflict on MovableType Powered Journal

  1. #1
    Join Date
    Jun 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default SwitchContent Conflict on MovableType Powered Journal

    1) Script Title: SwitchContent

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

    3) Describe problem: It doesn't seem to work in MovableType. I wanted to use this script for my long archive list, which has been going on since June 2000 and a new link is posted monthly on my main page. It just does not seem to be compatible with MovableType, the software that I use to publish my journal with. I get the link on the site just fine, and I use the exterior link to the switchcontent.js. I made a demo page and the whole thing works fine in that, just not on my MovableType powered blog. Which is strange because other JavaScripts (rainbow links, no-right-click, etc) work just fine. Am I doing something wrong or does it just not work for MovableType users?

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

    Default

    Please post a link to the page on your site that contains the problematic script so we can check it out.

  3. #3
    Join Date
    Jun 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry. My bad.

    The URL where it does not work:
    http://www.frozen-stars.net/x/

    The demo page, where it does work:
    http://www.frozen-stars.net/demo.htm

    I copied and pasted it directly from the script page here into a blank DreamWeaver document. The only things I have changed on the journal page is I left out the part for "expand all" and "collapse all". I made a demo page because my host said some JS's are banned on his server because they're annoying.

    I also moved the handcursor part to the styles in the usual CSS on the page.

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

    Default

    Ah I think I see the problem. In your actual page, you never initalized the script at the very end! Look inside demo.htm:

    Code:
    <script type="text/javascript">
    //   MAIN FUNCTION: new switchcontent("class name", "[optional_element_type_to_scan_for]") REQUIRED
    //1) Instance.setStatus(openHTML, closedHTML)- Sets optional HTML to prefix the headers to indicate open/closed states
    //2) Instance.setColor(openheaderColor, closedheaderColor)- Sets optional color of header when it's open/closed
    //3) Instance.setPersist(true/false)- Enables or disabled session only persistence (recall contents' expand/contract states)
    //4) Instance.collapsePrevious(true/false)- Sets whether previous content should be contracted when current one is expanded
    //5) Instance.defaultExpanded(indices)- Sets contents that should be expanded by default (ie: 0, 1). Persistence feature overrides this setting!
    //6) Instance.init() REQUIRED
    
    var bobexample=new switchcontent("switchgroup1", "div") //Limit scanning of switch contents to just "div" elements
    bobexample.setStatus('<img src="http://img242.imageshack.us/img242/5553/opencq8.png" /> ', '<img src="http://img167.imageshack.us/img167/7718/closedy2.png" /> ')
    bobexample.setColor('darkred', 'black')
    bobexample.setPersist(true)
    bobexample.collapsePrevious(true) //Only one content open at any given time
    bobexample.init()
    </script>
    That's the part that initializes the script. See the instructions for setting up this script on the DD page.

  5. #5
    Join Date
    Jun 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Much thanks. I feel kinda like an idiot now. =-D I guess that's what happens when you try something new at 2am!

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
  •