Join Chris Converse for an in-depth discussion in this video Dynamically injecting divs for the Q and A graphics, part of Creating an Expandable FAQ Listing with jQuery and Dreamweaver.
Now to add divs into a every one of the questions for the Q and the A…letters, let's come back over to our faq.js.…Inside of the document ready after we've defined our click function that gets…attached to every one of the faq_question classes,…let's add a return. Let's start with dollar sign, beginning and…ending parentheses.…Inside of the parentheses we're going to type two tick marks for string…literal, .faq.…Outside of the parentheses, we're going to type .each, beginning and ending…parentheses, semicolon.…
Inside of each we're going to type function, beginning and ending parentheses,…beginning and ending brackets. Let's split that open.…So we're going to search for every time there's an faq div.…Every time we find one we're going to type dollar sign, parentheses, this,….append, beginning and ending parentheses, semicolon.…Inside of append two tick marks for a string literal.…So what append is going to do is add anything inside of the string literal into…each one of the faq items.…
So here we're going to type some HTML.…
- Creating project folders
- Adding in sample question and answer content
- Creating CSS rules for graphics
- Animating the graphic states