admin.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. $(function() {
  2. //操作提示缩放动画
  3. $("#checkZoom").toggle(
  4. function() {
  5. $("#explanation").animate({
  6. color: "#FFF",
  7. backgroundColor: "#4FD6BE",
  8. width: "80",
  9. height: "20",
  10. },300);
  11. $("#explanationZoom").hide();
  12. },
  13. function() {
  14. $("#explanation").animate({
  15. color: "#2CBCA3",
  16. backgroundColor: "#EDFBF8",
  17. width: "99%",
  18. height: "20",
  19. },300,function() {
  20. $(this).css('height', '100%');
  21. });
  22. $("#explanationZoom").show();
  23. }
  24. );
  25. //自定义radio样式
  26. $(".cb-enable").click(function(){
  27. var parent = $(this).parents('.onoff');
  28. $('.cb-disable',parent).removeClass('selected');
  29. $(this).addClass('selected');
  30. $('.checkbox',parent).attr('checked', true);
  31. });
  32. $(".cb-disable").click(function(){
  33. var parent = $(this).parents('.onoff');
  34. $('.cb-enable',parent).removeClass('selected');
  35. $(this).addClass('selected');
  36. $('.checkbox',parent).attr('checked', false);
  37. });
  38. // 显示隐藏预览图 start
  39. $('.show_image').hover(
  40. function(){
  41. $(this).next().css('display','block');
  42. },
  43. function(){
  44. $(this).next().css('display','none');
  45. }
  46. );
  47. // 全选 start
  48. $('.checkall').click(function(){
  49. $('.checkall').attr('checked',$(this).attr('checked') == 'checked');
  50. $('.checkitem').each(function(){
  51. $(this).attr('checked',$('.checkall').attr('checked') == 'checked');
  52. });
  53. });
  54. $("#btnGet").click(function () {
  55. $("body,html").animate({ scrollTop: 480 }, 800);
  56. });
  57. var isPostback = 'False';
  58. /* BACK TO TOP */
  59. if (isPostback == "False") {
  60. /* 窗体滚动事件 */
  61. $(window).scroll(function () {
  62. //判断滚动条的垂直位置是否大于0,说白了就是:判断滚动条是否在顶部
  63. if ($(window).scrollTop() <= 0) {
  64. $("#goTop").stop(true, false).animate({ bottom: "-156px" }, 500); //动画隐藏ID="doTop"的这个层
  65. } else {
  66. $("#goTop").stop(true, false).animate({ bottom: "30px" }, 500); //动画显示ID="doTop"的这个层
  67. }
  68. });
  69. /* 此方法可以不加,这里加这个的目的是去除在IE下点击出现的虚线框 */
  70. $("button").click(function () {
  71. if (this.focus) {
  72. this.blur();
  73. }
  74. })
  75. /* 点击返回顶部箭头的事件 */
  76. $("#btntop").click(function () {
  77. $("body,html").animate({ scrollTop: 0 }, 500); //返回顶部,用JQ的animate动画
  78. });
  79. /* 点击返回底部箭头的事件 */
  80. $("#btnbottom").click(function () {
  81. $("body,html").animate({ scrollTop: document.body.clientHeight }, 500); //返回底部,用JQ的animate动画
  82. });
  83. var adsId = '14406';
  84. if (adsId == "13868" || adsId == "14406") {
  85. setTimeout('$(".slidePopupBox").slideUp("slow")', 1500);
  86. } else {
  87. $(".slidePopupBox").hide();
  88. }
  89. } else {
  90. $(".slidePopupBox").hide();
  91. }
  92. // 高级搜索边栏动画
  93. $('#searchBarOpen').click(function() {
  94. $('.ncap-search-ban-s').animate({'right': '-40px'},200,
  95. function() {
  96. $('.ncap-search-bar').animate({'right': '0'},300);
  97. });
  98. });
  99. $('#searchBarClose').click(function() {
  100. $('.ncap-search-bar').animate({'right': '-240px'}, 300,
  101. function() {
  102. $('.ncap-search-ban-s').animate({'right': '0'}, 200);
  103. });
  104. });
  105. // 搜索项目过多时出现滚动条
  106. $('#searchCon').height($(window).height()-90).perfectScrollbar();
  107. });
  108. /* 火狐下取本地全路径 */
  109. function getFullPath(obj)
  110. {
  111. if(obj)
  112. {
  113. // ie
  114. if (window.navigator.userAgent.indexOf("MSIE")>=1)
  115. {
  116. obj.select();
  117. if(window.navigator.userAgent.indexOf("MSIE") == 25){
  118. obj.blur();
  119. }
  120. return document.selection.createRange().text;
  121. }
  122. // firefox
  123. else if(window.navigator.userAgent.indexOf("Firefox")>=1)
  124. {
  125. if(obj.files)
  126. {
  127. //return obj.files.item(0).getAsDataURL();
  128. return window.URL.createObjectURL(obj.files.item(0));
  129. }
  130. return obj.value;
  131. }
  132. return obj.value;
  133. }
  134. }
  135. $(function(){
  136. $(".bDiv").scroll(function(){
  137. var bdiv = $(".bDiv").scrollLeft();
  138. $('.hDiv').css('overflow','auto').scrollLeft(bdiv);
  139. });
  140. })