You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.3 KiB

8 years ago
  1. $(function(){
  2. $.ajaxSetup({
  3. cache: false //关闭AJAX相应的缓存
  4. });
  5. $("#btn-login").click(function(event){
  6. $('body').append('<div class="mask" id="login-box"><div class="login-outer"><div class="login-title">社交账号登录<a href="javascript:closediv(\'#login-box\');" class="btn-close" id="btn-close">关闭</a></div><div class="login-method"><a href="javascript:;" class="btn-login btn-qq"><span></span>用 QQ 登录</a></div></div></div>');
  7. });
  8. });
  9. //打印对象
  10. function alertObj(obj)
  11. {
  12. var output = "";
  13. for(var i in obj){
  14. var property=obj[i];
  15. output+=i+" = "+property+"\n";
  16. }
  17. alert(output);
  18. }
  19. //根据id删除div
  20. function closediv(divid)
  21. {
  22. $(divid).remove();
  23. }
  24. //删除确认框
  25. function delconfirm(url)
  26. {
  27. if(confirm("确定删除吗"))
  28. {
  29. location.href= url;
  30. }
  31. else
  32. {
  33. }
  34. }
  35. //复选框反选
  36. function selAll(arcID)
  37. {
  38. var checkboxs=document.getElementsByName(arcID);
  39. for (var i=0;i<checkboxs.length;i++)
  40. {
  41. var e=checkboxs[i];
  42. e.checked=!e.checked;
  43. }
  44. }
  45. //获取选中的复选框的值
  46. function getItems(arcID)
  47. {
  48. if(!arcID){arcID='arcID';}
  49. var checkboxs=document.getElementsByName(arcID);
  50. var value = new Array();
  51. for(var i = 0; i < checkboxs.length; i++)
  52. {
  53. if(checkboxs[i].checked) value.push(checkboxs[i].value);
  54. }
  55. return value;
  56. }