ability to make links to inner tabs
This commit is contained in:
parent
b1d5b27913
commit
9bf67e67b5
|
@ -1,3 +1,5 @@
|
||||||
|
var queryData;
|
||||||
|
|
||||||
$('#listLeft ul li a').live("click", function() {
|
$('#listLeft ul li a').live("click", function() {
|
||||||
if ($(this).hasClass("listLeftSelected")) {
|
if ($(this).hasClass("listLeftSelected")) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -281,8 +283,8 @@ $(function() {
|
||||||
var State = History.getState();
|
var State = History.getState();
|
||||||
// console.log(State);
|
// console.log(State);
|
||||||
|
|
||||||
|
|
||||||
var queryData = QueryStringToJSON(State.hash);
|
queryData = QueryStringToJSON(State.hash);
|
||||||
|
|
||||||
doState(queryData);
|
doState(queryData);
|
||||||
|
|
||||||
|
|
|
@ -159,30 +159,31 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
|
||||||
//When page loads...
|
//When page loads...
|
||||||
$(".tab_content").hide(); //Hide all content
|
$(".tab_content").hide(); //Hide all content
|
||||||
$("ul.tabsInnerRight li:first").addClass("active").show(); //Activate first tab
|
// $("ul.tabsInnerRight li:first").addClass("active").show(); //Activate first tab
|
||||||
var State = History.getState();
|
|
||||||
// console.log(State);
|
|
||||||
var queryData = QueryStringToJSON(State.hash); //FIXME: ideally this would go into global doState function
|
|
||||||
if (queryData.hasOwnProperty("innertab")) {
|
|
||||||
if ($('#' + queryData.innerTab).length > 0) {
|
|
||||||
$('#' + queryData.innerTab).show();
|
|
||||||
} else {
|
|
||||||
$('.tab_content:first').show();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$(".tab_content:first").show(); //Show first tab content
|
|
||||||
}
|
|
||||||
//On Click Event
|
//On Click Event
|
||||||
$("ul.tabsInnerRight li").click(function() {
|
$("ul.tabsInnerRight li").click(function() {
|
||||||
$("ul.tabsInnerRight li").removeClass("active"); //Remove any "active" class
|
$(".active").removeClass("active"); //Remove any "active" class
|
||||||
$(this).addClass("active"); //Add "active" class to selected tab
|
$(this).addClass("active"); //Add "active" class to selected tab
|
||||||
$(".tab_content").hide(); //Hide all tab content
|
$(".tab_content").hide(); //Hide all tab content
|
||||||
var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
|
var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
|
||||||
$(activeTab).fadeIn(); //Fade in the active ID content
|
$(activeTab).fadeIn(); //Fade in the active ID content
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
// var queryData = {};
|
||||||
|
|
||||||
|
if (queryData.hasOwnProperty("innertab")) {
|
||||||
|
if ($('#' + queryData.innertab).length > 0) {
|
||||||
|
$('a[href=#' + queryData.innertab + "]").click();
|
||||||
|
} else {
|
||||||
|
$('ul.tabsInnerRight li:first').click();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$('ul.tabsInnerRight li:first').click(); //Show first tab content
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user