jQuery新手。主要是喜欢它,但在将我的所有页面命令编译成单个.js文档时遇到了一些麻烦。
当我尝试将以下任何命令从页头移动到functions.js时,它们最好停止工作,最坏的情况也会干扰其他功能。
我该如何清理它?
<!-- leanModal -->
<script type="text/javascript" src="_/js/jquery.leanModal.min.js"></script>
<script type="text/javascript">
$(function() {
$('a[rel*=leanModal]').leanModal({ top : 70, closeButton: ".modal_close" });
});
</script>
<!-- sticky -->
<script src="_/js/jquery.sticky.min.js"></script>
<script>
$(window).load(function(){
$("#chapters").sticky({ topSpacing: 54 });
});
</script>
<!-- customSelect -->
<script type="text/javascript" src="_/js/jquery.customSelect.min.js"></script>
<script type="text/javascript">
$(function(){
$('#risk select').customSelect();
});
</script>
<!-- happy.js -->
<script src="_/js/happy.js"></script>
<script src="_/js/happy.methods.js"></script>
<script>
$(document).ready(function () {
$('#consultation, #risk').isHappy({
fields: {
'#consultation-name': {
required: true,
message: 'Please share your name'
},
'#risk-email': {
required: true,
message: 'Please share your email'
}
}
});
});
</script>