Jquery - 文件输入上的光标指针,可能吗?

标签 jquery html css input cursor


如何将 cursor:pointer; 设置为输入文件字段?

html

  <form id="up_1" name="up_1" action="" enctype="multipart/form-data" method="post">

    <div style="position: relative;">

      <input id="file_input" type="file" name="file_input" style="position: relative; text-align: right; opacity: 0; z-index: 2;" />

        <div id="ico_hdd" style="position: absolute; top: 0px; left: 0px; z-index: 1;">
        <img src="http://img834.imageshack.us/img834/9831/iconhdd.png" style="margin-bottom: -4px;"/>
      </div>

    </div>

  </form>

工作 -> http://jsfiddle.net/tPvJJ/

提前致谢!
彼得

最佳答案

在我测试的每个浏览器(Chrome、FF 和 IE)中都不会,即使包装在具有光标属性的父元素中也是如此。可能是出于安全原因,用自定义光标或空光标或其他什么来预防恶作剧。

你可以输入 a transparent DIV on it并赋予 that 光标属性,但是输入字段当然将不再可单击。

关于Jquery - 文件输入上的光标指针,可能吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4112643/

相关文章:

javascript - 如何在谷歌应用程序脚本中刷新标签而不重新加载页面

javascript - Cordova WebSQL - onSubmit

HTML - 我试图将一个段落置于页面中间

css - 访问过的链接有不需要的文字修饰

ios - CSS 动画阻止了 iOS 上的触摸事件

javascript - 查找为 div 设置 onclick 事件的位置?

javascript - Vue.js 可以在用户输入数字时添加逗号吗?

jquery - jqGrid 自定义 onCellSelect 在SaveCell 之前不触发

css - 当我减小浏览器宽度时,我的 col div 似乎变大了

javascript - 如何使用Jquery将一个html代码重用到另一个html?