<script>
document.addEventListener("DOMContentLoaded", function () {
$("fastpostmessage").style.background = 'url(/static/image/common/bj.gif) no-repeat left top';
$("fastpostmessage").onfocus = function () {
$("fastpostmessage").style = '';
}
$("fastpostmessage").onblur = function () {
if ($("fastpostmessage").value == '') {
$("fastpostmessage").style.background =
'url(/static/image/common/bj.gif) no-repeat left top';
}
}
var fastreplybtn = ["post_reply", 'post_replytmp', 'post_reply_right'];
fastreplybtn.forEach((value, index) => {
// 获取需要钩取点击事件的元素
let element = document.getElementById(value);
// 保存原始的onclick事件处理程序
var originalOnClick = element.onclick;
// 创建新的onclick事件处理程序
element.addEventListener("click", function (event) {
// 在这里编写您的自定义操作
console.log("点击事件已被钩取");
// 调用原始的onclick事件处理程序(如果存在)
if (typeof originalOnClick === "function") {
originalOnClick.call(this, event);
}
let reply_tip_ts = setInterval(() => {
if (!$("postmessage")) return;
clearInterval(reply_tip_ts);
$("postmessage").style.background =
'url(/static/image/common/bj.gif) no-repeat left top';
$("postmessage").addEventListener("input", function (event) {
$("postmessage").style = '';
});
$("postmessage").onfocus = function () {
$("postmessage").style = '';
}
$("postmessage").onblur = function () {
if ($("postmessage").value == '') {
$("postmessage").style.background =
'url(/static/image/common/bj.gif) no-repeat left top';
}
}
}, 500);
});
});
});
</script>
|