On Thu, Mar 5, 2009 at 7:49 AM, HM-User <m.lawrencehu...@gmail.com> wrote:
>
> I have had a look at this tutorial by Malsup and simply, you can add
> an a link to the image slides.
> However, for me like the tutorial with:
>
> function onAfter() {
>    $('#output').html("Current anchor: " + this.href);
>
> I have for myself:
>
> before: onBefore,
> pager: '#featurenav'
> });
> function onBefore() {
> jQuery('#headline').html(this.alt);
> }
> });
>
> The image slides are held within a div and it is simply: <a
> href=""><img src="" alt="something" /></a>.
>
> But adding the a link to the img src tag does not make the alt text
> appear but the image does link. How can I get the a link to the image
> AND the alt text to appear as well?

I don't know what tutorial you're referring to but it looks to me like
you should have something like:

$(this).attr('alt')

However, does this refer to the img or the link? In the onAfter
function it appears to be the link. Try:

$(this).find('img').attr('alt')

and, for onAfter():

$(this).attr('href')

Reply via email to