Home >

How to show or add scroll bar in SharePoint Web Parts

3. March 2011

In order to display scroll bar in SharePoint list view web parts, a simple trick is to use jQuery.

Following is the sample code that you can add in a hidden content editor web part that will add scroll bar in the given ID’s of the web parts on that page:

 

<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
    $(document).ready(function () {
        $("div[id='WebPartWPQ2']").css('overflow', 'scroll');
    });
</script>

 

Here; 'WebPartWPQ2' is the ID of the Web Part div. Just replace that ID with the value of your Web Part div and that’s all.

 

Hope it helps!

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading