wap128.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. // JavaScript Document
  2. /*多选*/
  3. var selectCheckbox = function(name,status)
  4. {
  5. $("input[name='"+name+"']").attr("checked",status);
  6. }
  7. var selectCZClass = function() {
  8. var select = $("#czclass");
  9. var cid = select.val();
  10. if (cid > 0) {
  11. location.href = "/list_" + cid + ".htm";
  12. }
  13. }
  14. var numcover = function (priffix0)
  15. {
  16. priffix0 = priffix0 || false;
  17. $("li.ballbox span.ball").each(function ()
  18. {
  19. var me = $(this), _num = me.html();
  20. if (isNaN(_num)) return;
  21. if (priffix0)
  22. {
  23. if (_num.length === 1)
  24. me.html("0" + _num);
  25. } else
  26. {
  27. if (_num.length === 2 && _num[0] === "0")
  28. me.html(_num.substr(1, 1));
  29. }
  30. });
  31. }
  32. /*底部固定栏*/
  33. /*if(typeof document.compatMode!='undefined'&&document.compatMode!='BackCompat'){
  34. cot_t1_DOCtp="_top:expression(document.documentElement.scrollTop+document.documentElement.clientHeight-this.clientHeight);_left:expression(document.documentElement.scrollLeft + document.documentElement.clientWidth - offsetWidth);}";
  35. }else{
  36. cot_t1_DOCtp="_top:expression(document.body.scrollTop+document.body.clientHeight-this.clientHeight);_left:expression(document.body.scrollLeft + document.body.clientWidth - offsetWidth);}";
  37. }
  38. var fdc_bodyCSS='* html {}';
  39. var fdcCSS='#footer {position:fixed;';
  40. var fdcCSS=fdcCSS+'_position:absolute; ';
  41. var fdcCSS=fdcCSS+'width:100%;';
  42. var fdcCSS=fdcCSS+'bottom:0px;';
  43. var fdcCSS=fdcCSS+'right:0px;';
  44. var fdcCSS=fdcCSS+'clip:rect(0 100% 100% 0);';
  45. var fdcCSS=fdcCSS+cot_t1_DOCtp;
  46. document.write('<style type="text/css">'+fdc_bodyCSS+fdcCSS+'</style>');*/
  47. /*顶部子导航*/
  48. function extend(){
  49. document.getElementById("ctl-llist").style.display = "block";
  50. }
  51. function over(){
  52. document.getElementById("ctl-llist").style.display = "none";
  53. }
  54. function hide(){
  55. document.getElementById("ctl-llist").style.display = "none";
  56. }
  57. function hideNav(){
  58. $(".ctl-list").slideUp(400);
  59. }
  60. function unfold(){
  61. var unfolds=document.getElementById("unfold")
  62. var enlarge = document.getElementById("enlarge");
  63. if(enlarge.style.display!=""){
  64. enlarge.style.display="";
  65. unfolds.className="unfold-up"
  66. }else{enlarge.style.display="none";
  67. unfolds.className="unfold"
  68. };
  69. }
  70. /*子导航左右切换*/
  71. $(document).ready(function(e) {
  72. $(".right").click(function(){
  73. var ico=$(".snav").children("a");
  74. var navPos = $(".snav").position();
  75. var widths=ico.width();
  76. var snavWidth=widths*ico.length-1;
  77. var last=snavWidth-(widths*4);
  78. if(Math.abs(navPos.left)%widths*3==0){
  79. if(navPos.left>-last){
  80. $(".snav").css({left:(navPos.left-(widths*3))+"px"});
  81. $(".left").css({display:"block"});
  82. }else{$(".right").css({display:"none"});}
  83. }
  84. });
  85. if($(".left").css="block"){
  86. $(".left").click(function(){
  87. $(".right").css({display:"block"})
  88. var ico=$(".snav").children("a");
  89. var navPos = $(".snav").position();
  90. var widths=ico.width();
  91. var snavWidth=widths*ico.length-1;
  92. var last=snavWidth-(widths*4);
  93. if(Math.abs(navPos.left)%widths*3==0){
  94. if(navPos.left<-widths){
  95. $(".snav").css({left:(navPos.left+(widths*3))+"px"});
  96. }else{$(".left").css({display:"none"});}
  97. }
  98. })
  99. }
  100. });
  101. /*工具页面滚动*/
  102. /*var myScroll,scroll1;
  103. function loaded () {
  104. myScroll = new IScroll('#wrapper', { mouseWheel: true,scrollbars: true,preventDefault:false,});
  105. click:iScrollClick();
  106. }
  107. document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);*/
  108. /*选项卡切换*/
  109. $(document).ready(function(){
  110. $(function(){
  111. $(".tab-mune").find("li").click(function(){
  112. $(".tab-mune").find("li").attr('class','');
  113. $(".posi-num").find("section").attr('class','hide');
  114. $(".content").find("section").attr('class','hide');
  115. $(".posi-fsnum").find("ul").attr('class','hide');
  116. $(".help-notice").find("ul").attr('class','hide');
  117. $(".shrink").find("ul").attr('class','hide');
  118. $(this).attr('class','select');
  119. $(".content").find("section").eq($(this).index()).attr('class','');
  120. $(".posi-fsnum").find("ul").eq($(this).index()).attr('class','');
  121. $(".shrink").find("ul").eq($(this).index()).attr('class','');
  122. $(".posi-num").find("section").eq($(this).index()).attr('class','');
  123. $(".help-notice").find("ul").eq($(this).index()).attr('class','');
  124. })
  125. })
  126. $(function(){
  127. $(".snav").find("a").click(function(){
  128. $(".snav").find("a").attr('class','');
  129. $(".num-result").find("ul").attr('class','hide');
  130. $(".swiper").find("section").attr('class','hide');
  131. $(this).attr('class','active');
  132. $(".swiper").find("section").eq($(this).index()).attr('class','');
  133. $(".num-result").find("ul").eq($(this).index()).attr('class','');
  134. })
  135. })
  136. $(function(){
  137. $(".snav").find("a").click(function(){
  138. $(".snav").find("a").attr('class','');
  139. $(".ssq-gs").find("ul").attr('class','hide');
  140. $(this).attr('class','active')
  141. $(".snav").offset({left:"4rem"})
  142. $(".ssq-gs").find("ul").eq($(this).index()).attr('class','');
  143. })
  144. })
  145. })
  146. /*跟随号分析详情展示*/
  147. $(document).ready(function(e) {
  148. $('.hidden').hide();
  149. $(".ssq-gs").find("li").click(function(){
  150. $(this).next().siblings("li").find("a").attr('class','');
  151. $(this).find("dl").slideDown();
  152. $(this).find("a").attr('class','blue');
  153. $(this).siblings("li").find("dl").slideUp();
  154. })
  155. });
  156. /*3d跟随号分析*/
  157. $(document).ready(function() {
  158. $('.hidden').hide();
  159. $(".list").click(function(){
  160. $(this).next().siblings(".list").find("a").attr('class','');
  161. $(this).next().slideDown();
  162. $(this).find("a").attr('class','blue');
  163. $(this).next().siblings(".hidden").slideUp();
  164. })
  165. });
  166. //走势图doms左右滑动事件
  167. (function (e, y) {
  168. "use strict";
  169. y.trend = { viewScroll: {}, page: {} },
  170. y.trend.init = function () {
  171. setTimeout("caiba.trend.autoWidth()", 9);
  172. y.trend.viewScroll.animating = !1;
  173. y.trend.touchEvents();
  174. },
  175. y.trend.touchEvents = function () {
  176. e("#ctl-llist").css("display","none");
  177. if (document.getElementById("doms")){
  178. y.trend.viewScroll = new iScroll("doms", {
  179. hScrollbar: !1,
  180. vScrollbar: !1,
  181. onScrollMove: function (r) {
  182. y.trend.move(r);
  183. },
  184. onAnimating: function (r) {
  185. y.trend.move(r);
  186. }
  187. });
  188. return;
  189. }
  190. if(document.getElementById("demo-pointmove")){
  191. var fistDiv=$("#demo-pointmove").children("div").eq(0);
  192. fistDiv.width($("#chartBody").width());
  193. y.trend.viewScroll = new iScroll("demo-pointmove", {
  194. hScrollbar: !1,
  195. vScrollbar: !1,
  196. onScrollMove: function (r) {
  197. y.trend.move(r);
  198. },
  199. onAnimating: function (r) {
  200. y.trend.move(r);
  201. }
  202. });
  203. return;
  204. }
  205. },
  206. y.trend.move = function (r) {
  207. var x = r.x;
  208. var y = r.y;
  209. e("#divqh").css("transform", "translate(0px, {0}px) scale(1) translateZ(0px)".format(y));
  210. e("#divqh").css("-webkit-transform", "translate(0px, {0}px) scale(1) translateZ(0px)".format(y));
  211. e("#divqh").css("-ms-transform", "translate(0px, {0}px) scale(1) translateZ(0px)".format(y));
  212. e("#divqh").css("-o-transform", "translate(0px, {0}px) scale(1) translateZ(0px)".format(y));
  213. e("#divqh").css("-moz-transform", "translate(0px, {0}px) scale(1) translateZ(0px)".format(y));
  214. e("#divhead").css("transform", "translate({0}px, 0px) scale(1) translateZ(0px)".format(x));
  215. e("#divhead").css("-webkit-transform", "translate({0}px, 0px) scale(1) translateZ(0px)".format(x));
  216. e("#divhead").css("-ms-transform", "translate({0}px, 0px) scale(1) translateZ(0px)".format(x));
  217. e("#divhead").css("-o-transform", "translate({0}px, 0px) scale(1) translateZ(0px)".format(x));
  218. e("#divhead").css("-moz-transform", "translate({0}px, 0px) scale(1) translateZ(0px)".format(x));
  219. //e("#demo-pointmove .banner-text").css("left",-x-50);
  220. //e("#demo-pointmove .footer").css("left",-x-50);
  221. e("#demo-pointmove .wrap").css("transform", "translate(0px, {0}px) scale(1) translateZ(0px)");
  222. e("#demo-pointmove .wrap").css("left",-x-50);
  223. //e("#stats").css("left",-x);
  224. if(y<-100){
  225. e(".banner-text").css("display","none");
  226. e("#demo-pointmove .banner-text").css("display","block");
  227. e(".overflow").css("display","none");
  228. e(".subnav").css("display","none");
  229. var _t = e(".topbar").height();
  230. var _sh = e(window).height() - _t;
  231. var _dh = $(".chart-header").height();
  232. e("#demo-pointmove").css("height", _sh);
  233. e("#doms").css("height",_sh);
  234. e(".qihao .left_conh6").css("height", _sh);
  235. e('.ncc.top').css('display','none');
  236. }else{
  237. e(".banner-text").css("display","block");
  238. e(".overflow").css("display","block");
  239. e(".subnav").css("display","block");
  240. e('.ncc.top').css('display','block');
  241. }
  242. },
  243. y.trend.autoWidth = function () {
  244. y.trend.viewScroll.refresh();
  245. },
  246. e(function () {
  247. y.trend.init();
  248. })
  249. })(jQuery, caiba)
  250. $(document).ready(function(){
  251. var preH =$('.presele-title').height()
  252. $("#demo-pointmove .wrap").width($("#demo-pointmove").width());
  253. $(".presele-title").css('lineHeight',preH+'px');
  254. $(".bg-black").height($(window).height());
  255. $(".bg-black").width($("#demo-pointmove").width());
  256. var wh = $('.bg-black').height();
  257. $("#set-chart").click(function(){
  258. $('.bg-black').css("display","block");
  259. var sh = $('.search-box').height();
  260. var mh = wh-sh-42;
  261. $(".search-box").css("margin-top",(mh/2));
  262. })
  263. $('.cancel').click(function(){$('.bg-black').css("display","none");})
  264. $('#show-nav').click(function(){
  265. if($('.zst-subnav').css("display")=="none"){
  266. $('.zst-subnav').css("display","block");
  267. $('#show-nav img').attr({src:"../static/images/up-icon.png"});
  268. }else{
  269. $('.zst-subnav').css("display","none");
  270. $('#show-nav img').attr({src:"../static/images/down-icon.png"});
  271. }
  272. })
  273. $('.kancl').click(function(){
  274. $('.kancla').css('display','block');
  275. $(this).css('display','none')
  276. var kHigh = $(window).height()/2;
  277. var pH = $('.kancla').find('p').height()/2;
  278. var kanclaPh=kHigh-pH;
  279. $('.kancla').find('p').css('top',kanclaPh+'px')
  280. })
  281. $('.kancla').click(function(){
  282. $(this).css('display','none');
  283. $('.kancl').css('display','block');
  284. })
  285. //2016-11-2
  286. var agent = navigator.userAgent.toLowerCase() ;
  287. var version;
  288. if(agent.indexOf("like mac os x") > 0){
  289. var regStr_saf = /os [\d._]*/gi ;
  290. var verinfo = agent.match(regStr_saf) ;
  291. version = (verinfo+"").replace(/[^0-9|_.]/ig,"").replace(/_/ig,".");
  292. }
  293. var version_str = version+"";
  294. if(version_str != "undefined" && version_str.length >0){
  295. version=version.substring(0,2);
  296. if(version>=10){
  297. var s = $('#trendBox').find('col');
  298. var w=[];
  299. for(var i=0;i<s.length;i++){
  300. w.push(s[i].width-.35);
  301. }
  302. for(var i=0;i<s.length;i++){
  303. s[i].width= w[i];
  304. }
  305. var h = $('#chartData').find('td');
  306. for(var i=0;i<h.length;i++){
  307. h[i].style.height='1.278rem';
  308. }
  309. }
  310. }
  311. })