kdubbie
23 Jun 2010, 07:37 AM
Hi, kind of new to Jquery and I was wondering if someone can tell me the best way to do this.
I have an <UL>, and I want different content to appear underneath the list in a separate <div> when each line item is clicked...(For example, if one of the <li> were apples, when it's clicked I would want the content underneath to be a paragraph on apples and with a picture of an apple.)
The unordered list is pretty long, about 18 bullets all together, so that's a lot of content. I was first thinking about hiding each of the divs and then with absolute positioning, make them appear when clicking their corresponding <li>...
But it seems like that would be a lot content on one page....So I was thinking about an AJAX call...Having a separte HTML file for each of the content, and then use the load(); function to populate an empty div on the page...To me that seemed a little more organized, but again I'm new to this and not sure if populating a separate HTML file in the middle of page is good or bad or totally fine.
I'd like to do this in JQuery, but open to suggestions of PHP.
Thanks a lot
I have an <UL>, and I want different content to appear underneath the list in a separate <div> when each line item is clicked...(For example, if one of the <li> were apples, when it's clicked I would want the content underneath to be a paragraph on apples and with a picture of an apple.)
The unordered list is pretty long, about 18 bullets all together, so that's a lot of content. I was first thinking about hiding each of the divs and then with absolute positioning, make them appear when clicking their corresponding <li>...
But it seems like that would be a lot content on one page....So I was thinking about an AJAX call...Having a separte HTML file for each of the content, and then use the load(); function to populate an empty div on the page...To me that seemed a little more organized, but again I'm new to this and not sure if populating a separate HTML file in the middle of page is good or bad or totally fine.
I'd like to do this in JQuery, but open to suggestions of PHP.
Thanks a lot