提交图像按钮的焦点在IE 8中未突出显示
Onfocus of submit image button not getting highlighted in IE 8
我正在尝试使用 javascript 函数突出显示图像的选择,但这在使用 IE 时似乎没有任何效果,但在 Chrome 中运行良好。有人可以告诉我如何在IE中突出显示提交图像(按钮)吗?
HTML 提交按钮代码:
<input type="submit" onfocus="changeBorder(this);" onclick="saveDeviceInfo();"
title="Save" alt="Save" value="Save" id="save-button" style="background-image:
url(btn.png); border: 2px solid rgb(51, 129, 183); background-position: initial initial;
background-repeat: repeat no-repeat;">
JS函数:
function changeBorder(_this){
jQuery(_this).css("border","2px solid #3381b7");
}
编辑:
我尝试将以下CSS添加到我的CSS文件中,但它似乎在IE 8中仍然不起作用。
#save-button:hover{
border: 1px solid #3381b7;
}
#save-button:focus{
border: 4px solid #3381b7;
}
#save-button:focus{
outline: #177f7f dotted medium;
}
#save-button:selected{
outline: #177f7f dotted medium;
}
你可以使用 CSS,比如:
#save-button{
background:url('btn.png') no-repeat;
}
#save-button:hover{
background:url('btn2.png') no-repeat;
}
或
#save-button{
background-image:url('btn.png'); background-repeat:no-repeat;
}
#save-button:hover{
background-image:url('btn2.png'); background-repeat:no-repeat;
}
这是一个小提琴
.HTML
<input type="submit" onclick="saveDeviceInfo();" title="Save" alt="Save" value="Save" id="save-button">
.CSS
#save-button {
border: 2px solid rgb(51, 129, 183);
background-image: url(btn.png);
background-position: initial initial;
background-repeat: no-repeat;
}
#save-button:hover{
border: 1px solid #3381b7;
}
#save-button:focus{
border: 4px solid #3381b7;
outline: #177f7f dotted medium;
}
#save-button:selected{
outline: #177f7f dotted medium;
}
jQuery
$(function() {
$('#save-button').click(function() {
$(this).css({ border: '2px solid #ccc'});
});
});
相关文章:
- IE中的CSS翻转动画:翻转的一面显示镜像内容
- IE中的CSS翻转动画:翻转的一面显示镜像内容
- 对于Ajax调用,为什么innerHTML没有显示在IE中
- javascript网格未在IE 8及以上版本中显示
- IE(移动设备)在触摸时不显示子项
- Javascript/Css导航未显示在jquery文档上,仅在ie中准备就绪
- 使用RecordRTC录制的WebRTC视频在IE和Safari中显示错误
- 加载 gif 图像未显示在 IE 和镶边中
- 播放列表在IE和Chrome中无法正确显示
- 如果用户的浏览器早于以下版本,则显示一条消息:IE 10、Firefox 39、Chrome 39、Opera 8
- 引导轮播,修改为显示多个项目.无法正常工作的火狐和IE
- extjs在chrome中可以正常工作;不要在firefox或ie中显示任何内容
- 俄罗斯木偶与Firefox和Webkit的显示问题:与IE配合良好
- Don'在IE中调用find next时,不要高亮显示Codemirror中的光标
- 为什么选择只显示IE 9中选项文本的第一个字符
- jquery 超大小显示 IE 错误
- 谷歌图表不显示IE-9
- jquery代码显示IE Edge拒绝许可Iframes
- 显示IE中循环长时间运行的进度条
- 寻找有关为什么在打开包含JavaScript的HTML文件时显示IE“黄色条”的文档