Loading ...
Sorry, an error occurred while loading the content.

image captions

Expand Messages
  • suydammy
    I m trying to do image captions. I show a set of thumbnails. OnClick I use YAHOO.util.Dom.setStyle to change the backgroundImage of a div that s large enough
    Message 1 of 2 , Mar 8, 2006
    • 0 Attachment
      I'm trying to do image captions.

      I show a set of thumbnails. OnClick I use YAHOO.util.Dom.setStyle to
      change the backgroundImage of a div that's large enough to hold the
      images in my slideshow.

      What I'm trying to do now is add captions.
      I have the captions stored in the title attribute of the thumbnail.

      Essentially like this:
      <img id='Image0' src='adfasfasd' title='The caption is this'>

      On click I set the div's background image, and try to get the title of
      Image0 by calling:

      Yahoo.util.Dom.getStyle('Image0','title');

      This doesn't work. What am I doing wrong, and does anyone have a
      suggested URL to list the attributes that I can get with getStyle?

      Thanks!
    • Michael Battista
      Try this: document.getElementById( Image0 ).getAttribute( title ); ... __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo!
      Message 2 of 2 , Mar 8, 2006
      • 0 Attachment
        Try this:

        document.getElementById('Image0').getAttribute('title');

        --- suydammy <suydammy@...> wrote:

        > I'm trying to do image captions.
        >
        > I show a set of thumbnails. OnClick I use
        > YAHOO.util.Dom.setStyle to
        > change the backgroundImage of a div that's large
        > enough to hold the
        > images in my slideshow.
        >
        > What I'm trying to do now is add captions.
        > I have the captions stored in the title attribute of
        > the thumbnail.
        >
        > Essentially like this:
        > <img id='Image0' src='adfasfasd' title='The
        > caption is this'>
        >
        > On click I set the div's background image, and try
        > to get the title of
        > Image0 by calling:
        >
        > Yahoo.util.Dom.getStyle('Image0','title');
        >
        > This doesn't work. What am I doing wrong, and does
        > anyone have a
        > suggested URL to list the attributes that I can get
        > with getStyle?
        >
        > Thanks!
        >
        >
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        > ydn-javascript-unsubscribe@yahoogroups.com
        >
        >
        >
        >
        >


        __________________________________________________
        Do You Yahoo!?
        Tired of spam? Yahoo! Mail has the best spam protection around
        http://mail.yahoo.com
      Your message has been successfully submitted and would be delivered to recipients shortly.