1. Home
  2. Docs
  3. Confluence
  4. Confluence User Macros
  5. Marquee

Marquee

Summary

This Confluence user macro adds an HTML5 marquee element to your page.

Source Code

#* ============================================================================
 * MARQUEE NEWSTICKER
 *
 * This Confluence user macro adds an HTML5 marquee element to your page.
 *
 * Version: 1.1.000
 * Date:    2017-12-15
 * Author:  George Lewe
 * Source:  https://github.com/glewe/marquee
 * License: GNU LGPLv3
 *
 * Macro body:      Yes
 * Body processing: Rendered
 *#

#* ----------------------------------------------------------------------------
 * PARAMETER
 *#
## @param ScrollDirection:title=Scroll Direction|type=enum|default=Right|enumValues=Left,Right
## @param ScrollSpeed:title=Scroll Speed|type=int|desc=Enter a numeric value for the speed. The higher the number, the faster the scroll. Default is 5.|default=5
## @param Padding:title=Padding|type=string|desc=Enter the padding of the scroll box in pixels (add suffix 'px', e.g. 1px). Default: 2px (No border)|default=6px
## @param BackgroundColor:title=Background Color|type=string|desc=Enter the background color in hexadecimal starting with a #. Leave emtpy for none. <a href="http://hslpicker.com/">Color Picker</a>|default=inherit
## @param BorderWidth:title=Border Width|type=string|desc=Enter the border width in pixels (add suffix 'px', e.g. 1px). Default: 0px (No border)|default=0px
## @param BorderRadius:title=Border Radius|type=string|desc=Enter the border radius in pixels (add suffix 'px', e.g. 1px). A border radius creates rounded corners. Default: 0px (No border)|default=0px
## @param BorderColor:title=Border Color|type=string|desc=Enter the border color in hexadecimal starting with a #. Default: #000000 (Black). <a href="http://hslpicker.com/">Color Picker</a>|default=#000000

#* ----------------------------------------------------------------------------
 * PROCESS INPUT
 *#
#if (!$paramScrollDirection)
   #set ($paramScrollDirection="Right")
#end

#if (!$paramScrollSpeed)
   #set ($paramScrollSpeed="5")
#end

#if (!$paramPadding)
   #set ($paramPadding="6px")
#end

#if (!$paramBackgroundColor)
   #set ($paramBackgroundColor="inherit")
#end

#if (!$paramBorderWidth)
   #set ($paramBorderWidth="0px")
#end

#if (!$paramBorderRadius)
   #set ($paramBorderRadius="0px")
#end

#if (!$paramBorderColor)
   #set ($paramBorderColor="#000000")
#end

#* ----------------------------------------------------------------------------
 * OUTPUT
 *#
<marquee behavior="scroll" direction="$paramScrollDirection" scrollamount="$paramScrollSpeed" onmouseover="this.stop();" onmouseout="this.start();" style="background-color: $paramBackgroundColor;padding: $paramPadding; border: $paramBorderWidth solid $paramBorderColor; border-radius: $paramBorderRadius; margin-top:6px; margin-bottom:6px;">
   $body
</marquee>
Was this article helpful to you? Yes No

Leave a Reply

Your email address will not be published. Required fields are marked *