govuk_frontend_toolkit
Advanced tools
Comparing version 0.44.0 to 0.45.0
@@ -35,5 +35,7 @@ (function() { | ||
this.$extraLinks.addClass('visuallyhidden'); | ||
$(window).trigger('govuk.pageSizeChanged') | ||
}, | ||
showExtraLinks: function(){ | ||
this.$extraLinks.removeClass('visuallyhidden'); | ||
$(window).trigger('govuk.pageSizeChanged') | ||
} | ||
@@ -40,0 +42,0 @@ }; |
@@ -701,5 +701,33 @@ # GOV.UK Frontend Toolkit | ||
## Stick at top when scrolling | ||
`GOVUK.stickAtTopWhenScrolling` tries to add a class to an element when the top | ||
of that element would be scrolled out of the viewport. | ||
The following would cause the element to stay when you scroll: | ||
```html | ||
<div class="js-stick-at-top-when-scrolling">something</div> | ||
``` | ||
```css | ||
.content-fixed { | ||
position: fixed; | ||
top: 0; | ||
} | ||
.shim { | ||
display: block; | ||
} | ||
``` | ||
```javascript | ||
GOVUK.stickAtTopWhenScrolling.init(); | ||
``` | ||
If you also include the `stopScrollingAtFooter` JavaScript this will also try | ||
and stop the elements before they get to the bottom. | ||
## Licence | ||
Released under the MIT Licence, a copy of which can be found in the file `LICENCE`. |
{ | ||
"name": "govuk_frontend_toolkit", | ||
"version": "0.44.0", | ||
"version": "0.45.0", | ||
"description": "npm for govuk_frontend_toolkit", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
429012
138
654