尝试编写一个小脚本来添加/删除基于窗口的类,
任何帮助,将不胜感激。
<script type="text/javascript">
$(document).ready( function() {
if ($(window).width() < 500) {
$('.single-post-rating').removeClass('col-xs-3');
$('.single-post-rating').addClass('col-xs-12');
$('.guide-excerpt').removeClass('col-xs-9');
$('.guide-excerpt').addClass('col-xs-12');
}
else {
$('.single-post-rating').addClass('col-xs-3');
$('.single-post-rating').removeClass('col-xs-12');
$('.guide-excerpt').addClass('col-xs-9');
$('.guide-excerpt').removeClass('col-xs-12');
}
});
</script>