私はJavaScriptを選択した領域でその機能(Raphaelを使用しています)を持っています。そのユーザーはこれに説明を追加できるよう ダブルクリックで新しいポイント(画像)を追加するには?
- は、(ポイントを象徴する小さな画像)新しいイメージを追加します。そして、私は、ダブルクリックで新しい機能を追加する必要がありますポイント
- イメージとテキストフィールドの横に削除ボタンを追加します。だからもしユーザーがそれを取り除くのが好きなら、彼はできる。これは、テキストフィールドに、この全く新しいポイント(イメージ)を削除する必要があり、私はここでそれを
を救うことができるように私は、この新しいポイントのcordinatesをも知っておく必要があり
<script type="text/javascript" charset="utf-8">
window.onload = function() {
var R = Raphael("paper", 500, 500);
var attr = {
fill: "#EEC7C3",
stroke: "#E0B6B2",
"stroke-width": 1,
"stroke-linejoin": "round"
};
var area = {};
area.Element1 = R.path("...").attr(attr);
area.Element2 = R.path("...").attr(attr);
...
area.Element63 = R.path("...").attr(attr);
var current = null;
for (var state in area) {
area[state].color = Raphael.getColor();
(function (st, state) {
st[0].state = 0;
st[0].style.cursor = "pointer";
st[0].onmouseover = function() {
current && area[current].animate({ fill: "#EEC7C3", stroke: "#E0B6B2" }, 500) && (document.getElementById(current).style.display = "");
st.animate({ fill: st.color, stroke: "#ccc" }, 500);
st.toFront();
R.safari();
document.getElementById(state).style.display = "block";
current = state;
};
st[0].onmouseout = function() {
if (this.state == 0)
st.animate({ fill: "#EEC7C3", stroke: "#E0B6B2" }, 500);
else
st.animate({ fill: "#C05219", stroke: "#E0B6B2" }, 500);
st.toFront();
R.safari();
};
st[0].onclick = function() {
st.animate({ fill: "#C05219", stroke: "#E0B6B2" }, 500);
st.toFront();
if (this.state == 0)
this.state = 1;
else
this.state = 0;
R.safari();
};
})(area[state], state);
}
};
</script>
私はjavascriptのプログラマーではないので、どこから始めたらよいかわからない。だから、ここのどんな助けも大歓迎です!
少なくともこの質問に関連するJavaScript機能のソースとHTMLを追加してください。 – Abbas
私はコードを追加しました。 – Marta