Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
JUNCA24 RevealJS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PGI15-Teaching
JUNCA24 RevealJS
Commits
38b229a2
Commit
38b229a2
authored
13 years ago
by
Hakim El Hattab
Browse files
Options
Downloads
Patches
Plain Diff
tweaked mouse wheel navigation
parent
17854e89
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+4
-0
4 additions, 0 deletions
README.md
index.html
+4
-0
4 additions, 0 deletions
index.html
js/reveal.js
+28
-26
28 additions, 26 deletions
js/reveal.js
with
36 additions
and
26 deletions
README.md
+
4
−
0
View file @
38b229a2
...
...
@@ -33,6 +33,9 @@ Reveal.initialize({
// If true; each slide will be pushed to the browser history
history: true,
// Flags if mouse wheel navigation should be enabled
mouseWheel: true,
// Apply a 3D roll to links on hover
rollingLinks: true,
...
...
@@ -55,6 +58,7 @@ Reveal.initialize({
-
CSS is now much more explicit, rooted at #reveal, to prevent conflicts
-
Config option for disabling updates to URL, defaults to true
-
Anchors with image children no longer rotate in 3D on hover
-
Support for mouse wheel navigation (
[
naugtur
](
https://github.com/naugtur
)
)
#### 1.1
...
...
This diff is collapsed.
Click to expand it.
index.html
+
4
−
0
View file @
38b229a2
...
...
@@ -227,6 +227,9 @@
// If true; each slide will be pushed to the browser history
history
:
true
,
// Flags if mouse wheel navigation should be enabled
mouseWheel
:
true
,
// Apply a 3D roll to links on hover
rollingLinks
:
true
,
...
...
@@ -239,5 +242,6 @@
hljs
.
initHighlightingOnLoad
();
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/reveal.js
+
28
−
26
View file @
38b229a2
...
...
@@ -54,6 +54,7 @@ var Reveal = (function(){
history
:
false
,
transition
:
'
default
'
,
theme
:
'
default
'
,
mouseWheel
:
true
,
rollingLinks
:
true
},
...
...
@@ -70,7 +71,10 @@ var Reveal = (function(){
document
.
body
.
style
[
'
WebkitTransform
'
]
!==
undefined
||
document
.
body
.
style
[
'
MozTransform
'
]
!==
undefined
||
document
.
body
.
style
[
'
msTransform
'
]
!==
undefined
||
document
.
body
.
style
[
'
OTransform
'
]
!==
undefined
;
document
.
body
.
style
[
'
OTransform
'
]
!==
undefined
,
// Throttles mouse wheel navigation
mouseWheelTimeout
=
0
;
/**
* Starts up the slideshow by applying configuration
...
...
@@ -129,15 +133,15 @@ var Reveal = (function(){
dom
.
wrapper
.
classList
.
add
(
config
.
theme
);
}
if
(
config
.
mouseWheel
)
{
document
.
addEventListener
(
'
DOMMouseScroll
'
,
onDocumentMouseScroll
,
false
);
// FF
document
.
addEventListener
(
'
mousewheel
'
,
onDocumentMouseScroll
,
false
);
}
if
(
config
.
rollingLinks
)
{
// Add some 3D magic to our anchors
linkify
();
}
//bind scrolling
if
(
window
.
addEventListener
){
document
.
addEventListener
(
'
DOMMouseScroll
'
,
scrollStep
,
false
);
}
// Read the initial hash
readURL
();
...
...
@@ -251,6 +255,24 @@ var Reveal = (function(){
slide
();
}
}
/**
* Handles mouse wheel scrolling, throttled to avoid
* skipping multiple slides.
*/
function
onDocumentMouseScroll
(
event
){
clearTimeout
(
mouseWheelTimeout
);
mouseWheelTimeout
=
setTimeout
(
function
()
{
var
delta
=
event
.
detail
||
-
event
.
wheelDelta
;
if
(
delta
>
0
)
{
availableRoutes
().
down
?
navigateDown
()
:
navigateRight
();
}
else
{
availableRoutes
().
up
?
navigateUp
()
:
navigateLeft
();
}
},
100
);
}
/**
* Handler for the window level 'hashchange' event.
...
...
@@ -627,26 +649,6 @@ var Reveal = (function(){
}
}
var
stepT
=
0
;
function
scrollStep
(
e
){
clearTimeout
(
stepT
);
stepT
=
setTimeout
(
function
(){
if
(
e
.
detail
>
0
){
if
(
availableRoutes
().
down
){
navigateDown
()
}
else
{
navigateRight
()
}
}
else
{
if
(
availableRoutes
().
up
){
navigateUp
()
}
else
{
navigateLeft
()
}
}
},
200
);
}
// Expose some methods publicly
return
{
initialize
:
initialize
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment