Skip to main content

Jquery UI Nested Tabs Tutorial

jquery ui tabs with subtabs

Hi guys

This post will give you example of jquery ui nested tabs example . Here you will learn jquery ui sub tabs example. This tutorial will give you simple example of example of jquery ui tabs with subtabs. This tutorial will give you simple example of jquery ui tabs with subtabs.

In this blog, I will explain how to create nested tabs in jquery ui.we will show example of jquery ui nested tabs.I will jquery ui using create nested tabs.tabs view In other tab view create using jquery ui.We will make sub tabs using jquery and jqueryUi.I will show easy example of jquery ui sub tabs.

Here the example of jquery ui nested tabs.

Example

Now this nested tabs html design code:


<!DOCTYPE html>
<html>
<head>
<title>Jquery UI Nested Tabs Example</title>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<script data-require="jquery@2.1.1" data-semver="2.1.1" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script data-require="jquery-ui@1.10.4" data-semver="1.10.4" src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<style type="text/css">
.fix {
background: green;
background: rgba(0,255,0,0.3);
}
.broken {
background: red;
background: rgba(255,0,0,0.3);
}
</style>
<body>
<p>
Tabs below is working how we expect it. It opens tab2 and subtab2 on a pageload.
</p>
<div class="tabs fix">
<ul>
<li>
<a href="#tabs-1">Tab 1</a>
</li>
<li>
<a href="#tabs-2">Tab 2</a>
</li>
<li>
<a href="#tabs-3">Tab 3</a>
</li>
</ul>
<div class="tabContainer">
<div id="tabs-1" class="tabContent">
<p>Some content 1.</p>
</div>
<div id="tabs-2" class="tabContent">
<div class="subtabs">
<ul>
<li><a href="#subtab1">Subtab1</a></li>
<li><a href="#subtab2">Subtab2</a></li>
</ul>
<div id="subtab1" class="subtabContent">
Some sub content1
</div>
<div id="subtab2" class="subtabContent">
Some sub content2
</div>
</div>
</div>
<div id="tabs-3" class="tabContent">
<p>Some content 3</p>
</div>
</div>
</div>
</body>
</html>
blow the nested tabs of jqueryui script code add:


<script type="text/javascript">
// Code goes here
$(document).ready(function() {
jQuery( ".tabs" ).tabs();
jQuery( ".subtabs" ).tabs();

openParentTab();
});
function openParentTab() {
locationHash = location.hash.substring( 1 );
console.log(locationHash);
// Check if we have an location Hash
if (locationHash) {
// Check if the location hash exsist.
var hash = jQuery('#'+locationHash);
if (hash.length) {
// Check of the location Hash is inside a tab.
if (hash.closest(".tabContent").length) {
// Grab the index number of the parent tab so we can activate it
var tabNumber = hash.closest(".tabContent").index();
jQuery(".tabs.fix").tabs({ active: tabNumber });
// Not need but this puts the focus on the selected hash
hash.get(0).scrollIntoView();
setTimeout(function() {
hash.get(0).scrollIntoView();
}, 1000);
}
}
}
}
</script>

It will help you...

Comments

Popular posts from this blog

Laravel Scout Algolia Full Text Search Example

Hi Guys Today,I will tell how you can full text search utilizing scout algolia. i will show the example of laravel scout algolia full text search.you can full text search utilizing scout algolia api.it can this example full expound scout algolia full text search. I will show the rudimental step of scout algolia api full text search.if you can utilize full text search for install scout and Algolia api package.we are utilizing algolia api utilizing full text search example in laravel. Here the following steps example laravel full text search Using scout algolia Step 1: Create Laravel Project In this step create laravel project following command. composer create-project --prefer-dist laravel/blog Step 2: Database Configuration After create laravel project , we require to make database configuration, you have to add following details on your .env file. 1.Database Username 1.Database Password 1.Database Name In .env file also available host and port details, you can configu

Laravel IP Address Using Get Location Example

Hi Dev, Today,I will learn you how to get location useing ip address in laravel. we will show example of laravel ip address using get location. you can easy to get location useing ip address in laravel.In this example, I will useing stevebauman/location packege get location useing ip address in laravel. Many time you will need to get visitor's details for security, spam prevention etc. It's very easy to get visitor ip address and their location in PHP Laravel. Step 1: Install stevebauman/location Now, We will install stevebauman/location package using below command.Require this package with composer. It is recommended to only require the package for development. composer require stevebauman/location Step 2: Add providers and aliases In this step,We will add below providers and aliases in the "config/app.php" file. config/app.php 'providers' => [ .... Stevebauman\Location\LocationServiceProvider::class, ], 'aliases' => [ .... 'Loca

Laravel 6 validation required if another field is empty

Hii guys, In this artical, i will give you example of laravel 6 in validation required if another field is empty. We know laravel provide several in-built laravel 6 validation required_without . If you need to add validation rules like required if other field is empty in laravel then you can do it using required_without. I am going to explain you, If you can not enter test (field) value at that time test1 (field) is required. So at that time you can add validation required_without. So, you can use this way: "test1" =>"required_without:test" Example: public function store(Request $request) { $request->validate([ "test" =>"required", "test1" =>"required_without:test" ]); dd("Done!"); } If return validation error otherwise show Done!. It will help you...