Results 1 to 3 of 3

Thread: How to Switch Content Script II (icon based) to collapse when page opens ?

  1. #1
    Join Date
    Oct 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to Switch Content Script II (icon based) to collapse when page opens ?

    Hello,

    1) script page : http://www.dynamicdrive.com/dynamici...chcontent2.htm

    2) my website page : http://infocreditimmobilier.com/les-investissements-immobiliers-locatifs-defiscalises/. Please note that all pages have the script installed, with only one tab.

    3) Problem: The tab opens automatically when viewer arrives on the page.

    4) What I can't figure out : how to set the tab to be closed when the viewer arrives on the page, obliging the viewer to click the icon in order to open it. Why: because of Google Pinguin 4.

    Heres is the code that I have set in the single.php (wordpress):

    Code:
    <div class="eg-bar"><span id="faq1-title" class="iconspan"><img src="minus-icon.png" /></span>Question ?</div>
    <div id="faq1" class="icongroup1">
    Answer
    </div>
    <br />
    
    <script type="text/javascript">
    
    var faq=new switchicon("icongroup1", "div") //Limit scanning of switch contents to just "div" elements
    faq.setHeader('<img src="http://infocreditimmobilier.com/wp-content/uploads/2013/03/minus.gif" />', '<img src="http://infocreditimmobilier.com/wp-content/uploads/2013/03/plus.gif" />') //set icon HTML
    faq.collapsePrevious(true) //Allow only 1 content open at any time
    faq.setPersist(true) //No persistence enabled
    faq.defaultExpanded(0) //Set 1st content to be expanded by default
    faq.init()
    
    </script>
    Massive thanks in advanced for your help.
    Last edited by Beverleyh; 10-10-2013 at 04:22 PM. Reason: Formatting

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    2,038
    Thanks
    16
    Thanked 316 Times in 314 Posts
    Blog Entries
    13

    Default

    You've set the 1st content to be open with this line;
    Code:
    faq.defaultExpanded(0) //Set 1st content to be expanded by default
    Remove that line (like in demo 2) and the content won't open
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  3. #3
    Join Date
    Oct 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It's amazing how solutions to unsolvable problems can be simple.

    Thanks a lot for this tip, it's indeed working.

Similar Threads

  1. Switch Content Script II (icon based)
    By SimoTo in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 03-21-2013, 02:39 PM
  2. Switch Content Script II (icon based) doesn't work in IE?
    By regina.chou in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 09-28-2010, 05:28 AM
  3. Switch Content Script with Icon & Text link?
    By Evolver in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 03-02-2009, 05:47 AM
  4. Switch Content Script II (icon based)
    By stevember in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 03-12-2008, 07:41 AM
  5. Switch Content Script II (icon based) with AJAX
    By shyne in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 09-06-2007, 09:59 PM

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
  •