cycle - trying to use anchor and captions together
I am trying to have photos cycle and have captions, with a a href on both the photo and the caption.
I want the caption to contain both the produt title as well as the description, seperate so I can format each differently.
This is what I have right now:
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
- <script type="text/javascript" src="http://malsup.github.com/chili-1.7.pack.js"></script>
- <script type="text/javascript" src="http://malsup.github.com/jquery.cycle.all.js"></script>
- <script type="text/javascript" src="http://malsup.github.com/jquery.easing.1.3.js"></script>
- <script>
- $('#slideshow').cycle({
- fx: 'fade',
- timeout: 2000,
- after: onAfter
- });
- function onAfter() {
- $('#producttitle').html(this.title + this.alt)
- }
- </script>
And down in the body:
- <div id="slideshow" class="pics">
- <a href="images/products/0125.jpg" title="Product Name" alt="This lovely bag is something you want to buy."><img src="images/products/0125.jpg" width="200" title="" alt="Product Name" /></a>
- <a href="images/products/0126.jpg" title="Product Name 2" alt="This lovely bag is something you want to buy as well."><img src="images/products/0126.jpg" width="200" alt="Product Name 2" /></a>
- <a href="images/products/0127.jpg" title="Product Name 3" alt="Have you bought this yet? You should"><img src="images/products/0127.jpg" width="200" alt="Product Name 3" /></a>
- <a href="images/products/01281.jpg" title="Product Name 4" alt="Please buy something. We love it."><img src="images/products/01281.jpg" width="200" alt="Product Name 4" /></a>
- </div>
- <div id="producttitle"></div>
- <div id="productdescription"></div>
I can get producttitle to display but alt comes back as undefined.
Thank you for any help.