1、css样式
这是我的style代码:<style type="text/css">
.anylinkcss{
position:absolute;
visibility: hidden;
border:1px solid black;
border-bottom-width: 1px;
font:normal 12px Arial Narrow;
font-clocr:black;
line-height: 18px;
z-index: 100;
width: 90px;
} .anylinkcss a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 0px solid black;
padding: 1px 0;
text-indent: 5px;
font-clocr:black;
} .anylinkcss a:hover{ /*hover background color*/
background-color:Silver;
color: red;
text-decoration: underline;
} </style>
这是我的菜单,是用图片连接的,我把鼠标放在图片上,下面那个菜单就出来了,现在的问题是,我把鼠标放在图片上,还没放在菜单那些字上,那些字竟然是紫色的!我希望是黑色的呀~~~~
<asp:Image ID="Image1" runat="server" ImageUrl="~/image/index.jpg" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, 'anylinkmenu1')" onmouseup="changepicture()"/><div id="anylinkmenu1" class="anylinkcss" style="width: 87px; background-color:White"> <a href="">图形图像</a>
<a href="">鼠标事件</a>
<a href="">时间日期</a>
<a href="">导航菜单</a>
<a href="">窗体变化</a>
<a href="">表单按钮</a>
<a href="">特殊脚本</a>
<a href="">游戏娱乐</a>
</div>
2、图片转换,也就是说我把鼠标放在图片上,图片换成另外一张图片了,上面有我那个图片的连接。
我在onmouseover触发的dropdownmenu这个function里写了这么一句话:document.all.Image1.src="~/image/indexlink.jpg"
在onmouseup触发的changepicture这个function里写了这么一句话:
document.all.Image1.src= "~/image/index.jpg"
可是为什么这个效果不能实现呢?!请高手们帮帮我吧...我做毕设做的好痛苦....
这是我的style代码:<style type="text/css">
.anylinkcss{
position:absolute;
visibility: hidden;
border:1px solid black;
border-bottom-width: 1px;
font:normal 12px Arial Narrow;
font-clocr:black;
line-height: 18px;
z-index: 100;
width: 90px;
} .anylinkcss a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 0px solid black;
padding: 1px 0;
text-indent: 5px;
font-clocr:black;
} .anylinkcss a:hover{ /*hover background color*/
background-color:Silver;
color: red;
text-decoration: underline;
} </style>
这是我的菜单,是用图片连接的,我把鼠标放在图片上,下面那个菜单就出来了,现在的问题是,我把鼠标放在图片上,还没放在菜单那些字上,那些字竟然是紫色的!我希望是黑色的呀~~~~
<asp:Image ID="Image1" runat="server" ImageUrl="~/image/index.jpg" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, 'anylinkmenu1')" onmouseup="changepicture()"/><div id="anylinkmenu1" class="anylinkcss" style="width: 87px; background-color:White"> <a href="">图形图像</a>
<a href="">鼠标事件</a>
<a href="">时间日期</a>
<a href="">导航菜单</a>
<a href="">窗体变化</a>
<a href="">表单按钮</a>
<a href="">特殊脚本</a>
<a href="">游戏娱乐</a>
</div>
2、图片转换,也就是说我把鼠标放在图片上,图片换成另外一张图片了,上面有我那个图片的连接。
我在onmouseover触发的dropdownmenu这个function里写了这么一句话:document.all.Image1.src="~/image/indexlink.jpg"
在onmouseup触发的changepicture这个function里写了这么一句话:
document.all.Image1.src= "~/image/index.jpg"
可是为什么这个效果不能实现呢?!请高手们帮帮我吧...我做毕设做的好痛苦....
解决方案 »
- itemcommand 中,提交时获取控件值的问题
- 大家好,我该工作还是该静下心来学习?
- 自定义删除!!
- 怎么在javascript里判断用户是否刷新了网页。并在用户刷新网页的时候提示用户,或是禁止!(最后10分了)
- 判断数组值为空的问题!!!!!!!!!!
- C#中DataGrid中的模板列问题!!
- excel导入,在本机正常使用,在其它机子上报错,不知道为什么,谢谢大家了!
- 在我的asp.net项目中,我想修在执行aspx页面时改资源文件。。是不是需要目录具有写权限?
- datagrid用来显示留言部信息。当进入编辑状态时,有一些信息如ImageIndex不需要更新,因此在edittemplate中没有用<asp:textbox>来显示它
- 没分了帮个忙!svg图片总出现“单击以激活并使用此控件”怎么解决啊
- 以前用VS2005开发了一个管理系统,后来装了VS2008后,用2008打开了那个项目,可是我还不会2008,我想继续用2005开发,怎么转回去啊?
- 长文章分页问题
javascript不支持~,应该用../表示上一级目录
<head runat="server">
<title>无标题页</title>
<style type="text/css">
.anylinkcss{
position:absolute;
visibility: hidden;
border:1px solid black;
border-bottom-width: 1px;
font-size:12px;
font-family: Arial Narrow;
clocr:black;
line-height: 18px;
z-index: 100;
width: 90px;
} .anylinkcss a{
width: 100%;
display: block;
text-indent: 3px;
padding: 1px 0;
text-indent: 5px;
clocr:black;
} .anylinkcss a:hover{ /*hover background color*/
background-color:Silver;
color: red;
text-decoration: underline;
}
</style>
<script language="javascript">
var disappeardelay=250
var enableanchorlink=0
var hidemenu_onclick=1 var ie5=document.all
var ns6=document.getElementById&&!document.all function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
} function showhide(obj, e, visible, hidden){
if (ie5||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
} function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
} function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
} function dropdownmenu(obj, e, dropmenuID){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
if (typeof dropmenuobj!="undefined")
dropmenuobj.style.visibility="hidden"
clearhidemenu()
if (ie5||ns6){
obj.onmouseout=delayhidemenu
dropmenuobj=document.getElementById(dropmenuID)
if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
dropmenuobj.onmouseover=clearhidemenu
dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
showhide(dropmenuobj.style, e, "visible", "hidden")
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
return clickreturnvalue()
} function clickreturnvalue(){
if ((ie5||ns6) && !enableanchorlink) return false
else return true
} function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
} function dynamichide(e){
if (ie5&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
} function delayhidemenu(){
delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)
} function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<a href="" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, 'anylinkmenu2')">网络学院</a> <div id="anylinkmenu2" class="anylinkcss" style="width: 150px; background-color:white"> <a href="">网页制作</a>
<a href="">网络编程</a>
<a href="">图形图像</a>
<a href="">多媒体制作</a>
<a href="">网站建设</a>
<a href="">操作系统</a>
</div>
</div>
</form>
</body>
</html>
document.getElementById("Image1").src="~/image/index.jpg";