【发布时间】:2013-04-17 02:44:02
【问题描述】:
我用jquery写了一个js计算器,它可以在除IE之外的主要浏览器上运行,主要问题是输入元素根本不显示,输入也无法显示。 输入被禁用以防止非法输入,我认为这可能是原因,但启用它们并不能解决问题。 代码在https://github.com/ZackYovel/jQCalc/tree/master/pathTo,演示在http://jqcalc.co.nf/ 这里也是输入的css: 输入用这个 div 包装:
#jQCalc-input-container:focus {
border: thin solid #fff;
background: rgb(237,247,253); /* Old browsers */
background: -moz-linear-gradient(top, rgba(237,247,253,1) 0%, rgba(255,255,255,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(237,247,253,1)), color-stop(100%,rgba(255,255,255,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(237,247,253,1) 0%,rgba(255,255,255,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(237,247,253,1) 0%,rgba(255,255,255,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(237,247,253,1) 0%,rgba(255,255,255,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(237,247,253,1) 0%,rgba(255,255,255,1) 100%); /* W3C */
-ms-filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#edf7fd', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
}
这些是输入:
#jQCalc-expression-line, #jQCalc-result-line {
display: table-row;
background: none;
width: 95%;
margin: 0 auto;
border: none;
outline: none;
font-weight: bold;
}
#jQCalc-result-line {
letter-spacing: 1px;
font-size: 14pt;
}
#jQCalc-expression-line {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
letter-spacing: 2px;
}
【问题讨论】:
-
请在此处发布一些代码,足以重现问题。
-
您是否将
display: table-row应用于输入?如果是这样,我敢打赌这会导致 IE 出现问题,也可能会导致其他浏览器出现问题。 -
你需要支持哪些版本的IE,你测试过哪些版本?
-
pebbl,你不想回答吗?这将是一个很好的。你能告诉我为什么 table-row 会导致这个吗?
标签: jquery css internet-explorer cross-browser