Added scroller to sharepoint news webpart

To add a scroller to a SharePoint News Web Part, you can use the following methods:

Method 1: Using the SharePoint News Web Part settings

  1. Go to your SharePoint site and navigate to the page where you want to add the scroller.
  2. Click on the News Web Part and click on the gear icon () to open the Web Part settings.
  3. In the Web Part settings, click on the "Appearance" tab.
  4. Under "Layout", select "Scroller" from the dropdown menu.
  5. Choose the scroller style and settings you want to use.
  6. Click "OK" to save the changes.

Method 2: Using a third-party scroller control

  1. Go to your SharePoint site and navigate to the page where you want to add the scroller.
  2. Click on the News Web Part and click on the gear icon () to open the Web Part settings.
  3. In the Web Part settings, click on the "Advanced" tab.
  4. In the "Advanced" tab, click on the "Web Part Properties" button.
  5. In the "Web Part Properties" dialog box, click on the "Add a new property" button.
  6. Enter the name of the property (e.g. "Scroller") and select "String" as the data type.
  7. Enter the URL of the scroller control (e.g. a JavaScript file) in the "Value" field.
  8. Click "OK" to save the changes.
  9. Go back to the page and refresh it to see the scroller in action.

Method 3: Using a custom solution

  1. Create a custom SharePoint solution using SharePoint Framework (SPFx) or SharePoint Designer.
  2. Add a scroller control to your custom solution using HTML, CSS, and JavaScript.
  3. Deploy the custom solution to your SharePoint site.
  4. Add the custom solution to your page and configure it to display the News Web Part.

Here is an example of how you can add a scroller to a SharePoint News Web Part using SPFx:

import { WebPart } from '@microsoft/sp-webpart-base';
import { Scroller } from 'scroller-js';

export class NewsWebPart extends WebPart<INewsWebPartProps> {
  private scroller: Scroller;

  protected onInit(): Promise<void> {
    this.scroller = new Scroller({
      container: this.domElement,
      items: this.newsItems,
      itemTemplate: this.newsItemTemplate,
      scrollerStyle: 'horizontal'
    });

    return Promise.resolve();
  }

  protected onRender(): void {
    this.scroller.render();
  }
}

Note: The above code is just an example and you will need to modify it to fit your specific requirements.