portal html css js resource

common.js 37KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336
  1. //var wlogurl="http://192.168.3.233:8080"
  2. var wlogurl="http://www.ekexiu.com:8082";
  3. $(document).ready(function() {
  4. $(".unlogin").show();
  5. $(".onlogin").hide();
  6. var footerHeight = $("footer").outerHeight(true);
  7. $('#container').css("padding-bottom", footerHeight + "px");
  8. $(".footer_tools").css("bottom", (footerHeight+10) + "px");
  9. $(window).resize(function() {//窗口大小变更事件
  10. footerHeight = $("footer").outerHeight(true);
  11. $('#container').css("padding-bottom", footerHeight + "px");
  12. });
  13. //底部企业入驻
  14. var orgid = $.cookie('orgId');
  15. $("#cmpSet2").on("click", function() {
  16. if(orgid && orgid != "null" && orgid != null) {
  17. location.href = "cmp-portal/cmp-workspaces.html"
  18. } else {
  19. location.href = "cmp-portal/cmp-settled-reg.html"
  20. }
  21. })
  22. $("#cmpSet3").on("click", function() {
  23. if(orgid && orgid != "null" && orgid != null) {
  24. location.href = "/cmp-portal/cmp-workspaces.html"
  25. } else {
  26. location.href = "/cmp-portal/cmp-settled-reg.html"
  27. }
  28. })
  29. //搜索框跳转页面
  30. $("#search").on("click", function() {
  31. var searchContent = $("#searchContent").val();
  32. setTimeout(function(){location.href = "searchNew.html?searchContent=" + encodeURI(searchContent)},300);
  33. });
  34. $("#search").on("click", function() {
  35. var searchContent = $("#searchContent").val().replace(/^\s*|\s*$/,"");
  36. if(searchContent) {
  37. wlog("kw", searchContent)
  38. }
  39. });
  40. //enter绑定时间
  41. $("#searchContent").keydown(function(e) {
  42. if(e.which == 13) {
  43. var searchContent = $("#searchContent").val();
  44. console.log(searchContent);
  45. location.href = "searchNew.html?searchContent=" + encodeURI(searchContent);
  46. }
  47. })
  48. $("#hsearchContent").keydown(function(e) {
  49. if(e.which == 13) {
  50. var searchContent = $("#hsearchContent").val();
  51. if($(this).siblings()[0].id=="searchh") {
  52. location.href = "/searchNew.html?searchContent=" + encodeURI(searchContent);
  53. return;
  54. }
  55. location.href = "searchNew.html?searchContent=" + encodeURI(searchContent);
  56. }
  57. })
  58. $("#hsearch").on("click", function() {
  59. var searchContent = $("#hsearchContent").val();
  60. setTimeout(function(){
  61. location.href = "searchNew.html?searchContent=" + encodeURI(searchContent);
  62. },300)
  63. });
  64. $("#searchh").on("click", function() {
  65. var searchContent = $("#hsearchContent").val();
  66. setTimeout(function(){
  67. location.href = "/searchNew.html?searchContent=" + encodeURI(searchContent);
  68. },300)
  69. });
  70. $("#hsearch").on("click", function() {
  71. var searchContent = $("#hsearchContent").val().replace(/^\s*|\s*$/,"");
  72. if(searchContent) {
  73. wlog("kw", searchContent)
  74. }
  75. });
  76. /*向下滚动时,header背景变半透明*/
  77. $(document).scroll(function() {
  78. var top = $(document).scrollTop();
  79. if(top == 0) {
  80. $(".navheader").removeClass("navhdown");
  81. } else {
  82. $(".navheader").addClass("navhdown");
  83. }
  84. if(top >= 300) {
  85. $(".content-left").css({
  86. "position": "fixed",
  87. "top": "80px"
  88. })
  89. } else {
  90. $(".content-left").css({
  91. "position": "static"
  92. })
  93. }
  94. });
  95. /*选择省份*/
  96. $(document).on("click", "#Province li a", function() {
  97. var aVal = $(this).text();
  98. $(this).parent().parent().parent().find('.mr_show').text(aVal);
  99. $(this).parent().parent().parent().find('input[name=cho_Province]').val(aVal);
  100. if($("#oprovince").text() == "请选择省/直辖市") {
  101. $("#oprovince").removeClass("mr_select");
  102. $("#ocity").removeClass("mr_select");
  103. } else {
  104. $("#oprovince").addClass("mr_select");
  105. $("#ocity").removeClass("mr_select");
  106. }
  107. });
  108. /*选择城市填充js */
  109. $(document).on("click", "#City li a", function() {
  110. var aVal = $(this).text();
  111. $(this).parent().parent().parent().find('.mr_show').text(aVal);
  112. $(this).parent().parent().parent().find('input[name=cho_City]').val(aVal);
  113. if($("#ocity").text() == "请选择城市") {
  114. $("#ocity").removeClass("mr_select");
  115. } else {
  116. $("#ocity").addClass("mr_select");
  117. }
  118. });
  119. /*多行文本框样式(带有限制数字)模拟focus效果*/
  120. $(".msgContbox textarea").focus(function() {
  121. $(this).parent().css("border-color", "#ff9900");
  122. }).blur(function() {
  123. $(this).parent().css("border-color", "#E5E5E5");
  124. })
  125. });
  126. var userid;
  127. function exit() {
  128. $.cookie('userid', null);
  129. $.cookie('userAuth', null);
  130. $.cookie('userEmail', null);
  131. $.cookie('userMobilePhone', null);
  132. $.cookie('userName', null);
  133. $.cookie('userType', null);
  134. location.href = "index.html"
  135. }
  136. function exitStaticize() {
  137. $.cookie('userid', null,{ path: '/' });
  138. $.cookie('userAuth', null,{ path: '/' });
  139. $.cookie('userEmail', null,{ path: '/' });
  140. $.cookie('userMobilePhone', null,{ path: '/' });
  141. $.cookie('userName', null,{ path: '/' });
  142. $.cookie('userType', null,{ path: '/' });
  143. location.href = "/index.html"
  144. }
  145. function valUser() {
  146. var userid = $.cookie('userid');
  147. var userAuth = $.cookie('userAuth');
  148. if(userid == undefined || userid.length == 0 || userid == "null" || userAuth == false) {
  149. location.href = "login.html";
  150. }
  151. }
  152. function pageUrl(type,datalist) {
  153. return ("shtml/"+type+"/"+datalist.createTime.substring(0,8)+"/"+datalist.shareId+".html");
  154. }
  155. function GetQueryString(name) {
  156. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  157. var r = window.location.search.substr(1).match(reg);
  158. var context = "";
  159. if(r != null)
  160. context = r[2];
  161. reg = null;
  162. r = null;
  163. return context == null || context == "" || context == "undefined" ? "" : decodeURI(context);
  164. }
  165. function loginStatus() {
  166. userid = $.cookie('userid');
  167. userAuth = $.cookie('userAuth');
  168. authentication = $.cookie('authentication');
  169. if(userid && userid != "null" && userid != null) {
  170. if(userAuth == "false" && authentication == "null") {
  171. location.href = "loginInviteFirst.html";
  172. }
  173. if(userAuth == "true" && authentication == "null") {
  174. location.href = "fillinfo-select.html";
  175. }
  176. if(userAuth == "true" && authentication != "null") {
  177. $(".onlogin").show();
  178. $(".unlogin").hide();
  179. $(".portrait-p").attr("src", "/images/head/" + userid + "_m.jpg");
  180. $(".portrait-p").load(function() { //判断图片是否加载,加载不成功默认有默认的图像
  181. })
  182. .error(function() {
  183. $(".portrait-p").attr("src", "/images/default-photo.jpg");
  184. });
  185. unReadedCount(userid);
  186. unInformCount(userid)
  187. }
  188. $(".portrait-p").on("click",function(){
  189. location.href="userInforShow.html?professorId="+userid;
  190. })
  191. $(".onlogin").on("click",".goMyInf",function(){
  192. $(this).attr("href","userInforShow.html?professorId="+userid)
  193. })
  194. } else {
  195. $(".unlogin").show();
  196. $(".onlogin").hide();
  197. }
  198. }
  199. function loginYesOrNo() {
  200. userid = $.cookie('userid');
  201. userAuth = $.cookie('userAuth');
  202. authentication = $.cookie('authentication');
  203. if(userid && userid != "null" && userid != null) {
  204. if(userAuth == "false" && authentication == "null") {
  205. location.href = "/loginInviteFirst.html";
  206. }
  207. if(userAuth == "true" && authentication == "null") {
  208. location.href = "/fillinfo-select.html";
  209. }
  210. if(userAuth == "true" && authentication != "null") {
  211. $(".onlogin").show();
  212. $(".unlogin").hide();
  213. $(".portrait-p").attr("src", "/images/head/" + userid + "_m.jpg");
  214. $(".portrait-p").load(function() { //判断图片是否加载,加载不成功默认有默认的图像
  215. })
  216. .error(function() {
  217. $(".portrait-p").attr("src", "/images/default-photo.jpg");
  218. });
  219. unReadedCount(userid);
  220. }
  221. $(".portrait-p").on("click",function(){
  222. location.href="/userInforShow.html?professorId="+userid;
  223. })
  224. $(".onlogin").on("click",".goMyInf",function(){
  225. $(this).attr("href","/userInforShow.html?professorId="+userid)
  226. })
  227. } else {
  228. $(".unlogin").show();
  229. $(".onlogin").hide();
  230. }
  231. }
  232. function unReadedCount(id){//查询指定用户的未读消息数量
  233. $.ajax({
  234. type:"get",
  235. url:"/ajax/webMsg/unReadedCount",
  236. async:true,
  237. data:{"id":id},
  238. success:function(data){
  239. console.log(data)
  240. if(data.success){
  241. if(data.data!=0){
  242. $(".mymessage").find(".badge").text(data.data);
  243. }else{
  244. $(".mymessage").find(".badge").text("");
  245. }
  246. }
  247. }
  248. });
  249. }
  250. function unInformCount(id){//查询指定用户的未读通知数量
  251. $.ajax({
  252. type:"get",
  253. url:"/ajax/notify/idx",
  254. async:true,
  255. data:{"id":id},
  256. success:function(data){
  257. console.log(data)
  258. if(data.success){
  259. if(data.data.unRead!=0){
  260. $(".myinform").find(".badge").text(data.data.unRead);
  261. }else{
  262. $(".myinform").find(".badge").text("");
  263. }
  264. }
  265. }
  266. });
  267. }
  268. //转换格式
  269. function changeTime(dealtime) {
  270. var s = dealtime;
  271. //console.log(s);
  272. if(dealtime.length == 8) {
  273. var y = s.substr(0, 4);
  274. var m = s.substr(4, 2);
  275. var d = s.substr(6, 2);
  276. var formatTime = y + "-" + m + "-" + d;
  277. return formatTime;
  278. } else {
  279. var y = s.substr(0, 4);
  280. var m = s.substr(4, 2);
  281. var d = s.substr(6, 2);
  282. var h = s.substr(8, 2);
  283. var minute = s.substr(10, 2);
  284. var formatTime = y + "-" + m + "-" + d + " " + h + ":" + minute;
  285. return formatTime;
  286. }
  287. }
  288. //******过滤特殊字符*******//
  289. function replaceStr(s) {
  290. var pattern = new RegExp("-");
  291. var rs = "";
  292. for(var i = 0; i < s.length; i++) {
  293. rs = rs + s.substr(i, 1).replace(pattern, '');
  294. }
  295. return rs;
  296. }
  297. //**********************//
  298. //根据用户输入的Email跳转到相应的电子邮箱首页
  299. var hash = {
  300. 'qq.com': 'http://mail.qq.com',
  301. 'gmail.com': 'http://mail.google.com',
  302. 'sina.com': 'http://mail.sina.com.cn',
  303. '163.com': 'http://mail.163.com',
  304. '126.com': 'http://mail.126.com',
  305. 'yeah.net': 'http://www.yeah.net/',
  306. 'sohu.com': 'http://mail.sohu.com/',
  307. 'tom.com': 'http://mail.tom.com/',
  308. 'sogou.com': 'http://mail.sogou.com/',
  309. '139.com': 'http://mail.10086.cn/',
  310. 'hotmail.com': 'http://www.hotmail.com',
  311. 'live.com': 'http://login.live.com/',
  312. 'live.cn': 'http://login.live.cn/',
  313. 'live.com.cn': 'http://login.live.com.cn',
  314. '189.com': 'http://webmail16.189.cn/webmail/',
  315. 'yahoo.com.cn': 'http://mail.cn.yahoo.com/',
  316. 'yahoo.cn': 'http://mail.cn.yahoo.com/',
  317. 'eyou.com': 'http://www.eyou.com/',
  318. '21cn.com': 'http://mail.21cn.com/',
  319. '188.com': 'http://www.188.com/',
  320. 'ustb.edu.cn': 'http://mail.ustb.edu.cn/',
  321. 'foxmail.coom': 'http://www.foxmail.com'
  322. };
  323. //轮播滚动函数
  324. function Carousel(inde, num, show, childcount, obj, next, prev) {
  325. var tapnum = 0; //按钮可点击次数
  326. if(childcount > num) {
  327. next.css("display", "block");
  328. prev.css("display", "none");
  329. } else {
  330. next.css("display", "none");
  331. prev.css("display", "none");
  332. }
  333. next.click(function() {
  334. if(!obj.is(":animated")) {
  335. if(num < childcount) {
  336. tapnum++;
  337. prev.css("display", "block");
  338. if(tapnum == childcount - show) {
  339. next.css("display", "none");
  340. }
  341. num++;
  342. obj.animate({
  343. left: "-=212px"
  344. }, 600);
  345. }
  346. }
  347. });
  348. prev.click(function() {
  349. if(!obj.is(":animated")) {
  350. if(num > inde) {
  351. tapnum--;
  352. next.css("display", "block");
  353. if(tapnum == 0) {
  354. prev.css("display", "none");
  355. }
  356. num--;
  357. obj.animate({
  358. left: "+=212px"
  359. }, 600);
  360. }
  361. }
  362. });
  363. }
  364. //评价字数限制
  365. //字数限制函数
  366. function limitTextCountFn(TextAreaId, countContainerId, count) {
  367. var curLength = $(TextAreaId).val().length;
  368. if(curLength > count) {
  369. var num = $(TextAreaId).val().substr(0, count);
  370. $(TextAreaId).val(num);
  371. } else {
  372. $(countContainerId).text(count - $(TextAreaId).val().length);
  373. }
  374. };
  375. //咨询申请主题字数限制函数
  376. function titleLimitFontCountFn() {
  377. var curLength = $("#consultTitle").val().length;
  378. if(curLength > 20) {
  379. var num = $("#consultTitle").val().substr(0, 20);
  380. $("#consultTitle").val(num);
  381. }
  382. };
  383. /*下拉select选择js */
  384. function seleCo(obj){
  385. var sleTd=$(obj).val();
  386. if(sleTd==0){
  387. $(obj).css("color","#999");
  388. }else{
  389. $(obj).css("color","#666");
  390. }
  391. }
  392. //咨询 专家信息接口函数
  393. function concultProInfo(professorId) {
  394. $.ajax({
  395. url: "/ajax/professor/editBaseInfo/" + professorId,
  396. type: "get",
  397. data: {
  398. "id": professorId
  399. },
  400. contentType: "application/x-www-form-urlencoded",
  401. success: function(response) {
  402. //console.log(response);
  403. var myData = response["data"];
  404. $("#professorName").html(myData["name"]);
  405. if(myData["title"]) {
  406. $("#professorTitle").html(myData["title"] + ' ');
  407. }
  408. if(myData["department"]) {
  409. $("#profDepartment").html(myData["department"] + ' ');
  410. }
  411. if(myData["orgName"]) {
  412. $("#profOrganization").html(myData["orgName"] + ' ');
  413. }
  414. if(myData["address"]) {
  415. $("#profAdress").html(myData["address"]);
  416. }
  417. console.log(myData["consultCount"])
  418. if(!myData["consultCount"]) {
  419. $("#starLevel").hide();
  420. }
  421. $("#byConsultConut").html(myData["consultCount"]);
  422. $("#sendConsultBtn").attr("proId", myData["id"]);
  423. //星级
  424. var startConut = parseInt(myData["starLevel"]);
  425. if(myData["consultCount"]) {
  426. if(!startConut) {
  427. $(".evastarbox2").hide();
  428. }
  429. }
  430. for(var i = 0; i < startConut; i++) {
  431. $("#starLevel .evastar2").eq(i).addClass("addStar");
  432. }
  433. //认证
  434. var oSty = autho(myData.authType, myData.orgAuth, myData.authStatus);
  435. $("#proModifyN").addClass(oSty.sty);
  436. $("#proModifyN").attr("title", oSty.title);
  437. //头像
  438. if(myData["hasHeadImage"] == 0) {
  439. $("#prohead").attr("src", "images/default-photo.jpg");
  440. } else {
  441. $("#prohead").attr("src", "images/head/" + myData["id"] + "_l.jpg");
  442. }
  443. },
  444. error: function(error) {
  445. $.MsgBox.Alert("message", "请求数据失败");
  446. }
  447. });
  448. };
  449. //发送咨询
  450. function sendConsultHandler(professorId) {
  451. var professorId = professorId;
  452. var consult_type = $(".clicknow").text(); //咨询类型
  453. var consult_title = $("#consultTitle").val(); //咨询主题
  454. var consult_content = $("#consultcontent").val(); //咨询内容
  455. var consultStr = {
  456. "consultType": consult_type,
  457. "consultTitle": consult_title,
  458. "consultContant": consult_content,
  459. "professorId": professorId,
  460. "consultantId": userid
  461. };
  462. if(consult_type == '' || consult_title == '' || consult_content == '') {
  463. $.MsgBox.Alert("消息提醒", "请填写完整");
  464. };
  465. if(consult_type == '') {
  466. $.MsgBox.Alert("消息提醒", "请选择联系目的");
  467. }
  468. if(consult_title == '') {
  469. $.MsgBox.Alert("消息提醒", "请填写咨询目的");
  470. }
  471. if(consult_content == '') {
  472. $.MsgBox.Alert("消息提醒", "请填写咨询内容");
  473. }
  474. if(userid && userid != null && userid != "null" && consult_type != '' &&
  475. consult_title != '' && consult_content != ''
  476. ) {
  477. $.ajax({
  478. "url": "/ajax/consult",
  479. "type": "post",
  480. //传值:咨询类型、主题、内容、专家id、申请人id
  481. "data": consultStr,
  482. "contentType": "application/x-www-form-urlencoded",
  483. "dataType": "json",
  484. "success": function(response) {
  485. console.log(response);
  486. },
  487. "error": function() {
  488. $.MsgBox.Alert("消息提醒", "咨询申请失败");
  489. },
  490. "complete": function() {
  491. //$(".consultapply").remove();
  492. $(".blackcover").remove();
  493. $("body").css("position", "");
  494. $.MsgBox.Alert("消息提醒", "咨询申请成功");
  495. $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
  496. },
  497. });
  498. }
  499. };
  500. /*标志*/
  501. function autho() {
  502. if(arguments[0] == 1) {
  503. return {
  504. "sty": "authicon-pro",
  505. "title": "科袖认证专家"
  506. }
  507. } else {
  508. if(arguments[1] == 1) {
  509. return {
  510. "sty": "authicon-staff-ok",
  511. "title": "企业认证员工"
  512. }
  513. } else {
  514. if(arguments[2] == 3) {
  515. return {
  516. "sty": "authicon-real",
  517. "title": "实名认证用户"
  518. }
  519. } else {
  520. return {
  521. "sty": "e",
  522. "title": " "
  523. }
  524. }
  525. }
  526. }
  527. }
  528. //时间显示规则
  529. function commenTime(startTime) {
  530. var nowTimg = new Date();
  531. var startdate = new Date();
  532. startdate.setFullYear(parseInt(startTime.substring(0, 4)));
  533. startdate.setMonth(parseInt(startTime.substring(4, 6)) - 1);
  534. startdate.setDate(parseInt(startTime.substring(6, 8)));
  535. startdate.setHours(parseInt(startTime.substring(8, 10)));
  536. startdate.setMinutes(parseInt(startTime.substring(10, 12)));
  537. startdate.setSeconds(parseInt(startTime.substring(12, 14)));
  538. var date3 = nowTimg.getTime() - startdate.getTime(); //时间差的毫秒数
  539. var hours = parseInt((date3 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  540. var minutes = parseInt((date3 % (1000 * 60 * 60)) / (1000 * 60));
  541. if(date3 < 60000) {
  542. return "刚刚";
  543. } else if(date3 >= 60000 && date3 < 3600000) {
  544. return minutes + "分钟前";
  545. } else if(date3 >= 3600000 && date3 < 86400000) {
  546. return hours + "小时前";
  547. } else if(date3 >= 86400000) {
  548. if(nowTimg.getFullYear() == startTime.substring(0, 4)) {
  549. return startTime.substring(4, 6).replace(/\b(0+)/gi, "") + "月" + startTime.substring(6, 8).replace(/\b(0+)/gi, "") + "日 " + startTime.substring(8, 10) + ":" + startTime.substring(10, 12);
  550. } else {
  551. return startTime.substring(0, 4) + "年" + startTime.substring(4, 6).replace(/\b(0+)/gi, "") + "月" + startTime.substring(6, 8).replace(/\b(0+)/gi, "") + "日 " + startTime.substring(8, 10) + ":" + startTime.substring(10, 12);
  552. }
  553. }
  554. }
  555. /*时间转换*/
  556. function TimeTr(dealtime) {
  557. var myDate = new Date();
  558. var s = dealtime;
  559. var y = s.substr(0, 4);
  560. var m = s.substr(4, 2);
  561. var d = s.substr(6, 2);
  562. var h = s.substr(8, 2);
  563. var minute = s.substr(10, 2);
  564. var formatTime;
  565. if(s.length <= 6) {
  566. formatTime = y + "年" + m.replace(/\b(0+)/gi, "") + "月";
  567. } else if(s.length > 6 && s.length <= 8) {
  568. formatTime = m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 ";
  569. if(y != myDate.getFullYear()) {
  570. formatTime = y + "年" + m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 ";
  571. }
  572. } else {
  573. formatTime = m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 " + h + ":" + minute;
  574. if(y != myDate.getFullYear()) {
  575. formatTime = y + "年" + m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 " + h + ":" + minute;
  576. }
  577. }
  578. return formatTime;
  579. }
  580. /*判断是否收藏资源文章或者是否关注专家*/
  581. function ifcollectionAbout(watchObject, sel,num) {
  582. var that=sel;
  583. $.ajax('/ajax/watch/hasWatch', {
  584. data: {
  585. "professorId": userid,
  586. "watchObject": watchObject
  587. },
  588. dataType: 'json', //数据格式类型
  589. type: 'get', //http请求类型
  590. timeout: 10000,
  591. async: false,
  592. success: function(data) {
  593. if(data.success && data.data != null) {
  594. if(num == "1" || num == "6") { //已关注专家
  595. $(that).addClass("attenedSpan");
  596. $(that).text("已关注");
  597. } else { //已收藏资源或文章
  598. $(that).removeClass("icon-collect");
  599. $(that).addClass("icon-collected");
  600. }
  601. } else {
  602. if(num == "1" || num == "6") { //关注专家
  603. $(that).removeClass("attenedSpan");
  604. $(that).text("关注");
  605. } else { //收藏资源或文章
  606. $(that).addClass("icon-collect");
  607. $(that).removeClass("icon-collected");//
  608. }
  609. }
  610. },
  611. error: function(data) {
  612. $.MsgBox.Alert('提示', "服务器链接超时");
  613. }
  614. });
  615. }
  616. /*收藏资源、文章或者关注专家*/
  617. function collectionAbout(watchObject,sel, num) {
  618. var that=sel;
  619. $.ajax('/ajax/watch', {
  620. data: {
  621. "professorId": userid,
  622. "watchObject": watchObject,
  623. "watchType": num,
  624. "uname":$.cookie("userName")
  625. },
  626. dataType: 'json', //数据格式类型
  627. type: 'POST', //http请求类型
  628. timeout: 10000,
  629. async: false,
  630. success: function(data) {
  631. if(data.success) {
  632. console.log(data)
  633. if(num == "1" || num == "6") {
  634. $(that).addClass("attenedSpan");
  635. $(that).text("已关注");
  636. } else {
  637. $(that).removeClass("icon-collect");
  638. $(that).addClass("icon-collected");
  639. }
  640. }
  641. },
  642. error: function(data) {
  643. $.MsgBox.Alert('提示', "服务器链接超时");
  644. }
  645. });
  646. }
  647. /*取消收藏资源、文章或者取消关注专家*/
  648. function cancelCollectionAbout(watchObject,sel,num) {
  649. var that=sel;
  650. $.ajax({
  651. url: '/ajax/watch/delete',
  652. data: {
  653. professorId: userid,
  654. watchObject: watchObject
  655. },
  656. dataType: 'json', //数据格式类型
  657. type: 'post', //http请求类型
  658. timeout: 10000,
  659. async: true,
  660. success: function(data) {
  661. console.log(data.success)
  662. if(num == "1" || num == "6") { //关注专家
  663. $(that).removeClass("attenedSpan");
  664. $(that).text("关注");
  665. } else { //收藏资源或文章
  666. $(that).addClass("icon-collect");
  667. $(that).removeClass("icon-collected");
  668. }
  669. },
  670. error: function(data) {
  671. $.MsgBox.Alert('提示', "服务器链接超时");
  672. }
  673. });
  674. }
  675. function leaveMsgCount(id,type, $str) {//查看留言数
  676. $.ajax({
  677. "url":"/ajax/leavemsg/count",
  678. "type": "GET",
  679. "dataType": "json",
  680. "data": {
  681. sid:id,
  682. stype: type
  683. },
  684. "success": function(data) {
  685. if(data.success) {
  686. if(data.data > 0) {
  687. $str.find(".leaveMsgCount").html("留言 " + data.data);
  688. $str.find(".leaveMsgCount2").html(data.data);
  689. }
  690. }
  691. }
  692. });
  693. }
  694. //企业规模
  695. var orgSizeShow = {
  696. '1': '50人以内',
  697. '2': '50-100人',
  698. '3': '100-200人',
  699. '4': '200-500人',
  700. '5': '500-1000人',
  701. '6': '1000人以上'
  702. }
  703. //企业类型
  704. var orgTypeShow = {
  705. "2": "上市企业",
  706. "3": "外资企业",
  707. "4": "合资企业",
  708. "5": "独资企业",
  709. "6": "个体经营",
  710. "7": "政府机构",
  711. "8": "公益组织",
  712. "9": "协会学会",
  713. "10": "新闻媒体",
  714. "11": "教育机构",
  715. "undefined":""
  716. }
  717. //学位
  718. var eduDegree = {
  719. "1": "博士",
  720. "2": "硕士",
  721. "3": "学士",
  722. "4": "大专",
  723. "5": "其他"
  724. }
  725. //栏目
  726. var columnType = {
  727. "1":{
  728. fullName:"个人原创",
  729. shortName:"原创"
  730. },
  731. "2":{
  732. fullName:"企业原创",
  733. shortName:"原创"
  734. },
  735. "3":{
  736. fullName:"科研",
  737. shortName:"科研"
  738. },
  739. "4":{
  740. fullName:"智库",
  741. shortName:"智库"
  742. },
  743. "5":{
  744. fullName:"检测",
  745. shortName:"检测"
  746. },
  747. "6":{
  748. fullName:"会议",
  749. shortName:"会议"
  750. },
  751. "7":{
  752. fullName:"企业",
  753. shortName:"企业"
  754. },
  755. "8":{
  756. fullName:"招聘",
  757. shortName:"招聘"
  758. },
  759. "9":{
  760. fullName:"新闻",
  761. shortName:"新闻"
  762. },
  763. "10":{
  764. fullName:"问答",
  765. shortName:"问答"
  766. }
  767. }
  768. //需求的费用预算
  769. var demandCost = {
  770. '1': '1万元以内',
  771. '2': '1-5万元',
  772. '3': '5-10万元',
  773. '4': '10-20万元',
  774. '5': '20-50万元',
  775. '6': '50万元以上'
  776. }
  777. //需求的预期时长
  778. var demandDuration = {
  779. '1': '1个月内',
  780. '2': '1-3个月',
  781. '3': '3-6个月',
  782. '4': '6-12个月',
  783. '5': '1年以上'
  784. }
  785. //反馈意见成功
  786. function backSuccessed(){
  787. $(".correctCon").val("");
  788. $(".correctSubmit").attr("disabled",true);
  789. $(".correctSubmit").parents(".correctBlock").fadeOut();
  790. $.MsgBox.Alert('提示', '感谢您的反馈,我们马上处理。');
  791. $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
  792. }
  793. function suImg() {
  794. $("#mb_msgicon").css("background", 'url("/images/sign_icon_chenggong_nor.png") 0% 0% / contain');
  795. $("#mb_ico").css("background",'url(/images/sign_icon_guanbi_nor.png) center center no-repeat');
  796. }
  797. function hotKey(sel, num) {
  798. $(sel).bind({
  799. paste: function(e) {
  800. var pastedText;
  801. if (window.clipboardData  &&  window.clipboardData.getData)  {  // IE
  802. pastedText  = $(this).val() +  window.clipboardData.getData('Text');          
  803. else  {            
  804. pastedText  = $(this).val() +  e.originalEvent.clipboardData.getData('Text'); //e.clipboardData.getData('text/plain');
  805. }
  806. $(this).val(pastedText);
  807. var $this = $(this);
  808. setTimeout(function() {
  809. if($this.val().trim()) {
  810. $this.siblings("button").show();
  811. } else {
  812. $this.siblings("button").hide();
  813. }
  814. }, 1);
  815. e.preventDefault();
  816. },
  817. cut: function(e) {
  818. var $this = $(this);
  819. setTimeout(function() {
  820. if($this.val().trim()) {
  821. $this.siblings("button").show();
  822. } else {
  823. $this.siblings("button").hide();
  824. }
  825. }, 1);
  826. },
  827. blur: function() {
  828. var $this = $(this);
  829. setTimeout(function() {
  830. $this.siblings(".keydrop").hide();
  831. }, 500)
  832. },
  833. focus: function() {
  834. $(this).siblings(".keydrop").show();
  835. },
  836. keyup: function(e) {
  837. var ti=$(this).val();
  838. var $t=this;
  839. $t.comr=ti;
  840. var $this=$(this);
  841. if($(this).val().trim()) {
  842. $(this).siblings("button").show();
  843. var lNum = $.trim($(this).val()).length;
  844. if(0 < lNum) {
  845. setTimeout(function(){
  846. if( ti===$t.comr && ti!== $t.comrEnd) {
  847. var tt=ti;
  848. $t.comrEnd=tt;
  849. $("#addKeyword").show();
  850. $.ajax({
  851. "url": "/ajax/dataDict/qaHotKey",
  852. "type": "GET",
  853. "success": function(data) {
  854. console.log(data);
  855. if(data.success) {
  856. if($t.comrEnd==tt) {
  857. if(data.data.length == 0) {
  858. $this.siblings(".keydrop").addClass("displayNone");
  859. $this.siblings(".keydrop").find("ul").html("");
  860. } else {
  861. $this.siblings(".keydrop").removeClass("displayNone");
  862. var oSr = "";
  863. for(var i = 0; i < Math.min(data.data.length,5); i++) {
  864. oSr += '<li>' + data.data[i].caption + '<div class="closeThis"></div></li>';
  865. }
  866. $this.siblings(".keydrop").find("ul").html(oSr);
  867. }
  868. }
  869. } else {
  870. $this.siblings(".keydrop").addClass("displayNone");
  871. $this.siblings(".keydrop").find("ul").html("");
  872. }
  873. },
  874. "data": {
  875. "key": $this.val()
  876. },
  877. dataType: "json",
  878. 'error': function() {
  879. $.MsgBox.Alert('提示', '服务器连接超时!');
  880. }
  881. });
  882. }
  883. },500);
  884. }
  885. } else {
  886. $(this).siblings("button").hide();
  887. $(this).siblings(".keydrop").addClass("displayNone");
  888. $(this).siblings(".keydrop").find("ul").html("");
  889. }
  890. }
  891. })
  892. $(".keydrop").on("click", "li", function() {
  893. var oValue = $(this).text();
  894. var oJudge = $(this).parents(".col-w-12").siblings().find("ul.ulspace li");
  895. var addNum = $(this).parents(".keydrop").siblings("input").attr("data-num");
  896. for(var i = 0; i < oJudge.length; i++) {
  897. if(oValue == oJudge[i].innerText) {
  898. $.MsgBox.Alert('提示', '添加内容不能重复');
  899. return;
  900. }
  901. }
  902. $(this).parents(".col-w-12").siblings().find("ul.ulspace").append('<li>' + oValue + '<div class="closeThis"></div></li>');
  903. $(this).parents(".keydrop").siblings("input").val("");
  904. $(this).parents(".keydrop").siblings("button").hide();
  905. if(oJudge.length == addNum - 1) {
  906. $(this).parents(".keydrop").siblings("input").val("");
  907. $(this).parents(".col-w-12").hide();
  908. }
  909. $(this).parent("ul").html("")
  910. })
  911. if(num == 1) {
  912. return;
  913. } else {
  914. /*添加*/
  915. $(".addButton").siblings("input").keypress(function(){
  916. var e = event || window.event;
  917. if(e.keyCode == 13) {
  918. var oValue = $(this).val().trim();
  919. var oJudge = $(this).parent().siblings().find("ul.ulspace li");
  920. var addContent = $(this).attr("data-pro");
  921. var addNum = $(this).attr("data-num");
  922. var addfontSizeNum = $(this).attr("data-fontSizeN");
  923. if(!oValue) {
  924. $.MsgBox.Alert('提示', '请先填写内容');
  925. return;
  926. }
  927. if(oValue.length > addfontSizeNum) {
  928. $.MsgBox.Alert('提示', addContent);
  929. return;
  930. }
  931. for(var i = 0; i < oJudge.length; i++) {
  932. if(oValue == oJudge[i].innerText) {
  933. $.MsgBox.Alert('提示', '添加内容不能重复');
  934. return;
  935. }
  936. }
  937. $(this).parent().siblings().find("ul.ulspace").append('<li>' + oValue + '<div class="closeThis"></div></li>');
  938. $(this).siblings(".addButton").hide();
  939. $(this).val("");
  940. if(oJudge.length == addNum - 1) {
  941. $(this).val("").parents(".col-w-12").hide();
  942. }
  943. $(this).siblings(".keydrop").find("ul").html("");
  944. }
  945. })
  946. $(".addButton").click(function() {
  947. var oValue = $(this).siblings("input").val().trim();
  948. var oJudge = $(this).parent().siblings().find("ul.ulspace li");
  949. var addContent = $(this).siblings("input").attr("data-pro");
  950. var addNum = $(this).siblings("input").attr("data-num");
  951. var addfontSizeNum = $(this).siblings("input").attr("data-fontSizeN");
  952. if(!oValue) {
  953. $.MsgBox.Alert('提示', '请先填写内容');
  954. return;
  955. }
  956. if(oValue.length > addfontSizeNum) {
  957. $.MsgBox.Alert('提示', addContent);
  958. return;
  959. }
  960. for(var i = 0; i < oJudge.length; i++) {
  961. if(oValue == oJudge[i].innerText) {
  962. $.MsgBox.Alert('提示', '添加内容不能重复');
  963. return;
  964. }
  965. }
  966. $(this).parent().siblings().find("ul.ulspace").append('<li>' + oValue + '<div class="closeThis"></div></li>');
  967. $(this).hide();
  968. $(this).siblings("input").val("");
  969. if(oJudge.length == addNum - 1) {
  970. $(this).val("").parents(".col-w-12").hide();
  971. }
  972. $(this).siblings(".keydrop").find("ul").html("");
  973. })
  974. }
  975. }
  976. //带有限制字数的多行文本框
  977. function limitObj(obj,maxNum){
  978. $(obj).bind({
  979. paste: function(e) {
  980. if($(this).val().length==""){
  981. $(this).parent().siblings(".btnModel").attr("disabled", true);
  982. }else{
  983. $(this).parent().siblings(".btnModel").attr("disabled", false);
  984. }
  985. var pastedText;
  986. if (window.clipboardData  &&  window.clipboardData.getData)  {  // IE
  987. pastedText  = $(this).val() +  window.clipboardData.getData('Text');          
  988. else  {            
  989. pastedText  = $(this).val() +  e.originalEvent.clipboardData.getData('Text'); //e.clipboardData.getData('text/plain');
  990. }
  991. $(this).val(pastedText);
  992. setTimeout(function() {
  993. $(this).siblings().find("em").text($(obj).val().length);
  994. }, 1);
  995. e.preventDefault();
  996. },
  997. cut: function(e) {
  998. if($(this).val().length==""){
  999. $(this).parent().siblings(".btnModel").attr("disabled", true);
  1000. }else{
  1001. $(this).parent().siblings(".btnModel").attr("disabled", false);
  1002. }
  1003. setTimeout(function() {
  1004. $(obj).siblings().find("em").text($(obj).val().length);
  1005. }, 1);
  1006. },
  1007. keyup: function(e) {
  1008. if($(this).val().length==""){
  1009. $(this).parent().siblings(".btnModel").attr("disabled", true);
  1010. }else{
  1011. $(this).parent().siblings(".btnModel").attr("disabled", false);
  1012. }
  1013. if($(this).val().length > maxNum) {
  1014. $(obj).val($(obj).val().substring(0, maxNum));
  1015. e.preventDefault();
  1016. }
  1017. setTimeout(function() {
  1018. $(obj).siblings().find("em").text($(obj).val().length);
  1019. }, 1);
  1020. }
  1021. });
  1022. }
  1023. var r64 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "-", "_"];
  1024. var d64 = {
  1025. "0": 0,
  1026. "1": 1,
  1027. "2": 2,
  1028. "3": 3,
  1029. "4": 4,
  1030. "5": 5,
  1031. "6": 6,
  1032. "7": 7,
  1033. "8": 8,
  1034. "9": 9,
  1035. "A": 10,
  1036. "B": 11,
  1037. "C": 12,
  1038. "D": 13,
  1039. "E": 14,
  1040. "F": 15,
  1041. "G": 16,
  1042. "H": 17,
  1043. "I": 18,
  1044. "J": 19,
  1045. "K": 20,
  1046. "L": 21,
  1047. "M": 22,
  1048. "N": 23,
  1049. "O": 24,
  1050. "P": 25,
  1051. "Q": 26,
  1052. "R": 27,
  1053. "S": 28,
  1054. "T": 29,
  1055. "U": 30,
  1056. "V": 31,
  1057. "W": 32,
  1058. "X": 33,
  1059. "Y": 34,
  1060. "Z": 35,
  1061. "a": 36,
  1062. "b": 37,
  1063. "c": 38,
  1064. "d": 39,
  1065. "e": 40,
  1066. "f": 41,
  1067. "g": 42,
  1068. "h": 43,
  1069. "i": 44,
  1070. "j": 45,
  1071. "k": 46,
  1072. "l": 47,
  1073. "m": 48,
  1074. "n": 49,
  1075. "o": 50,
  1076. "p": 51,
  1077. "q": 52,
  1078. "r": 53,
  1079. "s": 54,
  1080. "t": 55,
  1081. "u": 56,
  1082. "v": 57,
  1083. "w": 58,
  1084. "x": 59,
  1085. "y": 60,
  1086. "z": 61,
  1087. "-": 62,
  1088. "_": 63
  1089. };
  1090. function s16to64(s) {
  1091. var out, idx, n1, n2, n3;
  1092. idx = s.length - 1;
  1093. out = "";
  1094. while(idx >= 0) {
  1095. n1 = d64[s.charAt(idx--)];
  1096. if(idx < 0) {
  1097. out = r64[n1] + out;
  1098. break;
  1099. }
  1100. n2 = d64[s.charAt(idx--)];
  1101. if(idx < 0) {
  1102. out = r64[(n2 >>> 2)] + r64[((n2 & 0x3) << 4) + n1] + out;
  1103. break;
  1104. }
  1105. n3 = d64[s.charAt(idx--)];
  1106. out = r64[(n2 >>> 2) + (n3 << 2)] + r64[((n2 & 0x3) << 4) + n1] + out;
  1107. }
  1108. return out;
  1109. }
  1110. function s64to16(s) {
  1111. var out, idx, n1, n2;
  1112. idx = s.length - 1;
  1113. out = "";
  1114. while(idx >= 0) {
  1115. n1 = d64[s.charAt(idx--)];
  1116. if(idx < 0) {
  1117. out = r64[n1 >>> 4] + r64[n1 & 0xF] + out;
  1118. break;
  1119. }
  1120. n2 = d64[s.charAt(idx--)];
  1121. out = r64[(n2 >>> 2)] + r64[(n1 >>> 4) + ((n2 & 0x3) << 2)] + r64[n1 & 0xF] + out;
  1122. }
  1123. if(out.length>32) {
  1124. return out.substring(1);
  1125. }
  1126. return out;
  1127. }
  1128. //发现上方轮播
  1129. var bannerRotate = {// banner rotating
  1130. _time: 3000,
  1131. _i: 0,
  1132. _interval: null,
  1133. _navId: "#slide-tab",
  1134. _navBox: "#slide-list",
  1135. bannerShow: function() {
  1136. $(this._navId).find("li").removeClass("slide-tab-item-active");
  1137. $(this._navId).find("li:eq("+this._i+")").addClass("slide-tab-item-active");
  1138. $(this._navBox).find("li").removeClass("slide-item-active");
  1139. $(this._navBox).find("li:eq("+this._i+")").addClass("slide-item-active");
  1140. },
  1141. bannerStart:function() {
  1142. var _this = this;
  1143. _this._interval = setInterval(function() {
  1144. if(_this._i >= 4) {
  1145. _this._i = 0;
  1146. }
  1147. else {
  1148. _this._i++;
  1149. }
  1150. _this.bannerShow();
  1151. }, _this._time);
  1152. },
  1153. bannerInit: function() {
  1154. var _this = this;
  1155. _this.bannerStart();
  1156. $(_this._navId).find("li").bind("mouseover", function() {
  1157. clearInterval(_this._interval);
  1158. _this._i = $(this).index();
  1159. _this.bannerShow();
  1160. _this.bannerStart();
  1161. });
  1162. }
  1163. };
  1164. var currentdate;
  1165. function getNowFormatDate(num) {
  1166. var date = new Date();
  1167. var seperator1 = "-";
  1168. var seperator2 = ":";
  1169. var month = date.getMonth() + 1;
  1170. var strDate = date.getDate();
  1171. var getHours = date.getHours();
  1172. var getMinutes = date.getMinutes();
  1173. if (month >= 1 && month <= 9) {
  1174. month = "0" + month;
  1175. }
  1176. if (strDate >= 0 && strDate <= 9) {
  1177. strDate = "0" + strDate;
  1178. }
  1179. if (getMinutes >= 0 && getMinutes <= 9) {
  1180. getMinutes = "0" + getMinutes;
  1181. }
  1182. if (getHours >= 0 && getHours <= 9) {
  1183. getHours = "0" + getHours;
  1184. }
  1185. var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
  1186. + " " + getHours + seperator2 + getMinutes
  1187. if(num==1){
  1188. currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
  1189. }
  1190. return currentdate;
  1191. }
  1192. function wlog(dt, id, src) {
  1193. var src = src || "1";
  1194. var $img=$("<img src='"+wlogurl+"/log/img?__lt="+dt+"&src="+src+"&id="+id+"&_t="+(new Date().getTime())+"' style='display:none;' ></img>");
  1195. $img.appendTo($("body"));
  1196. setTimeout(function(){
  1197. $img.remove();
  1198. },5000);
  1199. // $.ajax({
  1200. // url: "http://www.ekexiu.com:8082/log/jsonp/log",
  1201. // data: {
  1202. // "id": id,
  1203. // "src": src,
  1204. // "__lt": dt,
  1205. // },
  1206. // success:function(data) {
  1207. // },
  1208. // dataType: "jsonp"
  1209. // });
  1210. }
  1211. //广告相关操作
  1212. function addscript(that){
  1213. var script=document.createElement("script");
  1214. script.setAttribute("type", "text/javascript");
  1215. var srclink= "https://www.ekexiu.com/data/inc/ad/"+ that +".js?r=" + new Date().getTime();
  1216. script.setAttribute("src", srclink);
  1217. var heads = document.getElementsByTagName("head");
  1218. if(heads.length){
  1219. heads[0].appendChild(script);
  1220. }else{
  1221. document.documentElement.appendChild(script);
  1222. }
  1223. }
  1224. $(document).ready(function(){
  1225. //处理点击事件,需要打开原生浏览器
  1226. $("body").on("click","a.advertsub",function(){
  1227. var adId = this.getAttribute('data-id');
  1228. console.log(adId)
  1229. wlog("ad", adId ,"1");
  1230. return true;
  1231. })
  1232. })
  1233. function adScroll(){
  1234. //不随滚动条滚动的固定层广告代码
  1235. function thisS() {
  1236. var scrollHeight = $(document).height();
  1237. var windowHeight = $(window).innerHeight();
  1238. var footerHeight = $("footer").outerHeight(true);
  1239. var containH = $("#container").outerHeight(true)-footerHeight
  1240. var objHeight= $("#scroll-fixed-ad").outerHeight();
  1241. var scroTop = document.body.scrollTop || document.documentElement.scrollTop;
  1242. (scroTop-objHeight+offTop) < containH ? (scroTop > offTop ?
  1243. (scroObj.attr('class',"div1 div2"), c && (scroObj.style.top = scroTop - offTop + "px")) :scroObj.attr('class',"div1")):
  1244. (scroObj.attr('class',"div1 div3"),scroObj.css("bottom",windowHeight + scroTop + footerHeight+ 10 - scrollHeight))
  1245. // console.log(containH+"***"+(scroTop+offTop-objHeight))
  1246. console.log(scroTop+"&&&&&"+offTop+"&&&"+objHeight)
  1247. }
  1248. var scroObj = $("#scroll-fixed-ad");
  1249. var offTop= scroObj.offset().top + 40;
  1250. if(scroObj == undefined) return !1;
  1251. var c;
  1252. c = window.ActiveXObject && !window.XMLHttpRequest;
  1253. if(!c || !0) window.onscroll =function(){
  1254. var d;
  1255. if(d) return;
  1256. d = setTimeout(function() {
  1257. thisS.call(this), d = undefined
  1258. }, 150)
  1259. }
  1260. }