JavaScript/jQuery TabPanel - Control the Behavior

An end user can switch the views by swiping them or selecting tabs. Note that tab navigation is always enabled, while swiping is active only on touch devices by default. To enable it on all types of devices, assign true to the swipeEnabled property. Otherwise, assign false.

JavaScript
HTML
  • $(function() {
  • $('#tabPanelContainer').dxTabPanel({
  • // ...
  • swipeEnabled: false
  • });
  • });
  • <div id="tabPanelContainer"></div>

You can switch the views progrmmatically using the selectedIndex or selectedItem property.

JavaScript
HTML
  • $(function() {
  • $('#tabPanelContainer').dxTabPanel({
  • // ...
  • selectedIndex: 1
  • });
  • });
  • <div id="tabPanelContainer"></div>

The TabPanel can loop the views, which enables an end user to swipe through the last view to the first and vice versa. To enable this behavior, set the loop property to true.

JavaScript
HTML
  • $(function() {
  • $('#tabPanelContainer').dxTabPanel({
  • // ...
  • loop: false
  • });
  • });
  • <div id="tabPanelContainer"></div>

To specify whether or not to animate switching between views, use the animationEnabled property.

JavaScript
HTML
  • $(function() {
  • $('#tabPanelContainer').dxTabPanel({
  • // ...
  • animationEnabled: true
  • });
  • });
  • <div id="tabPanelContainer"></div>
See Also