Change the mouse pointer on ngclick

前端 未结 5 1504
南旧
南旧 2021-02-03 17:03

I\'ve a div with the Angular ng-click directive attached to it. On hovering over this element the mouse pointer doesn\'t change. Is there a way to chan

相关标签:
5条回答
  • 2021-02-03 17:24

    All you have to do is use the cursor property

    <div data-ng-click="myFun()" class="pointer"></div>
    
    .pointer {
        cursor: pointer;
    }
    
    0 讨论(0)
  • 2021-02-03 17:31

    Can be done via css, just add:

    .yourClass { cursor: pointer; }
    

    To your stylesheet

    0 讨论(0)
  • 2021-02-03 17:34

    If you are using datatables, you have to override the default datatables.css settings and add the following code to custom CSS, In the code below row-select is the class that I added on datatables in my HTML page.

    table.row-select.dataTable tbody td
    {
    cursor: pointer;    
    }
    
    0 讨论(0)
  • 2021-02-03 17:47

    Yes you can achieve it simply through CSS, nothing special about AngularJS here.

    <div ng-click="myAngularFunctionWithinController()" style="cursor: hand;cursor: pointer;">
    </div> 
    
    0 讨论(0)
  • 2021-02-03 17:50

    Is there a way to change it through css?

    Yes, see cursor.

    If you just wanted to target elements with the ng-click attribute, for example:

    [ng-click],
    [data-ng-click],
    [x-ng-click] {
        cursor: pointer;
    }
    
    0 讨论(0)
提交回复
热议问题