다음을 통해 공유


Menu.DisappearAfter 속성

정의

마우스 포인터가 메뉴 위에 더 이상 배치되지 않은 후 동적 메뉴가 표시되는 기간을 가져오거나 설정합니다.

public:
 property int DisappearAfter { int get(); void set(int value); };
[System.Web.UI.Themeable(false)]
public int DisappearAfter { get; set; }
[<System.Web.UI.Themeable(false)>]
member this.DisappearAfter : int with get, set
Public Property DisappearAfter As Integer

속성 값

마우스 포인터가 메뉴 위에 더 이상 배치되지 않은 후 동적 메뉴가 표시되는 시간(밀리초)입니다. 기본값은 500입니다.

특성

예외

선택한 값이 -1보다 작습니다.

예제

다음 코드 예제에서는 사용자가 마우스 포인터를 메뉴에서 2초 이상 이동한 후 동적 메뉴가 사라지도록 지정하는 속성을 사용하는 DisappearAfter 방법을 보여 줍니다.


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>Menu DisappearAfter Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu DisappearAfter Example</h3>
    
      <!-- Use the DisappearAfter property to  -->
      <!-- hide the dynamic menu items if the  -->
      <!-- user moves the mouse pointer away   -->
      <!-- from the menu for two seconds.      -->
      <asp:menu id="NavigationMenu"
        disappearafter="2000"
        staticdisplaylevels="1"
        orientation="Vertical"   
        runat="server">
      
        <items>
          <asp:menuitem navigateurl="~\Home.aspx" 
            text="Home"/>
          <asp:menuitem navigateurl="~\Music.aspx"
            text="Music">
            <asp:menuitem navigateurl="~\Classical.aspx" 
              text="Classical"/>
            <asp:menuitem navigateurl="~\Rock.aspx"
              text="Rock"/>
            <asp:menuitem navigateurl="~\Jazz.aspx"
              text="Jazz"/>
          </asp:menuitem>
          <asp:menuitem navigateurl="~\Movies.aspx"
            text="Movies">
            <asp:menuitem navigateurl="~\Action.aspx"
              text="Action"/>
            <asp:menuitem navigateurl="~\Drama.aspx"
              text="Drama"/>
            <asp:menuitem navigateurl="~\SciFi.aspx"
              text="Science Fiction"/>
          </asp:menuitem>
        </items>
      
      </asp:menu>

    </form>
  </body>
</html>

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>Menu DisappearAfter Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu DisappearAfter Example</h3>
    
      <!-- Use the DisappearAfter property to  -->
      <!-- hide the dynamic menu items if the  -->
      <!-- user moves the mouse pointer away   -->
      <!-- from the menu for two seconds.      -->
      <asp:menu id="NavigationMenu"
        disappearafter="2000"
        staticdisplaylevels="1"
        orientation="Vertical"   
        runat="server">
      
        <items>
          <asp:menuitem navigateurl="~\Home.aspx" 
            text="Home"/>
          <asp:menuitem navigateurl="~\Music.aspx"
            text="Music">
            <asp:menuitem navigateurl="~\Classical.aspx" 
              text="Classical"/>
            <asp:menuitem navigateurl="~\Rock.aspx"
              text="Rock"/>
            <asp:menuitem navigateurl="~\Jazz.aspx"
              text="Jazz"/>
          </asp:menuitem>
          <asp:menuitem navigateurl="~\Movies.aspx"
            text="Movies">
            <asp:menuitem navigateurl="~\Action.aspx"
              text="Action"/>
            <asp:menuitem navigateurl="~\Drama.aspx"
              text="Drama"/>
            <asp:menuitem navigateurl="~\SciFi.aspx"
              text="Science Fiction"/>
          </asp:menuitem>
        </items>
      
      </asp:menu>

    </form>
  </body>
</html>

설명

기본적으로 동적 메뉴는 마우스 포인터가 메뉴 위에 더 이상 배치되지 않을 때 특정 기간 후에 자동으로 사라집니다. 기간을 DisappearAfter 지정하려면 이 속성을 사용합니다.

메모

사용자가 메뉴 바깥쪽을 클릭하면 동적 메뉴가 즉시 사라집니다.

이 속성을 -1로 설정하여 동적 메뉴가 자동으로 사라지지 않도록 지정할 수도 있습니다. 이 경우 사용자가 메뉴 바깥쪽을 클릭할 때만 동적 메뉴 항목이 사라집니다.

이 속성은 테마 또는 스타일시트 테마로 설정할 수 없습니다. 자세한 내용은 테마 및 스킨을 참조ThemeableAttribute하고 ASP.NET.

적용 대상

추가 정보