Tuesday, December 8, 2015

How to Add Scrolling Text to a SharePoint Page

It is very simple to add scrolling text to a SharePoint page without having to develop a custom web part solution. All you need is the out-of-the-box Content Editor web part and a snippet of JavaScript code.


Here is how to add scrolling text to your SharePoint page:
1) On the page you want to add scrolling text to, click on Site Actions -> Edit Page
2) Insert a Content Editor web part to your page.
3) Edit the web part.
4) Click on "Click here to add new content".
5) On the ribbon under "Editing Tools", click on "Format Text".
6) In the "Markup" section of the ribbon, click on "HTML", and select "Edit HTML Source".
7) In the HTML Source window, add the following JavaScript code:

<font color="#ff0000" face="Verdana" size="3"><p align="center"><marquee width="800" height="20" scrolldelay="120" style="height: 20px; width: 800px"><div align="left">NOTICE: You text goes here.</div></marquee></p></font>

8) Click "OK" to close the HTML Source window.
9) Click on "Save & Close" button on the ribbon to save and apply your changes.

You can modify the following variables:
color - text color
face - font style
scrolldelay - scroll speed
height - scrolling text area height
width - scrolling text area width

Cheers!
Leo

13 comments:

  1. Good day, thank you for the article but it seems like it does not work with sharepoint 2016

    ReplyDelete
  2. It works well with mine, thank you!

    ReplyDelete
  3. Awesome. Simple easy and it works. Thanks

    ReplyDelete
  4. Thank you. Worked very well on SP 2013.

    ReplyDelete
  5. Nice article. Is there a way to have this pull data from a list, like a calendar that scrolls upcoming meetings? Or suggestions of how best to achieve this?

    ReplyDelete
  6. Thank you Leo, It works absolutely fine

    ReplyDelete
  7. This code works fine for me. Is there a way to make it repeat the scroll faster. It takes 110 seconds before it scrolls again. I would like to bring that down to 0 seconds.

    ReplyDelete
  8. Thank you for sharing. This was very helpful and easy to use.

    ReplyDelete
  9. This is super awesome and exactly what I was looking for.

    ReplyDelete
  10. It seems to have added just fine and works as ZI expected. However, I can't find the original code when I go in to edit the scrolling message.

    ReplyDelete
  11. thank you. it works great! do you have any code for an announcement type news feed

    ReplyDelete
    Replies
    1. Where did you actually used the code!! is it latest version of SharePoint?

      Delete