如何使用 jQuery 手风琴并在流入标题的内容中添加背景图像?我已经能够使标题透明,但我似乎无法将它们组合起来。我不知道这是否可能,因为它们是分开的h3
,并且divs
.
<style type="text/css">
html,body{
height: 100%;
}
.ui-accordion-content{
background:url('{{ url_for('static',filename='img/building_img/4/bg4_black.jpg') }}');
background-size: cover;
background-repeat: no-repeat;
}
</style>
<div id="accordion2">
<h3>building.name</h3>
<div>
<p>Mauris mauris ante, blandit et, ultrices a, suscipit eget.
Integer ut neque. Vivamus nisi metus, molestie vel, gravida in,
condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros.
Nam mi. Proin viverra leo ut odio.</p>
</div>
</div>
<script>
$(function(){
$( "#accordion2" ).accordion({
heightStyle: "fill"
});
$(window).resize(function(){
// update accordion height
$( "#accordion2" ).accordion( "refresh" )
});
})
</script>