Authored by whb

index css,js

@@ -832,6 +832,226 @@ function actionTopLogoAnimate() { @@ -832,6 +832,226 @@ function actionTopLogoAnimate() {
832 window.setTimeout(fadeAnimate, 3000); 832 window.setTimeout(fadeAnimate, 3000);
833 } 833 }
834 } 834 }
  835 +window.newArr = [];
  836 +window.wrapperindex = 0;
  837 +window.gindex = 0;
  838 +window.targetArr1 = [];
  839 +window.targetArr2 = [];
  840 +window.targetArr3 = [];
  841 +window.oh1 = 0;
  842 +window.oh2 = 0;
  843 +window.oh3 = 0;
  844 +window.valueIndex = 0;
  845 +window.nowIndex = 0;
  846 +window.inner1 = '';
  847 +window.inner2 = '';
  848 +window.inner3 = '';
  849 +window.finalresult = '';
  850 +
  851 +function createNewArray(obj) {
  852 + var $thirdnavpanel = $(obj);
  853 +
  854 + $thirdnavpanel.find('.thirdnavbar').each(function() {
  855 + var $that = $(this);
  856 + var $alink = $that.find('a');
  857 + var _href = $alink.attr('href');
  858 + var hottag = $alink.attr('hot') === 'true' ? true : false;
  859 + var objt = {};
  860 +
  861 + if ($that.hasClass('category-title')) {
  862 + objt = {
  863 + type: 'title',
  864 + height: 49,
  865 + content: $that.text(),
  866 + index: window.valueIndex,
  867 + href: _href,
  868 + hot: false
  869 + };
  870 + } else {
  871 + objt = {
  872 + type: 'catlist',
  873 + height: 36,
  874 + content: $alink.text(),
  875 + index: window.valueIndex,
  876 + href: _href,
  877 + hot: hottag
  878 + };
  879 + }
  880 + window.valueIndex++;
  881 + window.newArr.push(objt);
  882 + });
  883 +}
  884 +
  885 +function createWrapper() {
  886 + var arrlength = window.newArr.length;
  887 + var i = 0;
  888 + var objnew = [];
  889 + var aobj = [];
  890 + var bobj = [];
  891 + var cobj = [];
  892 + var final1 = '',
  893 + final2 = '',
  894 + final3 = '';
  895 + var a = 0;
  896 + var b = 0;
  897 + var c = 0;
  898 +
  899 + for (i; i < arrlength; i++) {
  900 + objnew = window.newArr[i];
  901 + if (window.gindex === 0) {
  902 + window.oh1 = (window.oh1 + objnew.height);
  903 + if (window.oh1 >= 340 && i !== (arrlength - 1)) {
  904 + window.targetArr1 = window.newArr.slice(0, objnew.index + 1);
  905 + window.nowIndex = objnew.index + 1;
  906 + window.gindex++;
  907 + }
  908 + if (i === (arrlength - 1)) {
  909 + window.targetArr1 = window.newArr.slice(0, arrlength + 1);
  910 + break;
  911 + }
  912 + }
  913 + if (window.gindex === 1) {
  914 + window.oh2 = (window.oh2 + objnew.height);
  915 + if (window.oh2 >= 340 && i !== (arrlength - 1)) {
  916 + window.targetArr2 = window.newArr.slice(window.nowIndex, objnew.index + 1);
  917 + window.nowIndex = objnew.index + 1;
  918 + window.gindex++;
  919 + }
  920 + if (i === (arrlength - 1)) {
  921 + window.targetArr2 = window.newArr.slice(window.nowIndex, arrlength + 1);
  922 + break;
  923 + }
  924 + }
  925 + if (window.gindex === 2) {
  926 + window.oh3 = (window.oh3 + objnew.height);
  927 + if (window.oh3 >= 340 && i !== (arrlength - 1)) {
  928 + window.targetArr3 = window.newArr.slice(window.nowIndex, objnew.index + 1);
  929 + window.nowIndex = objnew.index + 1;
  930 + window.gindex++;
  931 + break;
  932 + }
  933 + if (i === (arrlength - 1)) {
  934 + window.targetArr3 = window.newArr.slice(window.nowIndex, arrlength + 1);
  935 + break;
  936 + }
  937 + }
  938 + }
  939 + for (a; a < window.targetArr1.length; a++) {
  940 + aobj = window.targetArr1[a] || {};
  941 + if (aobj.type === 'title') {
  942 + window.inner1 = window.inner1 +
  943 + '<li class="cattitle"><h3><a href="' +
  944 + aobj.href +
  945 + '">' +
  946 + aobj.content +
  947 + '</a></h3></li>';
  948 + } else {
  949 + if (aobj.hot === true) {
  950 + window.inner1 = window.inner1 +
  951 + '<li class="catdetail"><a class="thirdcatelink hot" href="' +
  952 + aobj.href +
  953 + '">' +
  954 + aobj.content +
  955 + '</a></li>';
  956 + } else {
  957 + window.inner1 = window.inner1 +
  958 + '<li class="catdetail"><a class="thirdcatelink" href="' +
  959 + aobj.href + '">' +
  960 + aobj.content +
  961 + '</a></li>';
  962 + }
  963 +
  964 + }
  965 + }
  966 + for (b; b < window.targetArr2.length; b++) {
  967 + bobj = window.targetArr2[b] || {};
  968 + if (bobj.type === 'title') {
  969 + window.inner2 = (window.inner2 +
  970 + '<li class="cattitle"><h3><a href="' +
  971 + bobj.href + '">' +
  972 + bobj.content +
  973 + '</a></h3></li>');
  974 + } else {
  975 + if (bobj.hot === true) {
  976 + window.inner2 = (window.inner2 +
  977 + '<li class="catdetail"><a class="thirdcatelink hot" href="' +
  978 + bobj.href + '">' + bobj.content + '</a></li>');
  979 + } else {
  980 + window.inner2 = (window.inner2 +
  981 + '<li class="catdetail"><a class="thirdcatelink" href="' +
  982 + bobj.href + '">' + bobj.content + '</a></li>');
  983 + }
  984 +
  985 + }
  986 + }
  987 + for (c; c < window.targetArr3.length; c++) {
  988 + cobj = window.targetArr3[c] || {};
  989 + if (cobj.type === 'title') {
  990 + window.inner3 = (window.inner3 +
  991 + '<li class="cattitle"><h3><a href="' +
  992 + cobj.href +
  993 + '">' +
  994 + cobj.content +
  995 + '</a></h3></li>');
  996 + } else {
  997 + if (cobj.hot === true) {
  998 + window.inner3 = (window.inner3 +
  999 + '<li class="catdetail"><a class="thirdcatelink hot" href="' +
  1000 + cobj.href + '">' +
  1001 + cobj.content +
  1002 + '</a></li>');
  1003 + } else {
  1004 + window.inner3 = (window.inner3 +
  1005 + '<li class="catdetail"><a class="thirdcatelink" href="' +
  1006 + cobj.href + '">' +
  1007 + cobj.content +
  1008 + '</a></li>');
  1009 + }
  1010 +
  1011 + }
  1012 + }
  1013 + if (window.inner1 !== '') {
  1014 + final1 = '<ul class="cate_row1 cate_row">' +
  1015 + window.inner1 +
  1016 + '</ul>';
  1017 + }
  1018 + if (window.inner2 !== '') {
  1019 + final2 = '<ul class="cate_row2 cate_row">' +
  1020 + window.inner2 +
  1021 + '</ul>';
  1022 + }
  1023 + if (window.inner3 !== '') {
  1024 + final3 = '<ul class="cate_row3 cate_row">' +
  1025 + window.inner3 +
  1026 + '</ul>';
  1027 + }
  1028 + window.finalresult = final1 + final2 + final3;
  1029 + $('#' + window.wrapperindex).empty().append(window.finalresult);
  1030 +}
  1031 +
  1032 +function actionNav() {
  1033 + $('.categorywrapper').each(function(index) {
  1034 + window.wrapperindex = $(this).attr('id');
  1035 + window.newArr = [];
  1036 + window.gindex = 0;
  1037 + window.targetArr1 = [];
  1038 + window.targetArr2 = [];
  1039 + window.targetArr3 = [];
  1040 + window.oh1 = 0;
  1041 + window.oh2 = 0;
  1042 + window.oh3 = 0;
  1043 + window.valueIndex = 0;
  1044 + window.nowIndex = 0;
  1045 + window.inner1 = '';
  1046 + window.inner2 = '';
  1047 + window.inner3 = '';
  1048 + createNewArray($(this).find('.category'));
  1049 + createWrapper();
  1050 + });
  1051 +}
  1052 +
  1053 +
  1054 +
835 /** 1055 /**
836 * 查询跳转后保留关键字 1056 * 查询跳转后保留关键字
837 * @return {[type]} [description] 1057 * @return {[type]} [description]
@@ -1435,6 +1655,7 @@ function actionLoginInfo() { @@ -1435,6 +1655,7 @@ function actionLoginInfo() {
1435 * @return {[type]} [description] 1655 * @return {[type]} [description]
1436 */ 1656 */
1437 function init() { 1657 function init() {
  1658 + actionNav(); //处理导航
1438 actionExeTemplate(); //处理模板 1659 actionExeTemplate(); //处理模板
1439 actionInitCookie(); //初始化cookie 1660 actionInitCookie(); //初始化cookie
1440 actionExeCookieMap(); //格式化cookie 1661 actionExeCookieMap(); //格式化cookie
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.