0

overlay updating and repositioning

My application contains a list of words on the left side of the window. When a user clicks on one of them, an overlay pops up on the right side of the window displaying an image of a handwritten sample of the word. The overlay is positioned on the same y position as the clicked-on word. I want the overlay to be flushed right. Each image is a different size so I get the width of the image and the width of the viewport, do a little calculation and position the overlay in the x direction to make it flush right. The problem is that the width of the image I get seems to be the width of the previous image, before the src attribute was changed. If the same word is clicked twice, then the math works and the image is properly positioned. Is there some event that I can listen to, to know when the overlay image src update has completed so I can determine the proper width?

by
0 Replies
  • Hi Paul, I'm not fully sure I understand what component / api / feature you're talking about. Can you please provide specifics on what you're using (i.e. a YUI component)?

    Thanks,
    Jon

    QUOTE (Paul Woods @ May 3 2009, 09:59 PM) <{POST_SNAPBACK}>
    My application contains a list of words on the left side of the window. When a user clicks on one of them, an overlay pops up on the right side of the window displaying an image of a handwritten sample of the word. The overlay is positioned on the same y position as the clicked-on word. I want the overlay to be flushed right. Each image is a different size so I get the width of the image and the width of the viewport, do a little calculation and position the overlay in the x direction to make it flush right. The problem is that the width of the image I get seems to be the width of the previous image, before the src attribute was changed. If the same word is clicked twice, then the math works and the image is properly positioned. Is there some event that I can listen to, to know when the overlay image src update has completed so I can determine the proper width?
    0

Recent Posts

in General Discussion at YDN