Join Chris Converse for an in-depth discussion in this video Adding a setInterval for the timer, part of Creating a Marquee in WordPress with jQuery.
…Now, to have our marquee autoplay, or to detect when the screen size changes…from large to small, we're going to need…some kind of event that's going to continuously run.…So we're going to use a set interval.…We're also going to set up a function that's going to go and check all of…the states of all of the elements on the page, and update all the variables.…So to do this, let's switch back to our text editor, let's go into B snippets.…Lets scroll down, and lets find snippet 17, here I…have a custom function called marquee advance, so what we're…doing here, is we're first, checking the browser width, we're…going to set a temporary variable, so var, space, browser width.…
When we declare a variable inside of a function,…once this function runs, that variable will be deleted.…However, we can store those in our marqueeVars…object, so that we can keep them longer term.…So browser width, we're going to, again get the size…of the marquee width, then we are going to declare a…variable current size, and we are going to check it…
This course was created by Chris Converse. We're honored to host this training in our library.
- Adding photos to the Media Library
- Creating a custom post type
- Adding custom CSS to your theme
- Retrieving data from the custom post type
- Injecting HTML and navigation
- Styling the large and small marquees
- Reordering the marquee panels