change cursor to finger pointer

前端 未结 10 2089
孤街浪徒
孤街浪徒 2021-01-30 15:17

I have this a and I don\'t know that I need to insert into the \"onmouseover\" so that the cursor will change to finger pointer like a regular link:



        
相关标签:
10条回答
  • 2021-01-30 15:59
    <a class="menu_links" onclick="displayData(11,1,0,'A')" onmouseover="" style="cursor: pointer;"> A </a>
    

    It's css.

    Or in a style sheet:

    a.menu_links { cursor: pointer; }
    
    0 讨论(0)
  • 2021-01-30 16:00

    I like using this one if I only have one link on the page:

    onMouseOver="this.style.cursor='pointer'"
    
    0 讨论(0)
  • 2021-01-30 16:04

    Add an href attribute to make it a valid link & return false; in the event handler to prevent it from causing a navigation;

    <a href="#" class="menu_links" onclick="displayData(11,1,0,'A'); return false;" onmouseover=""> A </a>
    

    (Or make displayData() return false and ..="return displayData(..)

    0 讨论(0)
  • 2021-01-30 16:06

    Here is something cool if you want to go the extra mile with this. in the url, you can use a link or save an image png and use the path. for example:

    url('assets/imgs/theGoods.png');

    below is the code:

    .cursor{
      cursor:url(http://www.icon100.com/up/3772/128/425-hand-pointer.png), auto;
    }
    

    So this will only work under the size 128 X 128, any bigger and the image wont load. But you can practically use any image you want! This would be consider pure css3, and some html. all you got to do in html is

    <div class='cursor'></div>
    

    and only in that div, that cursor will show. So I usually add it to the body tag.

    0 讨论(0)
提交回复
热议问题