をシミュレートするために iFrame を使用してい<input type="file">
ます。これが何をするかです:
1 - というリンクが表示されます"Choose your file"
。
2 - ユーザーがリンクをクリックし、ローカル コンピューター上のファイルを参照します。
3 - ユーザーがファイルを選択すると、アップロードが自動的に開始されます。
これはうまく機能しています。ただし、カーソルの種類を制御できません。カーソルを強制的にポインターにするにはどうすればよいですか?
http://jsfiddle.net/4paY6/は、以下のコードの例です。
<html>
<head>
<style>
.attach-file:hover {
text-decoration: underline;
cursor: pointer;
}
.attach-file {
padding-left: 22px;
background: url("{{ STATIC_URL }}images/new/attach-file.png") no-repeat 0 1px;
color: #0BA5D9;
position: relative;
top: 0;
left: 0;
}
form {
float: right;
}
html, body {
padding: 0;
margin: 0;
border: 0;
}
input[type="file"] {
z-index: 999;
opacity: 0.0;
line-height: 0;
position: absolute;
position: fixed;
font-size: 500px;
top: -100px;
left: -200px;
-moz-appearance: none;
white-space: nowrap;
cursor: pointer;
-moz-binding: none;
}
input[type="file"] > input[type="text"] {
border-color: inherit;
background-color: inherit;
color: inherit;
font-size: inherit;
height: inherit;
}
/* button part of file selector */
input[type="file"] > input[type="button"] {
height: inherit;
font-size: inherit;
}
input[type="file"]:hover {
cursor: default;
}
* {
overflow: hidden;
}
</style>
</head>
<body>
<form method="post" action="." enctype="multipart/form-data" style="position: inline">
<label style="overflow: hidden; position: relative;">
<span class="attach-file">Attach File</a>
<input type="file" name="attachment" />
</label>
</form>
</body>
iFrame にカーソルを合わせたときに Firefox でカーソルをシミュレートするには、上記で何を追加または変更する必要がありますか?