I have created some form tabs using the block-display list item. Again, I have next and previous buttons, HTML is something like this: jquery is like this: However, I want to put a condition, i.e. Do not change the tab if there is no list item. If the user is already on 1 tab, then killing I am doing this: I tried this condition but it does not matter: What is the correct way to do this? Count any type of variable, which clicks the user on the previous or next, increases or decreases is. Something like this: Keep track of such number of tab numbers, and the user does not do anything on the first tab already. Then check that it is not the last to go to the next tab $ ('# wiznext') and
$ ('# wizprev') . Whenever the next click is done, the next list is selected in the tab list, and the appropriate items are completed.
& lt; Ul id = 'tab' & gt; & Lt; Li & gt; Tab 1 & lt; / Li & gt; & Lt; Li & gt; Tab 2 & lt; / Li & gt; ...
$ ('# wizprev'). Click (function () (switchTab ($ current.prev) ('li'). Attr ('id'))}}
previous should do nothing.
if ($ current.prev ('li'). Length & Gt; 0) Switch tab ($ current.prev ('li'). Attr ('id'));
var tabCounter = 1; $ ('# Wizprev') Click (function () {if (tab quarters> 1) {tabCounter--; switchTab ($ current.prev ('li').} ('Id'))}} $ ('# wiznext'). Click (function () {if (tabCounter & lt; $ ('# current li'). Length) {tabCounter ++; switchTab ($ current.next ('li') attr ('id').);} });
No comments:
Post a Comment