Widgets.us.season.nfl.Scores

us.season.nfl.scores displays games key scoreboard information broken down by a week (according to local time).

All the properties are optional. By default, widget will render active season active week.


new Scores(props)

Parameters
Name Type Description
props object
Properties
Name Type Argument Default Description
seasonId number <optional>

Season year.

seasonType string <optional>

Season type: 'pre', 'reg' or 'pst'.

week number <optional>

Week.

firstSeasonId number <optional>
2000

The oldest season year for the season dropdown to display.

disableGameHeader boolean <optional>

if true then headers of games are hidden.

disableGameInfo boolean <optional>

If true hides collapsible content (i.e. game information).

disableGameInfoXSmall boolean <optional>
'true'

If true hides collapsible content (i.e. game information) on X-Small responsive breakpoint (<321px).

disablePitchSwitch boolean <optional>

If true hides "SHOW FIELD" switch. However disablePitch prop is still operational.

disablePitch boolean <optional>

Switches pitch visualization (i.e. "SHOW FIELD") switch off. Pitch visualization is only available with live matches.

autoSlide boolean <optional>
true

If false disables auto sliding of the content in game info section.

autoSlideSpeed number <optional>
5000

Sets the delay of auto sliding of the content in game info section (in milliseconds).

preMatchLinks string <optional>

Comma separated string of link keys for pre-match. Can be undefined, default, preview, boxscore, gametracker, recap. Entering default is same as entering 'preview'.

liveMatchLinks string <optional>

Comma separated string of link keys for live-match. Can be undefined, default, preview, boxscore, gametracker, recap. Entering default is same as entering 'boxscore, gametracker'.

postMatchLinks string <optional>

Comma separated string of link keys for post-match. Can be undefined, default, preview, boxscore, gametracker, recap. Entering default is same as entering 'boxscore, recap'.

enableTeamSelect boolean <optional>

Enables on team click or touch.

enablePlayerSelect boolean <optional>

Enables on player (i.e. game leaders) click or touch.

max3InARow boolean <optional>

If true, displays max 3 games in a row.

border boolean <optional>

If true, draws a border around the widget.

onItemClick function <optional>

Function/event handler. By default all widget click target areas are disabled. The enableTeamSelect enables team targets. enablePlayerSelect enables a player targets. The player targets appear in Game information section depending on match status. With preMatchLinks, liveMatchLinks and/or postMatchLinks set the widget gets preview, boxscore, gametracker and/or recap targets. All targets emit the following match props on click or touch: matchId, sportId, realCategoryId, seasonId, seasonType, week, awayTeamId, homeTeamId, awayTeamUid, homeTeamUid. Team target adds teamId, player target adds playerId and teamId, match target adds matchStatus, Valid matchStatus values are: pre, live, post.

Examples

HTML/Declarative

<div class="sr-widget" data-sr-widget="us.season.nfl.scores" data-sr-season-id="2019"></div>
<script type="application/javascript" src="https://widgets.media.sportradar.com/uscommon/widgetloader" data-sr-language="en_us" async></script>

JS/Programmatic

<script>
    (function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
    g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
    )})(window,document,"script","https://widgets.media.sportradar.com/uscommon/widgetloader","USW", {
        language: 'en_us'
    });
    USW('addWidget', '#sr-widget', 'us.season.nfl.scores', { seasonId: 2019 });
</script>

JS/Example of using Event Handlers

<script>
    (function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
    g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
    )})(window,document,"script","https://widgets.media.sportradar.com/uscommon/widgetloader","USW", {
        language: 'en_us'
    });
    USW('addWidget', '#sr-widget', 'us.season.nfl.scores', {preMatchLinks: 'default', liveMatchLinks: 'default', postMatchLinks: 'default', enableTeamSelect: true, enablePlayerSelect: true, onItemClick: function(type, obj){alert(type + ': ' + JSON.stringify(obj));}});
</script>
<div id="sr-widget"></div>

Examples of onItemClick targets and emitted props

"team", {"teamId":"sd:team:82cf9565-6eb9-4f01-bdbd-5aa0d472fcd9","matchId":"sd:match:ee83c78d-f7eb-46fc-a851-e5e3b2a82f44","seasonId":2020,"seasonType":"REG","week":10,"awayTeamId":"sd:team:82cf9565-6eb9-4f01-bdbd-5aa0d472fcd9","homeTeamId":"sd:team:d26a1ca5-722d-4274-8f97-c92e49c96315","awayTeamUid":"4421","homeTeamUid":"367364"}
"player", {"playerId":"sd:player:5812204c-6dae-4450-8011-99e0f72864ac","teamId":"sd:team:d26a1ca5-722d-4274-8f97-c92e49c96315","matchId":"sd:match:ee83c78d-f7eb-46fc-a851-e5e3b2a82f44","seasonId":2020,"seasonType":"REG","week":10,"awayTeamId":"sd:team:82cf9565-6eb9-4f01-bdbd-5aa0d472fcd9","homeTeamId":"sd:team:d26a1ca5-722d-4274-8f97-c92e49c96315","awayTeamUid":"4421","homeTeamUid":"367364"}
"box_score", {"matchId":"sd:match:ee83c78d-f7eb-46fc-a851-e5e3b2a82f44","seasonId":2020,"seasonType":"REG","week":10,"awayTeamId":"sd:team:82cf9565-6eb9-4f01-bdbd-5aa0d472fcd9","homeTeamId":"sd:team:d26a1ca5-722d-4274-8f97-c92e49c96315","awayTeamUid":"4421","homeTeamUid":"367364"}