Reputation: 49
i have this code for implementing tab for the website
<span style=" float: left; width: 131px; padding: 8px 0px 8px 0px;color: #fff; font-size: 20px;background: none; text-align: left; margin: 0% 0% 0% 9%;" > 6 more steps :</span>
<input type="radio" name="sky-tabs" checked="" id="sky-tab1" class="sky-tab-content-1">
<label for="sky-tab1"><span><span> <i class="fa fa-angle-double-right"></i> Travel Data
</span></span></label>
<input type="radio" name="sky-tabs" id="sky-tab2" class="sky-tab-content-2">
<label for="sky-tab2"><span><span> <i class="fa fa-angle-double-right"></i> Hotels
</span></span></label>
<input type="radio" name="sky-tabs" id="sky-tab3" class="sky-tab-content-3">
<label for="sky-tab3"><span><span> <i class="fa fa-angle-double-right"></i> Activities
</span></span></label>
<input type="radio" name="sky-tabs" id="sky-tab4" class="sky-tab-content-4">
<label for="sky-tab4"><span><span> <i class="fa fa-angle-double-right"></i> Transfers
</span></span></label>
<input type="radio" name="sky-tabs" id="sky-tab5" class="sky-tab-content-5">
<label for="sky-tab5"><span><span> <i class="fa fa-angle-double-right"></i> Summary
</span></span></label>
<input type="radio" name="sky-tabs" id="sky-tab6" class="sky-tab-content-6">
<label for="sky-tab6"><span><span> Payment
</span></span></label>
Then I have required information for each tab in rest of the section. And I have buttons like this inside each tab --
<div class="total_price_list_ft">
<a href="#">Proceed to Activities <i class="fa fa-long-arrow-right"></i></a>
</div>
<div class="total_price_list_ft_rt">
<a href="#"> <i class="fa fa-long-arrow-left"></i> Back to Travel Data</a>
</div>
How Can i implement tab change function here on button click ?
Please guide.
Upvotes: 0
Views: 6928
Reputation: 418
You can write the JQuery Function
$('input[name=sky-tabs]).click(function{
#Write the code specfic to the tab here
});
Upvotes: 0
Reputation: 208
You can use the onclick
event
href="javascript:void(0)" onclick = "$('#sky-tab2').click();
where sky-tab1,2,3, .. is the id.
Upvotes: 0
Reputation: 10307
You can add Tabs from JQuery UI or even considering using Bootstrap!
Bootstrap has support for tabs too. Bootstrap Javacript
Hope I helped.
Upvotes: 0