Domanda

I have a Spry Tabbed Panel in Dreamweaver and the first tab is open when the page is loading. I don't want to have any tab opened when the page is loaded. How can i do this?

Thanks!

That's my html:

  <ul class="TabbedPanelsTabGroup">
  <li class="TabbedPanelsTab play" tabindex="0"><h4>Play! Framework</h4></li>
  <li class="TabbedPanelsTab ruby" tabindex="1"><h4>Ruby on Rails</h4></li>
  <li class="TabbedPanelsTab api" tabindex="2"><h4>Restful Api</h4></li>
  </ul>
È stato utile?

Soluzione

This could be the clumsiest workaround available but at least it's easy to do. Locate your SpryTabbedPanels.js file and see what the first function looks like. If you have somewhere a line this.defaultTab = 0; comment it and see what happens. It should make the panels invisible.

You might also want to get rid of javaScript error so find a line that contains panels[tpIndex].style.display = "block"; and replace it with:

if(panels[tpIndex]){
  panels[tpIndex].style.display = "block";
}

Actually you need to do also the second correction if you have more than one panel groups on the page. Otherwise only the first panel group is hidden.

This should work. At least it works for me for Spry made with DW CS3. But it looks ugly IMHO. No transitions/animations. But at least no panels are visible when the page is loaded for the first time. The tabs, of course, are visible.

Altri suggerimenti

$('ul > li').removeClass('selected');

SpryCollapsiblePanel.js

Top section:

this.contentIsOpen = false;

(replace true by false)

Dreamweaver CS6

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top