internet-explorer-11 - IE 11 - 在jQuery中設置margin right在IE11中不能工作

[https://codepen.io/thrilom/pen/BaygPpr][1]

我的代碼可在我測試過的所有瀏覽器中使用,但IE11除外。


<meta http-equiv="X-UA-Compatible" content="IE=edge">




(function($) {


 $(window).on("load resize", function() {


 var adjustMargin = $(".two-col-image__container").css('marginRight');


 $(".two-col-image__marginChange").css('marginRight', '-' + adjustMargin);


 });


})(jQuery);

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>


<section>


 <div class="container-fluid two-col-image" style="background: url(assets/images/about-bg@2x.png) no-repeat center center;


		background-size: cover;">


 <div class="row">


 <div class="container two-col-image__container">


 <div class="row">


 <div class="col-12 col-md-6 ml-auto d-flex align-items-center mt-4 mt-md-0 two-col-image__group">


 <div class="two-col-image__group-container">


 <h2 class="h6 two-col-image__title">HELLO WORLD</h2>


 <h3 class="h2 two-col-image__sub-title">ABOUT</h3>


 <p>More text</p>



 <p><a href="#">Scooter</p>


									<a href="javascript:void(0);" class="btn btn-default"><span>learn more</span><img class="img-fluid btn-default__img"


											alt="Link Icon" src="assets/images/btn-icon.svg" /></a>


 </div>


 </div>


 <div class="col-12 col-md-6 two-col-image__image-group">


 <div class="two-col-image__marginChange">


 <img class="two-col-image__image" alt="About Cotton" class="img-fluid" src="assets/images/about-image-card@2x.png" />


 </div>


 </div>


 </div>


 </div>


 </div>


 </div>


</section>

时间:

是所有瀏覽器支持的最佳選擇:width: calc(50vw - #{$grid-gutter-width/2});

...