Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shower-presentation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Шардт Максим Александрович
shower-presentation
Commits
0249e947
Commit
0249e947
authored
Sep 15, 2013
by
Thierry Marianne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mousewheel event listener
parent
31d74111
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
shower.js
shower.js
+36
-0
No files found.
shower.js
View file @
0249e947
...
@@ -774,6 +774,38 @@ window.shower = window.shower || (function(window, document, undefined) {
...
@@ -774,6 +774,38 @@ window.shower = window.shower || (function(window, document, undefined) {
return
'#'
+
shower
.
slideList
[
slideNumber
].
id
;
return
'#'
+
shower
.
slideList
[
slideNumber
].
id
;
};
};
/**
* Wheel event listener
* @param e event
*/
shower
.
wheel
=
function
(
e
)
{
var
body
=
document
.
querySelector
(
'body'
),
wheelDown
,
lockedWheel
=
body
.
getAttribute
(
'data-scroll'
)
===
'locked'
;
if
(
!
lockedWheel
&&
!
shower
.
isListMode
())
{
body
.
setAttribute
(
'data-scroll'
,
'locked'
);
if
(
e
.
deltaY
===
undefined
)
{
// Chrome, Opera, Safari
wheelDown
=
e
.
wheelDeltaY
<
0
;
}
else
{
// Firefox
wheelDown
=
e
.
deltaY
>
0
;
}
if
(
wheelDown
)
{
shower
.
_turnNextSlide
();
}
else
{
shower
.
_turnPreviousSlide
();
}
setTimeout
(
function
()
{
body
.
setAttribute
(
'data-scroll'
,
'unlocked'
);
},
200
);
}
}
// Event handlers
// Event handlers
window
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
window
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
...
@@ -950,6 +982,10 @@ window.shower = window.shower || (function(window, document, undefined) {
...
@@ -950,6 +982,10 @@ window.shower = window.shower || (function(window, document, undefined) {
}
}
},
false
);
},
false
);
document
.
addEventListener
(
'wheel'
,
shower
.
wheel
,
false
);
document
.
addEventListener
(
'mousewheel'
,
shower
.
wheel
,
false
);
return
shower
;
return
shower
;
})(
this
,
this
.
document
);
})(
this
,
this
.
document
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment