js代码
<script src="js/jquery-1.8.3.min.js"></script> <script> $(function(){ //填写信息 $('.infor-sub').click(function(e){ $('.layer').hide(); $('.form').hide(); e.preventDefault(); //阻止表单提交 }) // 监听#div内容变化,改变支付按钮的颜色 $('#div').bind('DOMNodeInserted', function(){ if($("#div").text()!="" || $("#div").text()>'0'){ $('.submit').removeClass('active'); $('.submit').attr('disabled', false); }else{ $('.submit').addClass('active'); $('.submit').attr('disabled', true); } }) $('#div').trigger('DOMNodeInserted'); $('.shuru').click(function(e){ $('.layer-content').animate({ bottom: 0 }, 200) e.stopPropagation(); }) $('.wrap').click(function(){ $('.layer-content').animate({ bottom: '-200px' }, 200) }) $('.form_edit .num').click(function(){ var oDiv = document.getElementById("div"); oDiv.innerHTML += this.innerHTML; }) $('#remove').click(function(){ var oDiv = document.getElementById("div"); var oDivHtml = oDiv.innerHTML; oDiv.innerHTML = oDivHtml.substring(0,oDivHtml.length-1); }) }) </script>