1

I'd like to use the tocify jquery script. In this simple page it doesn't work as expected with Firefox 38.0.1.

It should display a small table of contents in the #toc div. Generated from the scanned tags in the body. But if I render this page in Firefox, nothing happens. It just displays the 'hello' & 'hello2' without the table of contents that tocify is supposed to generate.

Am I doing something wrong in this html code?

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="description" content="">
        <meta name="author" content="">

        <!-- Tocify - nice dynamic autoscrolling TOC -->
        <link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.tocify/1.9.0/stylesheets/jquery.tocify.min.css" rel="stylesheet">
        <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tocify/1.9.0/javascripts/jquery.tocify.min.js"></script>

        <script type="text/javascript">
        $(document).ready(function() {

                var toc = $("#toc").tocify({
                    scrollTo : 50,
                    extendPage : true,
                    selectors : "h1,h2,h3,h4,h5",
                    showEffect : "fadeIn"
                });

            });
        </script>
    </head>
    <body>
            <div id="toc" ></div>

            <h2 id="hello">Hello</h2>
            <h2 id="hello2">Hello2</h2>
    </body>
</html>
Mosh Feu
  • 28,354
  • 16
  • 88
  • 135
Mark
  • 590
  • 7
  • 17
  • "it doesn't work" isn't enough. What happens exactly ? What is this supposed to do ? Please edit question and describe. – kebs May 27 '15 at 11:23
  • 1
    Done, I described what should be rendered by the tocify jquery plugin. – Mark May 27 '15 at 11:32

0 Answers0