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

RE: [ydn-javascript] Re: How do I auto hide a YUI Calendar?

Expand Messages
  • Satyen Desai
    Hi Bach, A couple of other standalone alternatives (slightly older calendar code but the event handling aspects stay the same):
    Message 1 of 5 , Feb 4, 2008
    • 0 Attachment

      Hi Bach,

      A couple of other standalone alternatives (slightly older calendar code but the event handling aspects stay the same):

       

      http://blog.davglass.com/files/yui/cal2/ (uses mouseover/out)

      http://yuiblog.com/sandbox/yui/v230/examples/calendar/popupExample.html (leverages event bubbling)

       

      I believe the button code example uses bubbling also internally (listens for click or mousdown at the document level) but instead of stopping propagation to the document as in the bubbling example above, it lets the event bubble up to the document, determines if the event target was inside the popup calendar, and hides or doesn’t, based on that (needs the changePageEvent listener set up, to handle the prev/next icons – because they get re-drawn when the page changes, resulting in the event target getting lost).

       

      Hope that helps,

      Satyen

       

       


      From: ydn-javascript@yahoogroups.com [mailto: ydn-javascript@yahoogroups.com ] On Behalf Of Bach Le
      Sent: Monday, January 28, 2008 10:57 AM
      To: ydn-javascript@yahoogroups.com
      Subject: [ydn-javascript] Re: How do I auto hide a YUI Calendar?

       

      Hello everyone,

      I bookmarked the link eric provided but now that I look back at it,
      I'm a little confused by the example. In the example, there isn't any
      code that governs when the calendar is hidden.

      When a user clicks on the button, the calendar is shown and when the
      user clicks away, the calendar is hidden but where in the source code
      is this handled?

      My situation is also a bit different, I'm using an image instead of a
      button. I suppose it change be changed but if it can be done without
      changing it to a button, that would be great.

      Thanks in advance.

      -Bach

      --- In ydn-javascript@ yahoogroups. com, "Bach Le" <eternal-dragon@ ...>
      wrote:

      >
      > Eric, thanks for all the help. It was exactly what I needed.
      >
      > -Bach
      >
      > --- In ydn-javascript@ yahoogroups. com,
      Eric Miraglia <miraglia@> wrote:
      > >
      > > Bach,
      > >
      > > This example demonstrates the interaction you are describing:
      > >
      > >
      href="http://developer.yahoo.com/yui/examples/button/btn_example09.html">http://developer. yahoo.com/ yui/examples/ button/btn_ example09. html
      > >
      > > Regards,
      > > Eric
      > >
      > >
      > > ____________ _________ _________ _________ _______
      > > Eric Miraglia
      > > Yahoo! User Interface Library
      > >
      > >
      > >
      > > On Jan 8, 2008, at 10:17 AM, Bach Le wrote:
      > >
      > > > I am integrating the YUI calendar into a website and the
      calendar is
      > > > triggered by clicking on an image.
      > > >
      > > > When a user clicks on this image, a calendar will pop up. I've
      tried
      > > > various combinations of events but I can't seem to get it right.
      I'd
      > > > like to have the calendar automatically hide whenever I click
      > > > elsewhere on the page.
      > > >
      > > > Does any one know if this is possible and how I would go about
      > > > implementing it?
      > > >
      > > > Thanks.
      > > >
      > > >
      > > >
      > >
      >

    Your message has been successfully submitted and would be delivered to recipients shortly.