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

YAHOO.widget.Dialog Locating Issues

Expand Messages
  • Dale Burrell
    Hi, I ve got a piece of generic code that I use for displaying a dialog box using the Dialog widget and on 1 site it displays fine and on another site (exactly
    Message 1 of 5 , May 3, 2009
    • 0 Attachment
      Hi,

      I've got a piece of generic code that I use for displaying a dialog box using the Dialog widget and on 1 site it displays fine and on another site (exactly the same javascript!) displays at the bottom of the page rather than at the top.

      [code]
      DialogObject.Window = new YAHOO.widget.Dialog(
      'MyDialog',
      {
      fixedcenter : false
      , visible : true
      , constraintoviewport : true
      , modal : true
      , x : 10
      , y : 50
      }
      );
      [/code]

      When I inspect the HTML (Firebug) on the site where its wrongly positioned the div style looks like this:

      [code]style="visibility: visible; left: 10px; top: 416px; z-index: 2;"[/code]

      and on the site where its correct:

      [code]style="visibility: visible; left: 10px; top: 50px; z-index: 2;"[/code]

      Does anyone have any ideas about why this might be happening? I'm not doing anything else that affects the position - at least not that I know of.

      Cheers,

      Dale
    • Dale Burrell
      OK - no ideas about this? Can someone tell me the *correct* way to set the x & y positions in code but once I ve created the Dialog? I currently have a hack
      Message 2 of 5 , May 4, 2009
      • 0 Attachment
        OK - no ideas about this?

        Can someone tell me the *correct* way to set the x & y positions in code but once I've created the Dialog?

        I currently have a hack that looks for the DIV which has the wrong height and sets it to the correct height - which works! But I'd rather do this using the *proper* interface if possible. I've played around with setting the x, y config after creation but so far haven't got it to work.

        CHeers,

        Dale

        --- In ydn-javascript@yahoogroups.com, "Dale Burrell" <coolkiwibloke@...> wrote:
        >
        > Hi,
        >
        > I've got a piece of generic code that I use for displaying a dialog box using the Dialog widget and on 1 site it displays fine and on another site (exactly the same javascript!) displays at the bottom of the page rather than at the top.
        >
        > [code]
        > DialogObject.Window = new YAHOO.widget.Dialog(
        > 'MyDialog',
        > {
        > fixedcenter : false
        > , visible : true
        > , constraintoviewport : true
        > , modal : true
        > , x : 10
        > , y : 50
        > }
        > );
        > [/code]
        >
        > When I inspect the HTML (Firebug) on the site where its wrongly positioned the div style looks like this:
        >
        > [code]style="visibility: visible; left: 10px; top: 416px; z-index: 2;"[/code]
        >
        > and on the site where its correct:
        >
        > [code]style="visibility: visible; left: 10px; top: 50px; z-index: 2;"[/code]
        >
        > Does anyone have any ideas about why this might be happening? I'm not doing anything else that affects the position - at least not that I know of.
        >
        > Cheers,
        >
        > Dale
        >
      • Dale Burrell
        Well strangly enough using the moveTo() method after adding the content put it in the correct spot. I can t think why this would be necessary but it solves the
        Message 3 of 5 , May 19, 2009
        • 0 Attachment
          Well strangly enough using the moveTo() method after adding the content put it in the correct spot. I can't think why this would be necessary but it solves the problem for now.


          From: Dale Burrell <coolkiwibloke@...>
          To: ydn-javascript@yahoogroups.com
          Sent: Tuesday, 5 May, 2009 2:44:37 PM
          Subject: [ydn-javascript] Re: YAHOO.widget.Dialog Locating Issues

          OK - no ideas about this?

          Can someone tell me the *correct* way to set the x & y positions in code but once I've created the Dialog?

          I currently have a hack that looks for the DIV which has the wrong height and sets it to the correct height - which works! But I'd rather do this using the *proper* interface if possible. I've played around with setting the x, y config after creation but so far haven't got it to work.

          CHeers,

          Dale

          --- In ydn-javascript@ yahoogroups. com, "Dale Burrell" <coolkiwibloke@ ...> wrote:
          >
          > Hi,
          >
          > I've got a piece of generic code that I use for displaying a dialog box using the Dialog widget and on 1 site it displays fine and on another site (exactly the same javascript!) displays at the bottom of the page rather than at the top.
          >
          > [code]
          > DialogObject. Window = new YAHOO.widget. Dialog(
          > 'MyDialog',
          > {
          > fixedcenter : false
          > , visible : true
          > , constraintoviewport : true
          > , modal : true
          > , x : 10
          > , y : 50
          > }
          > );
          > [/code]
          >
          > When I inspect the HTML (Firebug) on the site where its wrongly positioned the div style looks like this:
          >
          > [code]style= "visibility: visible; left: 10px; top: 416px; z-index: 2;"[/code]
          >
          > and on the site where its correct:
          >
          > [code]style= "visibility: visible; left: 10px; top: 50px; z-index: 2;"[/code]
          >
          > Does anyone have any ideas about why this might be happening? I'm not doing anything else that affects the position - at least not that I know of.
          >
          > Cheers,
          >
          > Dale
          >


          Reading this email at work? Make a change with Yahoo!Xtra Jobs
        • Satyen Desai
          Hey Dale, I replied to your offline message with some suggestions. ... Try 2 things as a test: a). Disable constraintoviewport b). Render the Dialog to
          Message 4 of 5 , May 20, 2009
          • 0 Attachment
            Hey Dale,

            I replied to your offline message with some suggestions.

            Here's the response again:

            ---

            Try 2 things as a test:

            a). Disable constraintoviewport
            b). Render the Dialog to document.body [ if not currently doing so ]

            and see if you get consistent behavior across both pages.

            It appears to either be the fact that the constraintoviewport:true setting is not allowing the Dialog to be positioned at 10, 50 because that position doesn't lie within the viewport when the Dialog is created/rendered (it maybe due to the fact that the document is scrolled), or that you're rendering it inside an element which may be getting repositioned after the Dialog's X/Y position is set.

            ---

            If you could provide me with a URL to look at, we could get to the bottom of this really quickly.

            Thanks,
            Satyen


            --- In ydn-javascript@yahoogroups.com, Dale Burrell <coolkiwibloke@...> wrote:
            >
            > Well strangly enough using the moveTo() method after adding the content put it in the correct spot. I can't think why this would be necessary but it solves the problem for now.
            >
            >
            >
            > ________________________________
            > From: Dale Burrell <coolkiwibloke@...>
            > To: ydn-javascript@yahoogroups.com
            > Sent: Tuesday, 5 May, 2009 2:44:37 PM
            > Subject: [ydn-javascript] Re: YAHOO.widget.Dialog Locating Issues
            >
            >
            >
            >
            >
            > OK - no ideas about this?
            >
            > Can someone tell me the *correct* way to set the x & y positions in code but once I've created the Dialog?
            >
            > I currently have a hack that looks for the DIV which has the wrong height and sets it to the correct height - which works! But I'd rather do this using the *proper* interface if possible. I've played around with setting the x, y config after creation but so far haven't got it to work.
            >
            > CHeers,
            >
            > Dale
            >
            > --- In ydn-javascript@ yahoogroups. com, "Dale Burrell" <coolkiwibloke@ ...> wrote:
            > >
            > > Hi,
            > >
            > > I've got a piece of generic code that I use for displaying a dialog box using the Dialog widget and on 1 site it displays fine and on another site (exactly the same javascript!) displays at the bottom of the page rather than at the top.
            > >
            > > [code]
            > > DialogObject. Window = new YAHOO.widget. Dialog(
            > > 'MyDialog',
            > > {
            > > fixedcenter : false
            > > , visible : true
            > > , constraintoviewport : true
            > > , modal : true
            > > , x : 10
            > > , y : 50
            > > }
            > > );
            > > [/code]
            > >
            > > When I inspect the HTML (Firebug) on the site where its wrongly positioned the div style looks like this:
            > >
            > > [code]style= "visibility: visible; left: 10px; top: 416px; z-index: 2;"[/code]
            > >
            > > and on the site where its correct:
            > >
            > > [code]style= "visibility: visible; left: 10px; top: 50px; z-index: 2;"[/code]
            > >
            > > Does anyone have any ideas about why this might be happening? I'm not doing anything else that affects the position - at least not that I know of.
            > >
            > > Cheers,
            > >
            > > Dale
            > >
            >
          • Dale Burrell
            Hi Satyen, Yes you did - thanks for that - much appreciated - I had been going to investigate further, but now that I have found a way to solve the problem
            Message 5 of 5 , May 20, 2009
            • 0 Attachment
              Hi Satyen,
               
              Yes you did - thanks for that - much appreciated - I had been going to investigate further, but now that I have found a way to solve the problem using the correct methods I will now have to put it aside as I can't afford the further time to investigate.
               
              Thanks again.
               
              Cheers,
               
              Dale


              From: Satyen Desai <sdesai@...>
              To: ydn-javascript@yahoogroups.com
              Sent: Thursday, 21 May, 2009 5:20:06 AM
              Subject: [ydn-javascript] Re: YAHOO.widget.Dialog Locating Issues

              Hey Dale,

              I replied to your offline message with some suggestions.

              Here's the response again:

              ---

              Try 2 things as a test:

              a). Disable constraintoviewport
              b). Render the Dialog to document.body [ if not currently doing so ]

              and see if you get consistent behavior across both pages.

              It appears to either be the fact that the constraintoviewport :true setting is not allowing the Dialog to be positioned at 10, 50 because that position doesn't lie within the viewport when the Dialog is created/rendered (it maybe due to the fact that the document is scrolled), or that you're rendering it inside an element which may be getting repositioned after the Dialog's X/Y position is set.

              ---

              If you could provide me with a URL to look at, we could get to the bottom of this really quickly.

              Thanks,
              Satyen

              --- In ydn-javascript@ yahoogroups. com, Dale Burrell <coolkiwibloke@ ...> wrote:

              >
              > Well strangly enough using the moveTo() method after adding the content put it in the correct spot. I can't think why this would be necessary but it solves the problem for now.
              >
              >
              >
              > ____________ _________ _________ __
              > From: Dale Burrell <coolkiwibloke@ ...>
              > To: ydn-javascript@ yahoogroups. com
              > Sent: Tuesday, 5 May, 2009 2:44:37 PM
              > Subject: [ydn-javascript] Re: YAHOO.widget. Dialog Locating Issues
              >
              >
              >
              >
              >
              > OK - no ideas about this?
              >
              > Can someone tell me the *correct* way to set the x & y positions in code but once I've created the Dialog?
              >
              > I currently have a hack that looks for the DIV which has the wrong height and sets it to the correct height - which works! But I'd rather do this using the *proper* interface if possible. I've played around with setting the x, y config after creation but so far haven't got it to work.
              >
              > CHeers,
              >
              > Dale
              >
              > --- In ydn-javascript@ yahoogroups. com, "Dale Burrell" <coolkiwibloke@ ...> wrote:
              > >
              > > Hi,
              > >
              > > I've got a piece of generic code that I use for displaying a dialog box using the Dialog widget and on 1 site it displays fine and on another site (exactly the same javascript!) displays at the bottom of the page rather than at the top.
              > >
              > > [code]
              > > DialogObject. Window = new YAHOO.widget. Dialog(
              > > 'MyDialog',
              > > {
              > > fixedcenter : false
              > > , visible : true
              > > ,
              constraintoviewport : true
              > > , modal : true
              > > , x : 10
              > > , y : 50
              > > }
              > > );
              > > [/code]
              > >
              > > When I inspect the HTML (Firebug) on the site where its wrongly positioned the div style looks like this:
              > >
              > > [code]style= "visibility: visible; left: 10px; top: 416px; z-index: 2;"[/code]
              > >
              > > and on the site where its correct:
              > >
              > > [code]style= "visibility: visible; left: 10px; top: 50px; z-index: 2;"[/code]
              > >
              > > Does anyone have any ideas about why this might be happening? I'm not doing anything else that affects the position - at least not that I know of.
              > >
              > > Cheers,
              > >
              > > Dale
              > >
              >


              Reading this email at work? Make a change with Yahoo!Xtra Jobs
            Your message has been successfully submitted and would be delivered to recipients shortly.