The Big Spring Sale! Up to 50% off!

New Tabs - How show a specific tab by script.

arno_k_lotus
3 Posts
arno_k_lotus posted this 06 July 2020
Ask a Question

How to recall a tab using script?

For example, I want to link [Search] input in the header to a specific tab where results will be displayed.

I cannot find which property or attribute needs to be used to swap tabs.

In a previous design made with jqueryUI I use this code
var $tabs = $('#tabsp').tabs(); // first tab selected
$tabs.tabs('option', 'active', 2); // switch to third tab

Thanks for your help.

How to recall a tab using script? For example, I want to link [Search] input in the header to a specific tab where results will be displayed. I cannot find which property or attribute needs to be used to swap tabs. In a previous design made with jqueryUI I use this code var $tabs = $('#tabsp').tabs(); // first tab selected $tabs.tabs('option', 'active', 2); // switch to third tab Thanks for your help.
Vote to pay developers attention to this features or issue.
6 Replies
Order By: Standard | Newest
Support Team
Support Team posted this 28 July 2020

Arno,

We are sorry for the delayed answer.
Here is the code which you can use to change the active tab:

var tabsControl = new TabsControl(neededTabEl); // neededTabEl - tabDom(.u-tab-item) which you need to activate
tabsControl.show();

...................................................
Sincerely,

Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Arno, We are sorry for the delayed answer. Here is the code which you can use to change the active tab: <code> var tabsControl = new TabsControl(neededTabEl); // neededTabEl - tabDom(.u-tab-item) which you need to activate tabsControl.show(); </code> ................................................... Sincerely, Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
arno68
3 Posts
arno68 posted this 20 April 2021

Hello, I cannot make this code working.
Can tell me where I'm wrong?

Extract from my page :
<script ---
--- var neededTabE1 = "#link-tab-9a34";

          var tabsControl = new TabsControl(neededTabE1); 
          tabsControl.show();

--- /script>

            <ul>
                <li class="u-tab-item u-tab-item-3" role="presentation">
                  <a class="u-active-palette-1-base u-border-2 u-border-palette-4-base u-button-style u-custom-font u-heading-font u-palette-2-base u-tab-link u-text-active-palette-4-base u-tab-link-3" id="tab-9a34" href="#link-tab-9a34" role="tab" aria-controls="link-tab-9a34" aria-selected="false">Coupon Réponse</a>
                </li>
            </ul>
              <div class="u-tab-content">
                  <div class="u-container-style u-tab-pane" id="link-tab-9a34" role="tabpanel" aria-labelledby="tab-9a34">

Error message from console
Uncaught TypeError: t.is is not a function

at TabsControl._getLink (nicepage.js:31)
at new TabsControl (nicepage.js:31)
at Object.AfficheFiche [as success] (Dieppe-Normandie.php:159)
at c (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at l (jquery.js:2)
at XMLHttpRequest.<anonymous> (jquery.js:2)

Thanks for your help

Hello, I cannot make this code working. Can tell me where I&#39;m wrong? Extract from my page : &lt;script --- --- var neededTabE1 = &quot;#link-tab-9a34&quot;; var tabsControl = new TabsControl(neededTabE1); tabsControl.show(); --- /script> <ul> <li class="u-tab-item u-tab-item-3" role="presentation"> <a class="u-active-palette-1-base u-border-2 u-border-palette-4-base u-button-style u-custom-font u-heading-font u-palette-2-base u-tab-link u-text-active-palette-4-base u-tab-link-3" id="tab-9a34" href="#link-tab-9a34" role="tab" aria-controls="link-tab-9a34" aria-selected="false">Coupon Réponse</a> </li> </ul> <div class="u-tab-content"> <div class="u-container-style u-tab-pane" id="link-tab-9a34" role="tabpanel" aria-labelledby="tab-9a34"> Error message from console Uncaught TypeError: t.is is not a function at TabsControl._getLink (nicepage.js:31) at new TabsControl (nicepage.js:31) at Object.AfficheFiche [as success] (Dieppe-Normandie.php:159) at c (jquery.js:2) at Object.fireWith [as resolveWith] (jquery.js:2) at l (jquery.js:2) at XMLHttpRequest.<anonymous> (jquery.js:2) Thanks for your help
kbosnar
2 Posts
kbosnar posted this 27 April 2021

Dear all I have a sane problem
This is my code
<div class>

      <ul class="u-tab-list u-unstyled" role="tablist">
        <li class="u-tab-item" role="presentation" >
          <a class="active u-active-white u-border-2 u-border-active-palette-2-base u-border-grey-15 u-border-hover-grey-15 u-border-no-bottom u-border-no-left u-border-no-right u-button-style u-grey-15 u-hover-grey-15 u-tab-link u-tab-link-1" id="link-tab-c9ac" href="#tab-c9ac" role="tab" aria-controls="tab-c9ac" aria-selected="true"><span class="u-icon"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" xml:space="preserve" class="u-svg-content" viewBox="0 -1 401.52289 401" style="width: 1em; height: 1em;"><path d="m370.589844 250.972656c-5.523438 0-10 4.476563-10 10v88.789063c-.019532 16.5625-13.4375 29.984375-30 30h-280.589844c-16.5625-.015625-29.980469-13.4375-30-30v-260.589844c.019531-16.558594 13.4375-29.980469 30-30h88.789062c5.523438 0 10-4.476563 10-10 0-5.519531-4.476562-10-10-10h-88.789062c-27.601562.03125-49.96875 22.398437-50 50v260.59375c.03125 27.601563 22.398438 49.96875 50 50h280.589844c27.601562-.03125 49.96875-22.398437 50-50v-88.792969c0-5.523437-4.476563-10-10-10zm0 0"></path><path d="m376.628906 13.441406c-17.574218-17.574218-46.066406-17.574218-63.640625 0l-178.40625 178.40625c-1.222656 1.222656-2.105469 2.738282-2.566406 4.402344l-23.460937 84.699219c-.964844 3.472656.015624 7.191406 2.5625 9.742187 2.550781 2.546875 6.269531 3.527344 9.742187 2.566406l84.699219-23.464843c1.664062-.460938 3.179687-1.34375 4.402344-2.566407l178.402343-178.410156c17.546875-17.585937 17.546875-46.054687 0-63.640625zm-220.257812 184.90625 146.011718-146.015625 47.089844 47.089844-146.015625 146.015625zm-9.40625 18.875 37.621094 37.625-52.039063 14.417969zm227.257812-142.546875-10.605468 10.605469-47.09375-47.09375 10.609374-10.605469c9.761719-9.761719 25.589844-9.761719 35.351563 0l11.738281 11.734375c9.746094 9.773438 9.746094 25.589844 0 35.359375zm0 0"></path></svg><img></span>
           &nbsp;Officials 
          </a>
        </li>


        <li class="u-tab-item" role="presentation">
          <a class="u-active-white u-border-2 u-border-active-palette-2-base u-border-grey-15 u-border-hover-grey-15 u-border-no-bottom u-border-no-left u-border-no-right u-button-style u-grey-15 u-hover-grey-15 u-tab-link u-tab-link-3" id="link-tab-0ee8" href="#tab-0ee8" role="tab" aria-controls="tab-0ee8" aria-selected="false"><span class="u-icon"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" xml:space="preserve" class="u-svg-content" viewBox="0 0 373.232 373.232" x="0px" y="0px" style="width: 1em; height: 1em;"><g><g><path d="M187.466,0c-0.1,0.1-0.3,0.1-0.6,0.1c-101.2,0-183.5,82.3-183.5,183.5c0,41.3,14.1,81.4,39.9,113.7l-26.7,62    c-2.2,5.1,0.2,11,5.2,13.1c1.8,0.8,3.8,1,5.7,0.7l97.9-17.2c19.6,7.1,40.2,10.7,61,10.6c101.2,0,183.5-82.3,183.5-183.5    C370.066,82.1,288.366,0.1,187.466,0z M186.466,346.6c-19.3,0-38.4-3.5-56.5-10.3c-1.7-0.7-3.5-0.8-5.3-0.5l-82.4,14.4l21.8-50.7    c1.5-3.5,0.9-7.6-1.6-10.5c-11.8-13.7-21.2-29.3-27.8-46.2c-7.4-18.9-11.2-39-11.2-59.3c0-90.2,73.4-163.5,163.5-163.5    c89.9-0.2,162.9,72.5,163,162.4c0,0.2,0,0.4,0,0.6C349.966,273.3,276.566,346.6,186.466,346.6z"></path>

<g><g><path d></path>
</g>
</g><g><g><path d></path>
</g>
</g><img> License details

          </a>
        </li>
      </ul>

And this is JavaScript code
var tabsControl = new TabsControl("tab-0ee8"); // neededTabEl - tabDom(.u-tab-item) which you need to activate
tabsControl.show();

And this is a error
Uncaught TypeError: t.is is not a function

at TabsControl._getLink (nicepage.js:40)
at new TabsControl (nicepage.js:36)
at deta (suci.html?id=324:381)
at HTMLInputElement.onclick (suci.html?id=324:1)

PLease advice, cose this is crucial part of my aplication
Thanks in advance

Dear all I have a sane problem This is my code &lt;div class&gt; <ul class="u-tab-list u-unstyled" role="tablist"> <li class="u-tab-item" role="presentation" > <a class="active u-active-white u-border-2 u-border-active-palette-2-base u-border-grey-15 u-border-hover-grey-15 u-border-no-bottom u-border-no-left u-border-no-right u-button-style u-grey-15 u-hover-grey-15 u-tab-link u-tab-link-1" id="link-tab-c9ac" href="#tab-c9ac" role="tab" aria-controls="tab-c9ac" aria-selected="true"><span class="u-icon"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" xml:space="preserve" class="u-svg-content" viewBox="0 -1 401.52289 401" style="width: 1em; height: 1em;"><path d="m370.589844 250.972656c-5.523438 0-10 4.476563-10 10v88.789063c-.019532 16.5625-13.4375 29.984375-30 30h-280.589844c-16.5625-.015625-29.980469-13.4375-30-30v-260.589844c.019531-16.558594 13.4375-29.980469 30-30h88.789062c5.523438 0 10-4.476563 10-10 0-5.519531-4.476562-10-10-10h-88.789062c-27.601562.03125-49.96875 22.398437-50 50v260.59375c.03125 27.601563 22.398438 49.96875 50 50h280.589844c27.601562-.03125 49.96875-22.398437 50-50v-88.792969c0-5.523437-4.476563-10-10-10zm0 0"></path><path d="m376.628906 13.441406c-17.574218-17.574218-46.066406-17.574218-63.640625 0l-178.40625 178.40625c-1.222656 1.222656-2.105469 2.738282-2.566406 4.402344l-23.460937 84.699219c-.964844 3.472656.015624 7.191406 2.5625 9.742187 2.550781 2.546875 6.269531 3.527344 9.742187 2.566406l84.699219-23.464843c1.664062-.460938 3.179687-1.34375 4.402344-2.566407l178.402343-178.410156c17.546875-17.585937 17.546875-46.054687 0-63.640625zm-220.257812 184.90625 146.011718-146.015625 47.089844 47.089844-146.015625 146.015625zm-9.40625 18.875 37.621094 37.625-52.039063 14.417969zm227.257812-142.546875-10.605468 10.605469-47.09375-47.09375 10.609374-10.605469c9.761719-9.761719 25.589844-9.761719 35.351563 0l11.738281 11.734375c9.746094 9.773438 9.746094 25.589844 0 35.359375zm0 0"></path></svg><img></span> &nbsp;Officials </a> </li> <li class="u-tab-item" role="presentation"> <a class="u-active-white u-border-2 u-border-active-palette-2-base u-border-grey-15 u-border-hover-grey-15 u-border-no-bottom u-border-no-left u-border-no-right u-button-style u-grey-15 u-hover-grey-15 u-tab-link u-tab-link-3" id="link-tab-0ee8" href="#tab-0ee8" role="tab" aria-controls="tab-0ee8" aria-selected="false"><span class="u-icon"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" xml:space="preserve" class="u-svg-content" viewBox="0 0 373.232 373.232" x="0px" y="0px" style="width: 1em; height: 1em;"><g><g><path d="M187.466,0c-0.1,0.1-0.3,0.1-0.6,0.1c-101.2,0-183.5,82.3-183.5,183.5c0,41.3,14.1,81.4,39.9,113.7l-26.7,62 c-2.2,5.1,0.2,11,5.2,13.1c1.8,0.8,3.8,1,5.7,0.7l97.9-17.2c19.6,7.1,40.2,10.7,61,10.6c101.2,0,183.5-82.3,183.5-183.5 C370.066,82.1,288.366,0.1,187.466,0z M186.466,346.6c-19.3,0-38.4-3.5-56.5-10.3c-1.7-0.7-3.5-0.8-5.3-0.5l-82.4,14.4l21.8-50.7 c1.5-3.5,0.9-7.6-1.6-10.5c-11.8-13.7-21.2-29.3-27.8-46.2c-7.4-18.9-11.2-39-11.2-59.3c0-90.2,73.4-163.5,163.5-163.5 c89.9-0.2,162.9,72.5,163,162.4c0,0.2,0,0.4,0,0.6C349.966,273.3,276.566,346.6,186.466,346.6z"></path> &lt;g&gt;&lt;g&gt;&lt;path d&gt;&lt;/path&gt; &lt;/g&gt; &lt;/g&gt;&lt;g&gt;&lt;g&gt;&lt;path d&gt;&lt;/path&gt; &lt;/g&gt; &lt;/g&gt;&lt;img&gt;&nbsp;License details </a> </li> </ul> And this is JavaScript code var tabsControl = new TabsControl("tab-0ee8"); // neededTabEl - tabDom(.u-tab-item) which you need to activate tabsControl.show(); And this is a error Uncaught TypeError: t.is is not a function at TabsControl._getLink (nicepage.js:40) at new TabsControl (nicepage.js:36) at deta (suci.html?id=324:381) at HTMLInputElement.onclick (suci.html?id=324:1) PLease advice, cose this is crucial part of my aplication Thanks in advance
kbosnar
2 Posts
kbosnar posted this 08 May 2021

Any answer please .
Negative answer also is answer.
I have to know how continue development.
BR

Any answer please . Negative answer also is answer. I have to know how continue development. BR
arno68
3 Posts
arno68 posted this 24 May 2021

Is there a chance that one day we could have an answer about this issue?

Is there a chance that one day we could have an answer about this issue?
Support Team
Support Team posted this 26 May 2021

Hi,

Please try the following code:

var tabsControl = new TabsControl($(neededTabE1));
tabsControl.show();

...................................................
Sincerely,
Susanna I.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1

Follow us on Facebook: http://facebook.com/nicepageapp

Hi, Please try the following code: <code> var tabsControl = new TabsControl($(neededTabE1)); tabsControl.show(); </code> ................................................... Sincerely, Susanna I. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp

Last edited 26 May 2021 by Support Team

You must log in or register to leave comments