Alright, now we can take a look at what I came up with.…This is in the Chapter 3 folder of the exercise files under 04_Solution in the…final folder, and I'm going to go to the js folder and open up pres.js.…So, at the top I just created a variable called loop and set it to true.…And then if you scroll down to the go to function.…So, what I did here was to take the existing functionality and just wrap it in…an else clause. So, this is the code that says, you know,…that makes sure that we stay within the first screen and within the last screen,…of course. And if that's true, we set the…currentSlide and we move on from there. And if that isn't true, it just kind of…fails and exits the function. So that's in an else clause.…
And now we have this if clause, and that runs if we have loops set to true.…So if loop is set to true, and we happen to go below zero, well then we just…want to go to the last slide, so essentially we're on the first screen,…we're going backwards. We just want to make sure currentSlide…
Author
Released
6/26/2013Need more information on creating an initial web presentation? Watch the related HTML5 Projects: Creating a Responsive Presentation course.
- Embedding a Twitter feed in an iframe
- Creating the code for automatic playback
- Using MediaElement.js in your presentation
- Adding video and audio
Skill Level Advanced
Duration
Views
Related Courses
-
Deke's Techniques
with Deke McClelland155h 53m Intermediate
-
Introduction
-
Welcome42s
-
-
1. Understanding the Project
-
2. Enhancing the Slideshow
-
3. Creating a Self-Running Slideshow
-
Adding bullet timing3m 32s
-
4. Adding Audio and Video
-
Adding video10m 38s
-
5. Finalizing the Self-Running Mobile Presentation
-
Custom tweaks for iPad9m 39s
-
6. Enabling Offline Playback
-
Conclusion
-
Next steps40s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Solution: Creating a loop