Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
my-cucumbers-ru-github-io
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
Лотуга Данила Сергеевич
my-cucumbers-ru-github-io
Commits
ce5a4178
Commit
ce5a4178
authored
Jul 18, 2011
by
Vadim Makeev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
currentSlide function added
parent
5481f4f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
script.js
scripts/script.js
+9
-6
No files found.
scripts/script.js
View file @
ce5a4178
...
...
@@ -27,7 +27,7 @@
}
function
turnSlide
(
e
)
{
var
current
=
slideList
.
indexOf
(
url
.
hash
.
substr
(
1
)
),
target
;
var
current
=
currentSlide
(
),
target
;
if
(
e
)
{
if
(
e
.
type
==
'keydown'
)
{
var
prevent
=
true
;
...
...
@@ -104,21 +104,24 @@
function
isFull
()
{
return
url
.
search
.
substr
(
1
)
==
'full'
;
}
function
currentSlide
()
{
return
slideList
.
indexOf
(
url
.
hash
.
substr
(
1
));
}
function
updateProgress
()
{
if
(
!
progress
)
return
;
progress
.
style
.
width
=
(
100
/
(
slideList
.
length
-
1
)
*
slideList
.
indexOf
(
url
.
hash
.
substr
(
1
)
)).
toFixed
(
2
)
+
'%'
;
progress
.
style
.
width
=
(
100
/
(
slideList
.
length
-
1
)
*
currentSlide
(
)).
toFixed
(
2
)
+
'%'
;
}
window
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
if
(
isFull
())
enterFull
();
},
false
);
window
.
addEventListener
(
"popstate"
,
function
()
{
var
current_slide_number
=
slideList
.
indexOf
(
url
.
hash
.
substr
(
1
));
if
(
-
1
===
current_slide_number
)
{
exitFull
();
}
window
.
addEventListener
(
'popstate'
,
function
()
{
if
(
-
1
===
currentSlide
())
exitFull
();
},
false
);
document
.
addEventListener
(
'keydown'
,
turnSlide
,
false
);
document
.
addEventListener
(
'keydown'
,
enterFullKey
,
false
);
})();
})();
\ No newline at end of file
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