-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from previousnext/add-fullscreen
Add fullscreen
- Loading branch information
Showing
6 changed files
with
95 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(function () { | ||
|
||
// Define variables. | ||
var $fullscreenLink = $('.kss-fullscreen__button'); | ||
var $fullscreen = $('.kss-fullscreen'); | ||
|
||
// Fullscreen is not active by default. | ||
var fullscreenActive = false; | ||
|
||
// Toggle fullscreen. | ||
var toggleFullscreen = function () { | ||
if (fullscreenActive) { | ||
$fullscreen.removeClass('is-fullscreen'); | ||
$fullscreenLink.removeClass('is-active').attr('aria-expanded', 'false'); | ||
} | ||
else { | ||
$fullscreen.addClass('is-fullscreen'); | ||
$fullscreenLink.addClass('is-active').attr('aria-expanded', 'true'); | ||
} | ||
fullscreenActive = !fullscreenActive; | ||
}; | ||
|
||
// Toggle fullscreen with click. | ||
$fullscreenLink.click(function () { | ||
toggleFullscreen(); | ||
return false; | ||
}); | ||
|
||
})(); |
Oops, something went wrong.