0

I am using a Spry tabbed panel for an HTML base site.

I want to open fancybox, by clicking on a tab (four tabs in total). Once the user fills the fancybox form, only that particular tab panel content should be open.

Is this possible? Below is my code.

    <div id="TabbedPanels1" class="TabbedPanels">
  <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab" tabindex="0">Tab 1</li>
    <li class="TabbedPanelsTab" tabindex="0">Tab 2</li>
     <li class="TabbedPanelsTab" tabindex="0">Tab 1</li>
    <li class="TabbedPanelsTab" tabindex="0">Tab 2</li>
  </ul>
  <div class="TabbedPanelsContentGroup">
    <div class="TabbedPanelsContent">Content 1</div>
    <div class="TabbedPanelsContent">Content 2</div>
     <div class="TabbedPanelsContent">Content 3</div>
    <div class="TabbedPanelsContent">Content 4</div>
  </div>
</div>
<script type="text/javascript">
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
</script>

I want to a form to be filled on tab #2 in fancy box. Once user fill that form and submit successfully after that only tab panel content should be opened.

4

1 回答 1

1

由于您尚未发布任何代码..我只能说出逻辑..您可以通过以下方式获取 selectedtab 索引

var index= ($tabs.tabs('option', 'selected'));

然后将您的索引与获取的索引进行比较,如果匹配,则打开您的fancybox

$(".fancy").fancybox().trigger('click');

你可以在fancybox的sumbit/close上编写你自己的函数

$("<YOUR-SELECTOR>").fancybox({
  onClosed: function() {
 // your own functions
      });
  });
于 2013-08-07T06:42:09.263 回答