I can not figure out how can i add jQuery-ui accordion to the checkout page block that this sample module, what is made by @sohelrana09, creates?
.../web/template/checkout/shipping/additional-block.html
<div data-bind="visible: canVisibleBlock">
<div id="accordion">
<h3>Section 1</h3>
<div><p>Mauris mauris ante</p></div>
<h3>Section 2</h3>
<div><p>Sed non urna.</p></div>
</div>
<script>
require([
'jquery', 'jquery/ui'],function ($, accordion) {
$(document).ready(function(){//
});
setTimeout(function(){
$(window).load(function(){
$("#accordion").accordion({
heightStyle: "content"
});
});}, 2000);
});
</script>
</div>
Reading Magento 2 documentation i know that magento 2 does not contain jQuery ui styles locally. Because of that i created custom css where i dropped accordion styling .css fail content. I added stylesheet to checkout_index_index.xml file head section.
I can not use require(['jQuery','tabs']..
in script section of html file because it gets the css file though the jQuery page url that does not use https. I also have found this magento.stackexchange post but don't know if and how it would help me.
What i added to .../frontend/layout/checkout_index_index.xml file:
<head>
<css src="SR_AdditionalShippingBlock::css/accordion.css"/>
</head>