How to change cursor style for react-custom-scrollbars?

前端 未结 3 775
情话喂你
情话喂你 2021-01-28 22:08

The default cursor for react-custom-scrollbars is pointer when you move your mouse on the scroll bar.

Is there a way to change cursor style?

Rig

3条回答
  •  花落未央
    2021-01-28 22:37

    Hi simply use CSS to do it, and load an image base64 or file.jpg png gif ... etc.

    Doesn't work at all after tested :

    .cursor1 {
      cursor: url(data:image/png;base64,iVBORw0KGgoAASUhEUgAAACAAAAAgCAYAAABzenr0AAAJFklEQVR42rWXCXBU9R3Hv+/V...), auto;
    }
    

    If you want the standard cursors still running tested:

    .cursors {
      text-align:center;
    }
    .cursors-main {
      display:inline-block;
      font-size:12px;
      font-family:Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
      background:green;
      color:#FFF;
      padding:10px 25px;
      margin-bottom:5px;
    }
    .cursors-main:hover {
      background:#555;
    }
    .auto            { cursor: auto; }
    .deafult         { cursor: default; }
    .none            { cursor: none; }
    .context-menu    { cursor: context-menu; }
    .help            { cursor: help; }
    .pointer         { cursor: pointer; }
    .progress        { cursor: progress; }
    .wait            { cursor: wait; }
    .cell            { cursor: cell; }
    .crosshair       { cursor: crosshair; }
    .text            { cursor: text; }
    .vertical-text   { cursor: vertical-text; }
    .alias           { cursor: alias; }
    .copy            { cursor: copy; }
    .move            { cursor: move; }
    .no-drop         { cursor: no-drop; }
    .not-allowed     { cursor: not-allowed; }
    .all-scroll      { cursor: all-scroll; }
    .col-resize      { cursor: col-resize; }
    .row-resize      { cursor: row-resize; }
    .n-resize        { cursor: n-resize; }
    .e-resize        { cursor: e-resize; }
    .s-resize        { cursor: s-resize; }
    .w-resize        { cursor: w-resize; }
    .ns-resize       { cursor: ns-resize; }
    .ew-resize       { cursor: ew-resize; }
    .ne-resize       { cursor: ne-resize; }
    .nw-resize       { cursor: nw-resize; }
    .se-resize       { cursor: se-resize; }
    .sw-resize       { cursor: sw-resize; }
    .nesw-resize     { cursor: nesw-resize; }
    .nwse-resize     { cursor: nwse-resize; }
    
    
    auto
    default
    none
    context-menu
    help
    pointer
    progress
    wait
    cell
    crosshair
    text
    vertical-text
    alias
    copy
    move
    no-drop
    not-allowed
    all-scroll
    col-resize
    row-resize
    n-resize
    s-resize
    e-resize
    w-resize
    ns-resize
    ew-resize
    ne-resize
    nw-resize
    se-resize
    sw-resize
    nesw-resize
    nwse-resize

提交回复
热议问题