Page 1 of 1

Event for tabclick?

Posted: Fri May 29, 2020 9:24 pm
by ARWEN
HI,

I want to know when the first tab is clicked to show the save button. when the 2nd tab is selected, the save button will disappear.

I attached a click event to nuTab0

Code: Select all

$("#nuTab0").click(function(){
    nuShow('nuSaveButton');
});  
but that leads to an error "Maximum call stack size exceeded"

Because nuShow() calls nuOpenTab() which calls again $('#nuTab' + i).click() ....

Call stack: Click ->nuShow() --> nuOpenTab() -> $('#nuTab' + i).click() --> Click .... --> Uncaught RangeError: Maximum call stack size exceeded

How to solve this?

Re: Event for tabclick?

Posted: Sat May 30, 2020 8:36 am
by admin
ARWEN,

Try this...

Code: Select all

$("#nuTab0").click(function(){
    $('#nuSaveButton').show();
}); 

Steven

Re: Event for tabclick?

Posted: Sat May 30, 2020 9:35 am
by ARWEN
Thanks!! It was so easy, and yet I didn't think of it.

Re: Event for tabclick?

Posted: Tue Jun 02, 2020 3:01 am
by admin
Cool.