Skip to content

Commit

Permalink
fix(toc/tocjs): display on phone and fix js
Browse files Browse the repository at this point in the history
  • Loading branch information
J9rem committed Oct 19, 2021
1 parent b181968 commit 6095a40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tools/toc/actions/toc.php
Expand Up @@ -107,7 +107,7 @@ function translate2toc($text)
var diff = divLocation.top - initialoffset;
// A la fin du chargement de la page, on positionne la table a la bonne position
$(window).load(function () {
$(window).on('load',function () {
if ($(document).scrollTop() > divLocation.top) {
offset = ($(document).scrollTop() - initialoffset + 20 ) + 'px';
toc.animate({top:offset}, {duration:500,queue:false});
Expand Down
6 changes: 6 additions & 0 deletions tools/toc/actions/tocjs.php
Expand Up @@ -118,6 +118,12 @@
#tocjs-'.$tag.'.affix {
top : '.$offset.'px
}
@media (max-width:768px){
#tocjs-'.$tag.'.affix {
right: 5px;
}
}
#tocjs-'.$tag.' ol {
list-style:none;
Expand Down

0 comments on commit 6095a40

Please sign in to comment.