تصف هذه المقالة طريقة تمرير النص الوصف عندما تحوم JS على الصورة. شاركه للرجوع إليه. طريقة التنفيذ المحددة هي كما يلي:
انسخ الرمز كما يلي: <html>
<TITLE> JS ينفذ التمرير الوصف عند التحول على الصور </title>
<body>
<script language = "javaScript">
<!- ابدأ
وظيفة showtip2 (الحالية ، e ، النص) {
if (document.all && document.readyState == "كاملة") {
document.all.tooltip2.innerhtml = '<marquee style = "border: 1px solid Black">'+text+'</marquee>'
document.all.tooltip2.style.pixelleft = event.clientx+document.body.scrollleft+10
document.all.tooltip2.style.pixeltop = event.clienty+document.body.scrolltop+10
document.all.tooltip2.style.vibility = "مرئي"
}
آخر إذا (document.layers) {
document.tooltip2.document.nstip.document.write ('<b>'+text+'</b>')
document.tooltip2.document.nstip.document.close ()
document.tooltip2.document.nstip.left = 0
currentscroll = setInterval ("scrolltip ()" ، 100)
document.tooltip2.left = e.pagex+10
document.tooltip2.top = e.pagey+10
document.tooltip2.visibility = "show"
}
}
وظيفة HOVEETIP2 () {
if (document.all)
document.all.tooltip2.style.vibility = "Hidden"
آخر إذا (document.layers) {
ClearInterval (CurrentsCroll)
document.tooltip2.visibility = "Hidden"
}
}
// end ->
</script>
<div id = "tooltip2" style = "الموضع: المطلق ؛ الرؤية: مخفية ؛ مقطع: Rect (0 150 50 0) ؛ العرض: 150 بكسل ؛ لون الخلفية: الذهب ؛ z-index: 10" </div>
<div align = "center" name = "divtest" onMouseover = "showtip2 (هذا ، الحدث ،" مرحبًا بك في wulin.com ') ؛ " onMouseout = "hidetip2 () ؛" النمط = "المؤشر: اليد">
<table cellpadding = "0" cellpacing = "0"> <tr> <td colspan = "7">
<img src = "/images/banner.gif" border = "0" style = "cursor: pointer ؛"/>
</table>
</div>
</body>
</html>
آمل أن تكون هذه المقالة مفيدة لبرمجة JavaScript للجميع.