Hide the top menu of the List

Source: Internet
Author: User

You can use js to hide the top menu of the list:

<SCRIPT type = "text/JavaScript">
Window. onload = hidemenuitem;
Function hidemenuitem ()
{

VaR menunodes = Document. getelementsbytagname ("menu ");
VaR targetnode;
VaR targetviewnode;
VaR viewexplorernode;
VaR datasheetnode;
VaR assumernode;
For (VAR I = 0; I <menunodes. length; I ++)
{
 
VaR menunode = menunodes [I];
If (menunode. childnodes. length> 3)
{
If (menunode. childnodes [0]. Id. indexof ("editingridbutton ")! =-1)
{
Targetnode = menunode;
Datasheetnode = menunode. childnodes [0]; // is always node 0
Assumernode = menunode. childnodes [2]; // is always Node 2
}
If (menunode. childnodes [0]. Id. indexof ("defaultview ")! =-1)
{
Targetviewnode = menunode;
Viewexplorernode = menunode. childnodes [2];
}
}
}
Targetnode. removechild (assumernode );
Targetnode. removechild (datasheetnode );

Targetviewnode. removechild (viewexplorernode );
 
}
</SCRIPT>

Hide "new" menu

<SCRIPT type = "text/JavaScript">
Window. onload = hidemenuitem;
Function hidemenuitem ()
{
VaR today = new date ();
If (today. getdate ()> 20)
{
VaR menunodes = Document. getelementsbytagname ("menu ");
VaR targetnode;

For (VAR I = 0; I <menunodes. length; I ++)
{
VaR menunode = menunodes [I];
If (menunode. childnodes. length> 0)
{
If (menunode. childnodes [0]. Id. indexof ("new0 ")! =-1)
{
Targetnode = menunode;
Break;
}
}
}
VaR newnode = targetnode. parentnode. parentnode;
Newnode. style. Display = "NONE ";
}
}

</SCRIPT>

Add a moss built-in "content edit webpart" to the page and copy the above Code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.