js代码
<script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/amazeui.min.js"></script> <script type="text/javascript" src="js/zUI.js"></script> <script type="text/javascript" src="js/wechat.js"></script> <script type="text/javascript"> //三图标 window.onload=function(){ function a(){ var si1 = document.getElementById('si_1'); var si2 = document.getElementById('si_2'); var si3 = document.getElementById('si_3'); si1.onclick=function(){ si1.style.background="url(images/icon/head_2_1.png) no-repeat" si2.style.background=""; si3.style.background=""; }; si2.onclick=function(){ si2.style.background="url(images/icon/head_3_1.png) no-repeat" si1.style.background=""; si3.style.background=""; }; si3.onclick=function(){ si3.style.background="url(images/icon/head_4_1.png) no-repeat" si1.style.background=""; si2.style.background=""; }; }; function b(){ var text = document.getElementById('input_box'); var chat = document.getElementById('chatbox'); var btn = document.getElementById('send'); var talk = document.getElementById('talkbox'); btn.onclick=function(){ if(text.value ==''){ alert('不能发送空消息'); }else{ chat.innerHTML += '<li class="me"><img src="'+'images/own_head.jpg'+'"><span>'+text.value+'</span></li>'; text.value = ''; chat.scrollTop=chat.scrollHeight; talk.style.background="#fff"; text.style.background="#fff"; }; }; }; a(); b(); }; </script>