Page 1 of 1

Always show the first tabmenu after pageload

Posted: 21 Jun 2017, 10:47
by mzahl
Hi,

after loading a page, I want to show always the first tab(active-item, e.g. "Features") without a separate click.

Can you help me, modifying the code?

Thanks!!

Regards,
Martin

Re: Always show the first tabmenu after pageload

Posted: 22 Jun 2017, 16:24
by mert.sincan
Please add the following code into template.xhtml;

Code: Select all

<script type="text/javascript">
//<![CDATA[
 	$(document).ready(function() {
        var $this = PF('myMenu');
        if($this) {
            var link = $this.tabMenuNavLinks.eq(0); // the link of "Features" tab
            link.trigger('click');
        }
    });
//]]>
</script>
in menu.xhtml

Code: Select all

...
        <pa:tabMenu widgetVar="myMenu">
...

Re: Always show the first tabmenu after pageload

Posted: 03 Jul 2017, 10:00
by mzahl
Perfect, it works!

Many thanks !!

Re: Always show the first tabmenu after pageload

Posted: 03 Jul 2017, 11:59
by mert.sincan
Glad to hear, thanks for the update!