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

Keep panel in screen view

Expand Messages
  • Frank Apap
    Hi, I have a snippet of code that is used to show a panel when a icon is clicked (the popup is next to the icon). However in cases where the icon is near the
    Message 1 of 3 , Jul 2, 2007
    • 0 Attachment
      Hi,

      I have a snippet of code that is used to show a panel when a icon is
      clicked (the popup is next to the icon). However in cases where the
      icon is near the side of the screen, how can I control that it pops up
      in the current view?

      Thanks.
    • Caridy Patiño Mayea
      Hi Frank, You can use the property constraintoviewport , and the overlay control will keep visible in the current viewport. var o = new
      Message 2 of 3 , Jul 2, 2007
      • 0 Attachment
        Hi Frank,

        You can use the property "constraintoviewport", and the overlay
        control will keep visible in the current viewport.

        var o = new YAHOO.widget.Overlay(el, { constraintoviewport:true } );

        Regards
        Caridy (caridy at gmail.com)
        http://bubbling.comarq.com/

        --- In ydn-javascript@yahoogroups.com, "Frank Apap" <fsa3@...> wrote:
        >
        > Hi,
        >
        > I have a snippet of code that is used to show a panel when a icon is
        > clicked (the popup is next to the icon). However in cases where the
        > icon is near the side of the screen, how can I control that it pops up
        > in the current view?
        >
        > Thanks.
        >
      • Frank Apap
        Thanks for the reply. I m already using constraintoviewport. What I see is when my panel initially pops up it is off to the side of the screen, but as soon
        Message 3 of 3 , Jul 3, 2007
        • 0 Attachment
          Thanks for the reply. I'm already using constraintoviewport. What I
          see is when my panel initially pops up it is off to the side of the
          screen, but as soon as I go to move it the viewport constraint takes
          effect. It's like I need to enforce the viewport constraint BEFORE it
          renders (or something like that).

          here is my JS:

          <script>
          function initHelpItem7()
          {
          // Instantiate a Panel from markup
          var panel7 = new YAHOO.widget.Panel("H7", { width:"330px",
          visible:false,
          effect:
          {effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25},
          constraintoviewport:true }
          );


          panel7.render();

          document.getElementById("H7").style.display ="";

          YAHOO.util.Event.addListener("show7", "click", panel7.show,
          panel7, true);
          );
          }
          YAHOO.util.Event.addListener(window, "load", initHelpItem7);
          </script>

          Thnx,

          --- In ydn-javascript@yahoogroups.com, Caridy Patiño Mayea
          <caridy@...> wrote:
          >
          > Hi Frank,
          >
          > You can use the property "constraintoviewport", and the overlay
          > control will keep visible in the current viewport.
          >
          > var o = new YAHOO.widget.Overlay(el, { constraintoviewport:true } );
          >
          > Regards
          > Caridy (caridy at gmail.com)
          > http://bubbling.comarq.com/
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.