Join Chris Converse for an in-depth discussion in this video Assigning click events to the navigation, part of Creating a Marquee in WordPress with jQuery.
…Now we're going to assign some click events to our…navigation items, so let's go back to our text editor.…Let's go into the b snippets.html file.…Let's find snippet 23.…So, here we're going to run a jQuery statement against the marquee nav element.…We're going to search for every div inside of the marquee nav,…and we're going to assign a click event to each one of those.…Then we're going to declare a variable called navClicked, that's going to equal…this which refers to the navigation item that has been clicked.…We're going to use the index function…which is going to count which navigation item.…
So,zero for the first one, one for the second, two and three.…Then what we're going to do is we're going to run an if…statement, a conditional to see if the variable called inTransition is true.…If it is not true, with the exclamation point…here, what we're going to do is we're going to set the…current panel to whatever the navClicked item is plus one…and nav click equals the index of the item clicked.…We're going to set the in transition to true.…
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