Results 1 to 4 of 4

Thread: switchcontent2: hide object first

  1. #1
    Join Date
    Oct 2005
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question switchcontent2: hide object first

    New day, new problem.

    I'm using this script:
    http://www.dynamicdrive.com/dynamici...chcontent2.htm

    I was wondering if you could change the initial state of the "object" to hidden. Currently the object isnt hidden when the page loads for the first time.

    I also tried the "switchcontent 1" script which didnt have that problem, but it was a graphical mess in firefox and opera. "switchcontent 2" works fine in all browsers except for the problem mentioned above...

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Find:
    Code:
    function do_onload(){
    uniqueidn=window.location.pathname+"firsttimeload"
    var alltags=document.all? document.all : document.getElementsByTagName("*")
    ccollect=getElementbyClass(alltags, "switchcontent")
    statecollect=getElementbyClass(alltags, "showstate")
    if (enablepersist=="on" && get_cookie(window.location.pathname)!="" && ccollect.length>0)
    revivecontent()
    if (ccollect.length>0 && statecollect.length>0)
    revivestatus()
    }
    Replace with:
    Code:
    function do_onload(){
    uniqueidn=window.location.pathname+"firsttimeload"
    var alltags=document.all? document.all : document.getElementsByTagName("*")
    ccollect=getElementbyClass(alltags, "switchcontent")
    statecollect=getElementbyClass(alltags, "showstate")
    if (enablepersist=="on" && get_cookie(window.location.pathname)!="" && ccollect.length>0)
    revivecontent()
    sweeptoggle("contract");
    if (ccollect.length>0 && statecollect.length>0)
    revivestatus()
    }
    Probably full of mistakes, it's 0445 and I haven't had any sleep.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Oct 2005
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Who needs sleep when you can have so much fun with javascript?

    Your advice worked btw. thanks.

    Case closed!

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Who needs sleep when you can have so much fun with javascript?
    Hur, hur, hur. Qt, actually.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •