【发布时间】:2012-08-28 04:05:29
【问题描述】:
我有两个问题:
我想在特定位置的图像
mouseover事件上在图像周围显示 6 个按钮。有可能吗?是否可以为这些按钮编写
onclick事件?
我没有任何网页设计经验。我使用了下面的代码
Javascript:
function showIt(imgsrc)
{
document.getElementById('imageshow').src=imgsrc;
document.getElementById('imageshow').style.display='';
}
function hideIt()
{
document.getElementById('imageshow').style.display='none';
}
HTML:
<input type="button" id="imageshow" Onclick="onClickFunc()" style="display:none" value="Button1"/>
<input type="button" id="imageshow" Onclick="onClickFunc()" style="display:none" value="Button2"/>
<input type="button" id="imageshow" Onclick="onClickFunc()" style="display:none" value="Button3"/><br>
<img src="Images/Image1.jpg" onmouseover="showIt(this.src)"><br>
<input type="button" id="imageshow" Onclick="onClickFunc()" style="display:none" value="Button4"/>
<input type="button" id="imageshow" Onclick="onClickFunc()" style="display:none" value="Button5"/>
<input type="button" id="imageshow" Onclick="onClickFunc()" style="display:none" value="Button6"/>
但是当我从图像中mouseout 时,按钮正在消失。如果我删除 onmouseout 事件,按钮将保持不变,只是我不想这样做。而且我真的不知道如何在图像周围放置 6 个按钮。我打算这样做:
所以请帮助我。谢谢
【问题讨论】:
-
一切皆有可能..你做了什么/一些代码??如果是,则粘贴它..
-
请推送您的代码以便更好地理解
标签: javascript image button mouseover