Currently, I am encountering an error on my website stating "Cannot read property 'offsetWidth' of undefined or null reference" after commenting out 2 divs in a bootstrap carousel. The carousel was created by someone who is not available to me at the moment. It's perplexing to see how removing those divs would lead to this error. Interestingly, the error disappears when the divs are left in place.
<!-- Carousel -->
<div id="homepage-slider">
<div id="feature-wrap">
<div class="iosSlider">
<div class="slider">
{2}
<div class="item" id="2">
<a href="{0}/{1}/products/test1"><img src="{0}/Content/images/home/index/myPic.jpg" style="width: 100%;" /></a>
</div>
<div class="item" id="3">
<a href="{0}/{1}/products/test2"><img src="{0}/Content/images/home/index/myPic2.jpg" style="width: 100%;" /></a>
</div>
<div class="item" id="4">
<a href="https://myPage.myCompany.com/" target="_blank"><img src="{0}/Content/images/home/index/myPic3.jpg" style="width: 100%;" /></a>
</div> <!-- Commenting out this div -->
</div>
<div class="iosSliderButtons">
{3}
<div class="button"></div>
<div class="button"></div>
<div class="button"></div> <!-- Commenting out this div -->
</div>
</div>
<div id="nextSlide"></div>
<div id="previousSlide"></div>
</div>
</div>
This particular block of HTML gets invoked from another file called Index.cshtml in the following manner:
<div id="view-home">
@Html.Raw(Resources.HtmlContent.HomePageContent.FormatWith(host,
currentWebAlias, myHTML1, myHTML2))
</div>
The values for myHTML1 and myHTML2 are defined earlier in that same file, and this chunk of HTML is utilized to replace the placeholders (marked {2} and {3}) in the above-mentioned page.
Additionally, I'm also facing a similar issue regarding 'unobtrusive'. Everything functions properly when the divs remain uncommented, but it's baffling why these errors surface once the divs are removed.
I'd highly appreciate any assistance!