Hubspot 自定义模块和 bootstrap 轮播
Hubspot custom modules and bootstrap carousel
Hubspot 在其自定义模块周围添加包装器。我非常想找到一种方法使此代码适用于 Bootstrap 轮播。任何想法如何让轮播插件知道在这个添加的 Hubspot 跨度和 div 包装器中定位我的项目 class?
<div class="carousel-inner">
<!-- this is added by Hubspot wraps all items -->
<span id="hs_cos_wrapper_carousel_items" class="hs_cos_wrapper hs_cos_wrapper_widget_container hs_cos_wrapper_type_widget_container" style="" data-hs-cos-general-type="widget_container" data-hs-cos-type="widget_container">
<!-- this div is added by Hubspot on each item -->
<div id="hs_cos_wrapper_widget_1462360389044" class="hs_cos_wrapper hs_cos_wrapper_widget hs_cos_wrapper_type_custom_widget" style="" data-hs-cos-general-type="widget" data-hs-cos-type="custom_widget">
<!-- finally, we have the carousel items here -->
<div class="item">
<div class="hero" style="height: 765px; min-height: 300px; background-image: url(image.jpg);"></div><!-- end hero-->
<div class="container carousel-caption">Test hero</div>
</div><!-- carousel item -->
</div> <!-- added Hubspot div around each item div -->
</span> <!-- added Hubspot span -->
</div> <!-- carousel-inner div -->
我的方法是从自定义模块中删除 "item"。而是用 jquery 将每个自定义模块包装在其中。例如,为包含模块的列提供 class "bootstrap-flex"。然后添加:
$('.bootstrap-flex > span').wrapInner("<div class='carousel-inner'></div>");
$('.carousel-inner .hs_cos_wrapper_type_custom_widget').each(function() {
$(this).wrap("<div class='item'></div>");
});
Hubspot 在其自定义模块周围添加包装器。我非常想找到一种方法使此代码适用于 Bootstrap 轮播。任何想法如何让轮播插件知道在这个添加的 Hubspot 跨度和 div 包装器中定位我的项目 class?
<div class="carousel-inner">
<!-- this is added by Hubspot wraps all items -->
<span id="hs_cos_wrapper_carousel_items" class="hs_cos_wrapper hs_cos_wrapper_widget_container hs_cos_wrapper_type_widget_container" style="" data-hs-cos-general-type="widget_container" data-hs-cos-type="widget_container">
<!-- this div is added by Hubspot on each item -->
<div id="hs_cos_wrapper_widget_1462360389044" class="hs_cos_wrapper hs_cos_wrapper_widget hs_cos_wrapper_type_custom_widget" style="" data-hs-cos-general-type="widget" data-hs-cos-type="custom_widget">
<!-- finally, we have the carousel items here -->
<div class="item">
<div class="hero" style="height: 765px; min-height: 300px; background-image: url(image.jpg);"></div><!-- end hero-->
<div class="container carousel-caption">Test hero</div>
</div><!-- carousel item -->
</div> <!-- added Hubspot div around each item div -->
</span> <!-- added Hubspot span -->
</div> <!-- carousel-inner div -->
我的方法是从自定义模块中删除 "item"。而是用 jquery 将每个自定义模块包装在其中。例如,为包含模块的列提供 class "bootstrap-flex"。然后添加:
$('.bootstrap-flex > span').wrapInner("<div class='carousel-inner'></div>");
$('.carousel-inner .hs_cos_wrapper_type_custom_widget').each(function() {
$(this).wrap("<div class='item'></div>");
});