我需要在背景图像中单击一个区域以生成一个JavaScript使用的事件.所以,我创建了一个锚标签,在里面我插入了一些语义无意义的标签之间的相关文本然后我隐藏了:
<a href="#"><i>foo</i></a>
Run Code Online (Sandbox Code Playgroud)
然后我给了锚标签'display:block'属性,宽度和高度值,并且绝对定位在我需要它与背景图像相关的位置.在Firefox中这很好用 - 我将鼠标悬停在上面,我的光标按预期变化 - 我有点可点击的东西.但是,IE7不喜欢锚标记为"空"的事实,因此不会将其视为可点击.所以我把它添加到css中的锚标签:
background:url(/no-image.jpg);
Run Code Online (Sandbox Code Playgroud)
...这似乎愚弄IE7,假设有东西存在.IE7现在将该区域视为可点击,即使锚标签实际上不存在背景图像.但这对我来说似乎有些黑客,我想知道是否有一种更优雅的方式来解决这个问题.任何想法将不胜感激.谢谢.
html css internet-explorer cross-browser internet-explorer-7
IE8/Chrome,FF运行良好,但Internet Explorer 7令我头疼.
我试图获得实际表格的数字结果
$(".checklist label").click(function () {
checkResults();
});
function checkResults() {
var str = $("form").serializeArray();
$.ajax({
type: "POST",
url: "/data.asmx/GetTotal",
cache: false,
contentType: "application/json; charset=utf-8",
data: JSON.stringify({ data: str }),
dataType: "json",
success: handleHtml,
error: ajaxFailed
});
}
function handleHtml(msg) {
$("#result").text(msg.d);
}
function ajaxFailed(xmlRequest) {
}
Run Code Online (Sandbox Code Playgroud)
IE7无法正常工作,我做错了什么?
谢谢
我知道IE7不支持background-size cover.
我搜索了一些解决方案的网络,但我所拥有的唯一的事情是,我应该把img与width: 100%和height:100%,并把它作为背景.
这是唯一的解决方案吗?我已经看到了一些解决方案,-ms-filter但它没有用.有没有人有其他解决方案?
1特别之处:我有超过1 div这个background-size封面属性.
在Firefox中一切正常(多么令人惊讶).
Edit1:我的代码如下所示:
<div class="section" id="section1">here should be the first picture as the background!!</div>
<div class="section" id="section2">here should be the second picture as the background!!</div>
<div class="section" id="section3">here should be the third picture as the background!!</div>
Run Code Online (Sandbox Code Playgroud) 由于Angular 2团队正在使用Typescript进行构建,他们是否可以编译一个可以在旧版浏览器上运行的Angular 2版本?
javascript internet-explorer-8 internet-explorer-7 typescript angular
我正在使用IE Web开发人员工具栏来解决问题.列表项下方出现一个空白空格,我无法从逻辑上弄清楚原因.使用web开发工具栏,我看到在下面的示例1中,"文本 - 空文本节点"正在"Text - Google"下面输出.具有讽刺意味的是,在第二个中,在"Google"一词之后手动插入空格,该文本节点不再出现.如果结果被颠倒,那对我来说是完全合理的.什么想法可能导致这种奇怪的行为?
注意:这是在IE7中发生的,而不是IE8.
<li><a href="www.google.com">Google</a></li> - empty text node appears at end
<li><a href="www.google.com">Google </a></li> - no empty text node
Run Code Online (Sandbox Code Playgroud)
更新:好的我已经缩小了这个问题.基本上,似乎我正在使用的某些属性之间存在冲突.我需要将a标签显示为块,因此当有多行时它们将正确包装.但我在物品之间也不需要空的空间.我不太清楚为什么那个空的空间能解决这个问题,并且不愿意只是"破解"它.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
a
{
display:block;
}
li
{
zoom: 1;
}
</style>
</head>
<body>
<ul>
<li>
<div style="background-color:blue">
<a href="#"><img src="http://www.google.com/intl/en_ALL/images/logo.gif"/></a>
</div>
<ul>
<li style="background-color:Red"><a href="#">One</a></li>
<li style="background-color:green"><a href="#">Two </a></li>
<li style="background-color:Yellow"><a href="#">Three</a></li>
</ul>
</li>
</ul>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我知道IE7和IE8应该支持使用多个CSS类选择器,但我似乎无法让它工作.
CSS:
.column {
float: left;
display: block;
margin-right: 20px;
width: 60px;
}
.two.column {
width: 140px;
}
.three.column {
width: 220px;
}
.four.column {
width: 300px;
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<div class='two column'>Two Columns</div>
<div class='three column'>Three Columns</div>
<div class='four column'>Four Columns</div>
Run Code Online (Sandbox Code Playgroud)
它总是最终使用.four.column规则.关于我做错了什么的任何想法?
有没有办法检测IE7?
我在IE8中的代码没有任何问题,但是IE7有问题.
所以我认为当浏览器是IE7通过javascript检测它时,我可以添加一个带有jquery的类.
我想改变
<div id="system">
Run Code Online (Sandbox Code Playgroud)
至
<div id="system" class="ie7">
Run Code Online (Sandbox Code Playgroud)
提前致谢.
在IE7中追加时有没有办法检查单选按钮?
什么似乎在每个浏览器中都有效,看起来不像它在IE6,7中工作,尽管到处读到我正在做的正确.我完全不知道为什么它不起作用.
var $itemVariantRowRadio = $("<input/>")
.attr("type", "radio")
.attr("name", "itemvariant")
.addClass("itemvariant")
.val('whatever');
$itemVariantRowRadio.attr('checked', 'checked');
$itemVariantRow.append($itemVariantRowRadio)
Run Code Online (Sandbox Code Playgroud)
现在,如果我console.log($itemVariantRowRadio.attr('checked')在IE6/7中进行操作,那么它会将其设置为TRUE,但实际上收音机不会被检查或选中.
恶梦!其他人遇到过这种情况并有任何修复方法吗?
trim()javascript函数在IE7中不起作用,但它在所有其他版本和所有浏览器中都运行良好.什么应该是IE7的问题或我如何解决这个问题?
$("#Email").val().trim()
Run Code Online (Sandbox Code Playgroud)

提前致谢.
我有以下内容:
<html>
<head>
</head>
<body>
<div>
<form method="post">
<div id="questions">
<label for="question-6">Name of Course:</label>
<input type="text" name="name_of_course[response]" value="" id="question-6" class="required">
<label class="control-label" for="reporting-year">Reporting Year: </label>
<select name="reporting_year" id="reporting-year">
<option value="-1" selected="selected">Select option...</option>
<option value="4">2013-2014</option>
<option value="1">2012-2013</option>
<option value="2">2011-2012</option>
<option value="3">2010-2011</option>
</select>
</div>
<input type="submit" name="submit" value="Save Entry" class="btn">
</form>
</div>
<script src="//code.jquery.com/jquery.js"></script>
<script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
<script>
$(function(){
jQuery.validator.addMethod("notEqual", function(value, element, param) {
return this.optional(element) || value !== param;
}, "Please select an option");
$('form').validate({
rules:{
'reporting_year': {
notEqual: "-1"
}
} …Run Code Online (Sandbox Code Playgroud) javascript jquery jquery-validate internet-explorer-7 compatibility-mode
css ×4
javascript ×4
jquery ×4
angular ×1
html ×1
json ×1
radio-button ×1
typescript ×1
undefined ×1