Archive for January 15th, 2012

Hiding elements on a page

Posted January 15, 2012 By Kevin Bennett

The other day I had a user ask about removing the (More Links) wording from a Link List Web Part. Basically she had but the view into Summary View and with the number of items that appears it also states at the bottom to click to see more links. But all her links were showing up so she just wanted that removed.

Being my normal helpful self I seen no reason to argue that it didn’t matter if it was on the page or not and searched for a quick script to accomplish this.

 

The code is as follows

[code]

<script>

document.getElementById(“onetidMoreAnn”).innerHTML=””

</script>

[/code] 

I then called the code from a Content Editor Webpart and the More Links Disappeared.

I got the onetidMoreAnn by using the Developer Dashboard in IE and finding that links ID in attributes. I imagine you can do this for any element on a page.

Simple and I still look like a hero.

Be the first to comment
%d bloggers like this: