Implementation of semantic ui sidebar

Hello, how do I implement the sidebar from the semantics of ui? I would like to use the first example on the list.

http://semantic-ui.com/modules/sidebar.html#/definition

I tried copying the entire div section and putting it in my html. For javascript (? Not quite sure),

$('.left.demo.sidebar')
.sidebar('toggle')
;

I tried to put its onclick button and functions using href to call but the sidebar doesn’t show .. what am I doing wrong

+4
source share
2 answers

You must include the library jQueryin the section <head></head>on the page:

<script language="javascript" src="http://code.jquery.com/jquery.min.js"></script>

And file semantic.js:

<script language="javascript" src="[your path here]/semantic.js"></script>

What you need to download from:

http://semantic-ui.com/

( dist. src )


BETWEEN <head></head>:

<script language="javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script language="javascript" src="[your path here]/semantic.js"></script>

<script type="text/javascript">

    $(document).ready(function() {
        $('.left.demo.sidebar').sidebar('toggle');
    });

</script>
+4

jQuery , , .js :

$('.element.to.trigger.sidebar').on('click', function () {
   $('.left.demo.sidebar')
      .sidebar('toggle');
});
0

All Articles