Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now

Solution: Create a pause screen


From:

HTML5 Projects: Creating a Responsive Presentation

with Justin Putney

Video: Solution: Create a pause screen

Here's the solution I came up with. It is in the browser right now. And I'm just going to hit the W key on my keyboard and then it fades to white. Hit the W key again. It comes right back. And this works on any slide. Hit the W key. And fades back in when I hit it again so the way I started to think about this was first of all what is it I'm wanting to change or hide. You know, it's easiest to just hide something and display what's behind it and so in this case, if I hid an individual slide, I'm going to see the background for the slides container, which is this gradient, and I want to go to white.
please wait ...
Watch the Online Video Course HTML5 Projects: Creating a Responsive Presentation
1h 25m Intermediate Jun 26, 2013

Viewers: in countries Watching now:

Follow along with author Justin Putney as he uses open technologies (HTML5, jQuery, and CSS) to create a dynamic presentation slideshow that responds to mobile and desktop layouts. Learn to customize the slideshow to fit your next project, and to display artwork, photography, and other kinds of content.

Discover how to structure the HTML and slide content; design the navigation to react to clicks, keyboard input, and swipe gestures; and use CSS to customize the slide display for different screens and animated transitions. Justin also includes a series of challenge-and-solution pairs to test your skills.

Then, when you're ready, watch the HTML5 Projects: Creating an Advanced Responsive Presentation follow-up course to enhance your web presentation slides with audio, video, and an automatic playback feature.

Topics include:
  • Structuring an HTML5 slideshow
  • Creating the default slide appearance
  • Using jQuery to display the current page
  • Adding swipe gestures for mobile
  • Creating a pause screen
  • Translating your ideas into CSS
  • Using media queries to adjust the layout
Subjects:
Developer Web
Software:
HTML CSS
Author:
Justin Putney

Solution: Create a pause screen

Here's the solution I came up with. It is in the browser right now. And I'm just going to hit the W key on my keyboard and then it fades to white. Hit the W key again. It comes right back. And this works on any slide. Hit the W key. And fades back in when I hit it again so the way I started to think about this was first of all what is it I'm wanting to change or hide. You know, it's easiest to just hide something and display what's behind it and so in this case, if I hid an individual slide, I'm going to see the background for the slides container, which is this gradient, and I want to go to white.

Well, what's white? Well, the body by default of the HTML document is white, and that's sitting behind that. So why don't I just go ahead and hide the whole slide container, that's simpler. So I was kind of working with that thought to begin with. And one of the first things I needed to do was get the key code for the W key. So I came back down here to the type something field in the handy dandy key up documentation of jQuery. Hit the W key. Found the key code was 87 so that's good. We'll use that in a moment.

And then I started to think, you know, how do I go about turning, not only hiding it but then showing again, and I remember jQuery is able to toggle things. So I just went looking for this function of toggle visibility. I thought maybe there's a toggle visibility because there's, you know, multiple things you want to toggle. So I didn't find anything. The next step, I put a space in there. I thought, you know, maybe that'll be more inclusive. And lo and behold I found the toggle function. Display or hide the matched elements. So that sounds like exactly what I want.

And there's a bunch different ways to implement the toggle function. I can apply a duration and get a complete function as a call back. I could pass an object with several options in it. And I just kept scrolling as I was looking at this and oh, I could say show or hide. Well, that's useful, that's what I'm looking for and I read this and said, you know, just calling it with no parameters toggles the visibility of the elements. Oh, so that's perfect, that's what I'm looking for. I'll switch over to Dreamweaver and show you how I did that.

So, here's the completed code. I'm going to roll it back and show you what it looked like at the point we're at. So I just plopped on another else if statement and put my key code in as 87. And so I grab this whole slides container object and what I said was toggle. I'm just going to save that and switch back. And so you can see what this looks like when I hit the W key, it just goes to white. Hit it again, and it comes back. So then I did some more searching in the documentation and I thought, you know, that's kind of abrupt, maybe just a nice little fade would work. And jQuery happens to have a function that does this. I could also just pass a duration in there, but I'll save that and then I'll refresh it and I'm going to hit the W key and there it is, a nice fade. So that was just one line of code.

If we wanted to fade to black, maybe we'd have either another object or we would set the background color of the body to black or something like that. That would be the only difference. Really, it's pretty simple and we could do that with just another line here and go back to our key up and we just look for what the V key code would be. So you can see there's a lot of flexibility there. You can do a lot with that and it doesn't necessarily take a lot of code.

There are currently no FAQs about HTML5 Projects: Creating a Responsive Presentation.

 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

* Estimated file size

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.


Mark all as unwatched Cancel

Congratulations

You have completed HTML5 Projects: Creating a Responsive Presentation.

Return to your organization's learning portal to continue training, or close this page.


OK

Upgrade to View Courses Offline

login

With our new Desktop App, Annual Premium Members can download courses for Internet-free viewing.

Upgrade Now

After upgrading, download Desktop App Here.

Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Start your FREE 10-day trial

Begin learning software, business, and creative skills—anytime,
anywhere—with video instruction from recognized industry experts.
lynda.com provides
Unlimited access to over 4,000 courses—more than 100,000 video tutorials
Expert-led instruction
On-the-go learning. Watch from your computer, tablet, or mobile device. Switch back and forth as you choose.
Start Your FREE Trial Now
 

A trusted source for knowledge.

 

We provide training to more than 4 million people, and our members tell us that lynda.com helps them stay ahead of software updates, pick up brand-new skills, switch careers, land promotions, and explore new hobbies. What can we help you do?

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.