Make region_1 table of contents "unsticky" when width is less than 768px for better mobile support.
This commit is contained in:
parent
3c0358c9cf
commit
812ac259e2
11
doc/toc.html
11
doc/toc.html
@ -407,12 +407,21 @@
|
|||||||
tocUl.removeClass(); // Classes are automatically added to <ul> elements by something else
|
tocUl.removeClass(); // Classes are automatically added to <ul> elements by something else
|
||||||
tocUl.toc({content: "#doco-content", headings: "h1"});
|
tocUl.toc({content: "#doco-content", headings: "h1"});
|
||||||
tocUl.addClass('toc-content sub-menu');
|
tocUl.addClass('toc-content sub-menu');
|
||||||
if( $(window).height() > 499) {
|
tocUl.attr('id', 'doco-side-toc');
|
||||||
|
if( $(window).width() > 768) {
|
||||||
tocUl.sticky({topSpacing:$('nav').outerHeight(true), zIndex: 1000});
|
tocUl.sticky({topSpacing:$('nav').outerHeight(true), zIndex: 1000});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$( window ).resize(function() {
|
||||||
|
if($(window).width() < 768 ) {
|
||||||
|
$( "#doco-side-toc" ).unstick();
|
||||||
|
} else {
|
||||||
|
$( "#doco-side-toc" ).sticky({topSpacing:$('nav').outerHeight(true), zIndex: 1000});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user