1
我想在下划线模板的内部元素上使用jQueryMobile样式。它看起来像样式应该得到应用,因为它显示在计算的样式中,但它没有被应用。另一方面,我自己的CSS定义得到应用。请任何人都可以告诉我我在这里做错了什么?jQuery手机CSS样式不应用在下划线模板
下划线模板:
<script type="text/template" id="test-template">
<!-- jQueryMobile Styling does not work here... -->
<a href="#" id="button2" data-role="button" data-icon="arrow-r" data-iconpos="right">Button 2 (jquery style doesn't work)</a>
<a href="#" id="button3" data-role="button" data-icon="arrow-r" data-iconpos="right">Button 2 (local css style works)</a>
</script>
的JavaScript:
$("#app-content").html(_.template($('#test-template').html()));
CSS:
#button3 {
background-color: red;
}
请参阅我的jsfiddle这里: http://jsfiddle.net/DanielBank/WJzTn/
真棒,这正是我一直在寻找。 – Sotelo