other.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. $(function () {
  2. $(".datagrid-cell-c1-itembtn span input[type=checkbox]").click(function () {
  3. $(this).attr("checked", true);
  4. });
  5. $("#add").click(function () {
  6. $(".inp").slideDown(1000);
  7. });
  8. $("#edit").click(function () {
  9. $(".editinp").slideDown(1000);
  10. if ($(".tab tr td input[type=checkbox]").is(":checked")) {
  11. var iinfo = $(".tab tr td input[type=checkbox]:checked")
  12. .parent().next(".i").text();
  13. $(".editinp h3 span").text("id = "+iinfo);
  14. var t0 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(1).text();
  15. var t1 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(2).text();
  16. var t2 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(3).text();
  17. var t3 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(4).text();
  18. var t4 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(5).text();
  19. var t5 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(6).text();
  20. var t6 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(7).text();
  21. var t7 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(8).text();
  22. var t8 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(9).text();
  23. var t9 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(10).text();
  24. var t10 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(11).text();
  25. var t11 = $(".tab tr td input[type=checkbox]:checked").parent().parent().children().eq(12).text();
  26. $(".editinp input[type=text]").eq(0).val(t0);
  27. $(".editinp input[type=text]").eq(1).val(t1);
  28. $(".editinp input[type=text]").eq(2).val(t2);
  29. $(".editinp input[type=text]").eq(3).val(t3);
  30. $(".editinp input[type=text]").eq(4).val(t4);
  31. $(".editinp input[type=text]").eq(5).val(t5);
  32. $(".editinp input[type=text]").eq(6).val(t6);
  33. $(".editinp input[type=text]").eq(7).val(t7);
  34. $(".editinp input[type=text]").eq(8).val(t8);
  35. $(".editinp input[type=text]").eq(9).val(t9);
  36. $(".editinp input[type=text]").eq(10).val(t10);
  37. $(".editinp input[type=text]").eq(11).val(t11);
  38. }
  39. });
  40. $("#sub").click(function () {
  41. var i1 = $(".inp input[type=text]").eq(0).val();
  42. var i2 = $(".inp input[type=text]").eq(1).val();
  43. var i3 = $(".inp input[type=text]").eq(2).val();
  44. var f1 = $(".inp input[type=file]").val();
  45. var filename = getFileName(f1);
  46. $(".inp").submit();
  47. $(".inp").slideUp(1000);
  48. });
  49. $("#editsub").click(function () {
  50. // console.log($(".tab tr td input[type=checkbox]").is(":checked"));
  51. $(".editinp").submit();
  52. $(".editinp").slideUp(1000);
  53. });
  54. $("#del").click(function () {
  55. $(".delinp").slideDown(1000);
  56. if ($(".tab tr td input[type=checkbox]").is(":checked")) {
  57. var iinfo = $(".tab tr td input[type=checkbox]:checked")
  58. .parent().next(".i").text();
  59. $(".delinp h3 span").text(iinfo);
  60. $(".delinp input[type=text]").val(iinfo);
  61. }
  62. $("#su").submit(function () {
  63. $(".delinp").slideUp(1000);
  64. })
  65. });
  66. });
  67. function getFileName(o){
  68. var pos=o.lastIndexOf("\\");
  69. return o.substring(pos+1);
  70. }
  71. var timer;
  72. var offset = 0;
  73. $(function () {
  74. $(".cont .wr #cont .slid .shoplist>li").hover(function () {
  75. var t = $(this).index()+"px";
  76. $(this).children().css("display","block")
  77. .css("top",t).css("left","210px");
  78. },function () {
  79. $(this).children().css("display","none");
  80. $(this).children().hover(function () {
  81. },function () {
  82. $(this).css("display","none");
  83. });
  84. });
  85. autoplay();
  86. $(".cont .wr #cont .lunbo .imglist").hover(function () {
  87. clearInterval(timer);
  88. },function () {
  89. autoplay();
  90. });
  91. $(".cont .wr #cont .selectli .ullist>li").hover(function () {
  92. var i = $(this).index();
  93. $(".cont .wr #cont .lunbo>.imglist").css("marginLeft",-633 *i);
  94. clearInterval(timer);
  95. },function () {
  96. var i = $(this).index();
  97. offset = -633 *i;
  98. autoplay();
  99. });
  100. $("#open").click(function () {
  101. $("#close").css("display","block");
  102. $("#open").css("display","none");
  103. $(this).parent().children(".shoplist").css("height","600px");
  104. $(".cont .wr #cont .slid .shoplist>li:nth-child(n+10)").css("display","block");
  105. });
  106. $("#close").click(function () {
  107. $("#open").css("display","block");
  108. $("#close").css("display","none");
  109. $(this).parent().children(".shoplist").css("height","300px");
  110. $(".cont .wr #cont .slid .shoplist>li:nth-child(n+10)").css("display","none");
  111. });
  112. });
  113. function autoplay() {
  114. clearInterval(timer);
  115. timer = setInterval(function () {
  116. offset -= 10;
  117. if (offset<=-2560){
  118. offset = 0;
  119. }
  120. $(".cont .wr #cont .lunbo .imglist").css("marginLeft",offset);
  121. },50);
  122. }