Change Color When Hovering/Clicking/Leaving the Hyperlink

  • Last update:  2021-02-05
  • I.Description

    When using a hyperlink, I hope to move the mouse to the hyperlink, and the hyperlink will change the font color to distinguish which hyperlink is currently selected and improve user experience, as shown in the following figure:

    1.png

    II. Ideas

    When the template is loaded, we add a loading end event to it, use jQuery to get the hyperlink cell object in the event, and then add the mouse over event, change the font color when the mouse is placed on the object, and when leaving Restore the original color.

    III. Operation steps

    We use templates%FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\SpecialSubject\HyplinkReport\Hyperlink to Solve the Slow Running of Internet Script Sample Main Report.cptas an example, realize to change the color when the mouse moves to the hyperlink.

    1. Add event Loading End

    Method one:

    Open the template, click Template> Web Attributes>Pagination Preview, set it Individually set for the template , and add an event Loading End below, as shown below:

    2.png

    After adding the loading end event, enter the following statement in the JS input box:

    $("span.linkspan div").bind("mouseover",function(){
    $(this).css("color","red");
    }).bind("mouseleave",function(){
    $(this).css("color","blue");
    })

    Method Two:

    After adding the loading end event, enter the following statement in the JS input box:

    $('.linkspan').mouseover(function(){$(this).css('color','red');}); //Mouse up 
    $('.linkspan').mouseleave(function(){$(this).css('color','blue');}); //Mouse away
    $('.linkspan').mousedown(function(){$(this).css('color','gray');}); //Mouse click

    2. Effect view

    Click the pagination preview and move the mouse to the hyperlink to achieve the effect shown in the above picture.

    The template is saved in%FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\SpecialSubject\HyplinkReport\Hyperlink Color Changes.cpt

    Please check the completed template :

    Hyperlink Color Changes.cpt

    Keywords: change color when mouse hovering/clicking/leaving the hyperlink

    Attachment List


    Theme: Report Features
    • 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