2010-03-24 9 views
6

Estaba jugando con los elementos web de ASP.NET que tiene una div "desplegable". Está todo el camino a la derecha de la página. Cuando hago clic para abrirlo, desaparece de la ventana. Por lo general, cualquier elemento fuera del área visible activará las barras de desplazamiento inferiores. ¿Cómo es esto posible?Los divs HTML pueden salir de la ventana del navegador?

alt text http://i42.tinypic.com/4sejww.png

Editar: Es Internet Explorer 8. A continuación se muestra el marcado con un poco de contexto. El relevante creo que es id = WebPart_wp774658725VerbsMenu. Por defecto no se visualiza. Cuando haces clic en td/span Verbs/span VerbsPopup (podría ser cualquiera), muestra el "menú desplegable". En Developer Tools no veo ningún JavaScript adjunto a esos elementos, pero si lo depuro lo veo ejecutando algunos.

<TD class=partTitle> 
    <TABLE style="WIDTH: 100%" border=0 cellSpacing=0 cellPadding=0> 
    <TBODY> 
     <TR> 
     <TD style="WIDTH: 100%; WHITE-SPACE: nowrap; CURSOR: move" id=WebPartTitle_wp774658725><SPAN title="Billing Information">Billing Information</SPAN>&nbsp;</TD> 
     <TD style="WHITE-SPACE: nowrap"> 
      <SPAN style="PADDING-BOTTOM: 1px; PADDING-LEFT: 1px; PADDING-RIGHT: 1px; DISPLAY: inline-block; COLOR: white; CURSOR: hand; TEXT-DECORATION: none; PADDING-TOP: 1px" id=WebPart_wp774658725Verbs> 
      <SPAN style="FONT-FAMILY: Marlett; FONT-SIZE: 8pt" id=WebPart_wp774658725VerbsPopup>u</SPAN> 
      </SPAN> 
      <DIV style="DISPLAY: none" id=WebPart_wp774658725VerbsMenu> 
      <TABLE style="BORDER-BOTTOM: white 1px solid; BORDER-LEFT: white 1px solid; BACKGROUND-COLOR: maroon; WIDTH: 100%; BORDER-COLLAPSE: collapse; FONT-FAMILY: Arial; FONT-SIZE: 0.8em; BORDER-TOP: white 1px solid; BORDER-RIGHT: white 1px solid" cellSpacing=0 cellPadding=1> 
       <TBODY> 
       <TR> 
        <TD style="WHITE-SPACE: nowrap"> 
        <DIV> 
         <A class=menuItem title="Deletes 'Billing Information'" onclick="if(document.body.__wpmDeleteWarning.length == 0 || confirm(document.body.__wpmDeleteWarning)){document.body.__wpm.SubmitPage('WebFormDisplay1$MainPageWPZ', 'delete:wp774658725');}" href="javascript:void(0)"> 
         <IMG style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-TOP-STYLE: none; VERTICAL-ALIGN: middle; BORDER-LEFT-STYLE: none" alt="Deletes 'Billing Information'" src="/WebResource.axd?d=5L7XWTaglMPmXRe6NJDkRg2&amp;t=633802513995006876" width=16 height=16>&nbsp;Delete&nbsp; 
         </A> 
        </DIV> 
        </TD> 
       </TR> 
       </TBODY> 
      </TABLE> 
      </DIV> 
     </TD> 
     </TR> 
    </TBODY> 
    </TABLE> 
</TD> 


WebParts.js 
    function WebPartMenu_OnClick() { 
    var a = window.event.srcElement.__menu; 
    if (typeof a != "undefined" && a != null) { 
     cancelEvent(window.event); 
     a.Show() 
    } 
} 

function WebPartMenu_Show() { 
    if (typeof __wpm.menu != "undefined" && __wpm.menu != null) __wpm.menu.Hide(); 
    var e = "<html><head><style>" + "a.menuItem, a.menuItem:Link { display: block; padding: 1px; text-decoration: none; " + this.itemStyle + " }" + "a.menuItem:Hover { " + this.itemHoverStyle + " }" + '</style><body scroll="no" style="border: none; margin: 0; padding: 0;" ondragstart="window.event.returnValue=false;" onclick="popup.hide()">' + this.menuElement.innerHTML + "<body></html>", 
    b = 16, 
    c = 16; 
    this.popup = window.createPopup(); 
    __wpm.menu = this; 
    var d = this.popup.document; 
    d.write(e); 
    this.popup.show(0, 0, b, c); 
    var a = d.body; 
    b = a.scrollWidth; 
    c = a.scrollHeight; 
    if (b < this.menuLabelElement.offsetWidth) b = this.menuLabelElement.offsetWidth + 16; 
    if (this.menuElement.innerHTML.indexOf("progid:DXImageTransform.Microsoft.Shadow") != -1) a.style.paddingRight = "4px"; 
    a.__wpm = __wpm; 
    a.__wpmDeleteWarning = __wpmDeleteWarning; 
    a.__wpmCloseProviderWarning = __wpmCloseProviderWarning; 
    a.popup = this.popup; 
    this.popup.hide(); 
    this.popup.show(0, this.menuLabelElement.offsetHeight, b, c, this.menuLabelElement) 
} 
+0

Mostrar algo de tu código podría ayudar. – AxelEckenberger

+0

Sí, veo lo que quieres decir. La información sobre herramientas es parte del sistema operativo, por lo que es fácil de explicar. Sin embargo, no es tan fácil explicar el menú emergente. Tal vez es solo una ventana de la barra de herramientas/sin menú? –

+2

@Nelson: Eso es IE, ¿verdad? – Jeremy

Respuesta

0

¿Por qué no agregar un poco más al margen allí? Parece la manera más fácil y económica de ahorrar tiempo.

+0

Sí, eso no es un problema. Simplemente no entendía cómo salía de la ventana del navegador. –

Cuestiones relacionadas