Sou*_*rav 5 javascript css internet-explorer dom angularjs
当我在Internet Explorer和Safari中检查网站元素时,以下代码完全消失了(没有生成)。但是在chrome和Firefox中完全可以使用。
使用ng-attr-style在这里不起作用(即使在Chrome中也是如此)。在chrome浏览器中,它(在检查时)生成代码,但在前端不起作用。在IE或Safari浏览器中,代码甚至没有生成(检查时)。
尝试了以下解决方案,但这些解决方案没有带来任何好的https://docs.angularjs.org/guide/ie
我的代码:
<div
style="cursor: pointer;"
title="{{ line.line.type == 'solid' ? 'Date: ' + vm.$filter('date')(vm.getDateFromSeconds(line.line.date)) : 'Current Date: ' + vm.$filter('date')(vm.getDateFromSeconds(line.line.date)) }} {{ line.line.type == 'solid' ? 'Name: ' + line.line.name : undefined }}"
class="eventLines {{'type-'+line.line.type}}"
ng-repeat="line in col.eventLine track by $index"
ng-style="{{line.styleCss}}">
<div
class="lineSquare"
ng-show="outerIndex==1"
ng-style="{'background':line.line.color}">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
在Chrome中生成的输出(实际需要):
<div
style="cursor: pointer; position: absolute; z-index: 1; height: 50px; width: 2px; left: 46.0161px; border-left: 2px dashed rgb(75, 78, 83);"
title="Current Date: Aug 5, 2019"
class="eventLines type-dashed"
ng-repeat="line in col.eventLine track by $index"
ng-style="{"position":"absolute","z-index":1,"height":"50px","width":"2px","left":"46.59677419354839px","border-left":"2px dashed #4B4E53"}">
<div
class="lineSquare ng-hide"
ng-show="outerIndex==1"
ng-style="{background:line.line.color}"
aria-hidden="true"
style="background: rgb(75, 78, 83);">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)