Spry Tabbed Panels ( Dreamweaver CS3 ) question.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eboyjr14
    New Member
    • Apr 2007
    • 27

    Spry Tabbed Panels ( Dreamweaver CS3 ) question.

    I have Dreamweaver CS3 and I'm trying out the new Spry stuff like the tabbed panels ( and I like it =P ). I am using the tabbed panels and need to know how to dynamically create a new tab with javascript with some content inside ( and switch to it ). Also, I need to figure out how I can delete tabs at "runtime"? I have tried many things to do this, but Firefox has no new errors in the Error Console and nothing is happening...
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Show what code you have so far.

    Comment

    • eboyjr14
      New Member
      • Apr 2007
      • 27

      #3
      Originally posted by acoder
      Show what code you have so far.

      Here's what I have finally came up with and gave up with ( does not work )
      [CODE=javascript]
      function addMainTab(titl e, content)
      {
      document.getEle mentById('Tabbe dPanels1').firs tChild.innerHTM L += '<li class="TabbedPa nelsTab" tabindex="0">'+ title+'</li>';
      document.getEle mentById('Tabbe dPanels1').last Child.innerHTML += '<div class="TabbedPa nelsContent">'+ content+'</div>';
      var TabbedPanels1 = new Spry.Widget.Tab bedPanels("Tabb edPanels1");
      }
      [/CODE]

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        I'm not too familiar with Spry, but perhaps that Spry call should come first.

        Do you get any errors?

        Comment

        • eboyjr14
          New Member
          • Apr 2007
          • 27

          #5
          Originally posted by acoder
          I'm not too familiar with Spry, but perhaps that Spry call should come first.

          Do you get any errors?
          No, I do not get any errors in Firefox ( which is weird ) and when that function is called, it goes to the first tab. When the document gets loaded, it calls Spry.Widget.Tab bedPanels("Tabb edPanels1") just create it at first.Thanks for your help.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Originally posted by eboyjr14
            No, I do not get any errors in Firefox ( which is weird ) and when that function is called, it goes to the first tab. When the document gets loaded, it calls Spry.Widget.Tab bedPanels("Tabb edPanels1") just create it at first.Thanks for your help.
            Having had a quick look at some sample code, you need to write your HTML and then call the Javascript. What does your HTML look like at first?

            Comment

            Working...