Revision 2786:c8c1321cd582,
1.6 KB
checked in by franck <carnet.franck.paul@…>, 11 years ago
(diff) |
ARIA role="button" is not necessary on <button…> tag
|
Rev | Line | |
---|
[2640] | 1 | |
---|
| 2 | <script type="text/javascript"> |
---|
| 3 | $("html").addClass("js"); |
---|
| 4 | // Show/Hide main menu |
---|
| 5 | $(".header__nav"). |
---|
[2786] | 6 | before('<button id="hamburger" type="button"><span class="visually-hidden">Navigation</span></button>'). |
---|
[2640] | 7 | toggle(); |
---|
| 8 | $("#hamburger").click(function(){ |
---|
| 9 | $(this).toggleClass("open"); |
---|
| 10 | $(".header__nav").toggle('easing'); |
---|
| 11 | }); |
---|
| 12 | // Show/Hide sidebar on small screens |
---|
[2786] | 13 | $("#main").prepend('<button id="offcanvas-on" type="button"><span class="visually-hidden">Show menu</span></button>'); |
---|
[2640] | 14 | $("#offcanvas-on").click(function(){ |
---|
[2786] | 15 | var btn = $('<button id="offcanvas-off" type="button"><span class="visually-hidden">Hide menu</span></button>'); |
---|
[2640] | 16 | $("#wrapper").addClass("off-canvas"); |
---|
[2673] | 17 | $("#footer").addClass("off-canvas"); |
---|
[2640] | 18 | $("#sidebar").prepend(btn); |
---|
| 19 | btn.click(function(evt){ |
---|
| 20 | $("#wrapper").removeClass("off-canvas"); |
---|
[2673] | 21 | $("#footer").removeClass("off-canvas"); |
---|
[2640] | 22 | evt.target.remove(); |
---|
| 23 | }); |
---|
| 24 | }); |
---|
| 25 | $(document).ready(function(){ |
---|
| 26 | // totop scroll |
---|
| 27 | $(window).scroll(function() { |
---|
| 28 | if($(this).scrollTop() != 0) { |
---|
| 29 | $('#gotop').fadeIn(); |
---|
| 30 | } else { |
---|
| 31 | $('#gotop').fadeOut(); |
---|
| 32 | } |
---|
| 33 | }); |
---|
| 34 | |
---|
| 35 | $('#gotop').click(function() { |
---|
| 36 | $('body,html').animate({scrollTop:0},800); |
---|
| 37 | }); |
---|
| 38 | }); |
---|
| 39 | </script> |
---|
| 40 | <!-- |
---|
| 41 | Todo: |
---|
| 42 | Off-canvas |
---|
| 43 | Passer les chaînes de caractères en variables pour les traductions. |
---|
| 44 | --> |
---|
Note: See
TracBrowser
for help on using the repository browser.