Change the mouse cursor on mouse over to anchor-like style

后端 未结 5 1031
半阙折子戏
半阙折子戏 2021-01-30 03:43

If I hover the mouse over a div the mouse cursor will be changed to the cursor like that in HTML anchor.

How can I do this? Do I need Javascript or it\'s po

5条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 04:24

    If you want to do this in jQuery instead of CSS, you basically follow the same process.

    Assuming you have some

    , you can use the following code:

    $("#target").hover(function() {
        $(this).css('cursor','pointer');
    }, function() {
        $(this).css('cursor','auto');
    });
    

    and that should do it.

提交回复
热议问题