JS realizes special effect of countdown

  • Last update:June 09, 2021
  • I. Overview

    1. Application scenario

    When producing large screens such as real estate, retail, and e-commerce, countdowns are often required, such as countdowns for marketing operations, countdowns for retail sales, etc.

    1.gif


    2. Realization idea

    The external JS and CSS files are quoted in the report, and the HTIML5 technology is used to realize the countdown effect.

    Taking the end time as 24 o'clock on the same day as an example, the page automatically calculates the hours, minutes and milliseconds remaining from the end time, and the clock effect decreases.

    II. Example

    1. Design report

    1) Create a new dashboard, and add a report block to the main body of the dashboard, edit the report block, merge cells B2~B11, insert HTML code, click Cell Attributes > Other in the property panel on the right, and select "Display by HTML".

    The HTML code is as follows:

    <div class="se-kl"
        <div class="se-cn">COUNT DOWN</div> 
        <i class="se-io"></i> 
        <div class="se-info">End of distance,left</div> <div class="se-count"> <div class="se-day"></div>
        <div class="se-hour"><span class="se-txt">00</span></div>
        <div class="se-min"><span class="se-txt">00</span></div>
        <div class="se-sec"><span class="se-txt">00</span></div>
        </div> 
    </div>

    2.png

    2) Download all the files below and put them in the designer installation directory %FR_HOME%\webapps\webroot\help\css.

    seckill.png

    zzsc.css

    zzsc.js

    3) In the designer, click Server> Server Configuration Manager, and quote CSS and JavaScript respectively.

    Quoting CSS:

    3.png

    Quoting JavaScript:

    4.png


    2. Preview effect

    Save the dashboard and click PC preview, the effect is shown in I.1.

    Note: Mobile terminal is not supported.

    III. Download template

    Please refer to the completed template:  

    %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\JS\jsApplications\JS_realizes_countdown_effect.frm

    Click to download: JS_realizes_countdown_effect.frm

    Attachment List


    Theme: FineVis Data Visualization
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    9s后關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy