JS Change the height of the row that mouse hovered

  • Last update:  2020-12-15
  • I. Overview

    1.1 Problem

    Sometimes we want the row height to be responsive to the cursor movement, like in the figure below. How can we achieve this?

    js-7.gif


    1.2 Solution

    Add a loading end event to the current report, using JavaScript. When the row is hovered by the mouse, the height will be changed to 40. When the mouse moves away, the height restores.

    Note: This method does not support mobile devices.

    II. Example

    2.1 Report design

    Design a detailed report, and bind the dataset.

    Click Template > Template Web Attributes > Pagination Preview, select set individually for the template. Add a loading end event with JavaScript here:

    image.png

    $('tr').each(function(){
    var _height = $(this).height();
    $(this)
    .mouseover(function(){$(this).height('40');})
    .mouseout(function(){$(this).height(_height);});
    });


    2.2 Preview effect

    Click save and then preview, we can see the effect as described above.

    js-7.gif

    III. Download template

    Attachment List


    Theme: Report Application
    • Helpful
    • Not helpful
    • Only read

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

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

    不再提示

    10s後關閉

    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