index.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. // 首页input框
  2. var i = 0;
  3. $('.val1,.but1').click(function(){
  4. $('.div-select-keyword').slideUp(500);
  5. setTimeout(noneb,500)
  6. function noneb(){
  7. $('.div-select-keyword').addClass('none');
  8. }
  9. if($('.drop-down').css('display') == "block"){
  10. $('.drop-down').slideUp(500);
  11. }else{
  12. $('.drop-down').stop(true,false).slideDown(500);
  13. $('.drop-down ul li a').click(function(){
  14. $('.val1').val($(this).text());
  15. $("#searchCatalogInnerCode").val($(this).parent().attr("data-id"));
  16. $('.drop-down').slideUp(500);
  17. });
  18. };
  19. });
  20. $('.val2').click(function(){
  21. $('.drop-down').slideUp(500);
  22. })
  23. // }else if(keywordClass == "div-select-keyword"){
  24. // $('.div-select-keyword').slideUp(500);
  25. // setTimeout(noneb,500)
  26. // function noneb(){
  27. // $('.div-select-keyword').addClass('none');
  28. // }
  29. // }
  30. // })
  31. function focusaa(){
  32. $('.div-select-keyword').slideDown(500);
  33. setTimeout(nonea,500)
  34. function nonea(){
  35. $('.div-select-keyword').removeClass('none');
  36. }
  37. }
  38. function valblur(){
  39. $('.val2').blur(function(){
  40. $('.div-select-keyword').slideUp(500);
  41. setTimeout(noneb,500)
  42. function noneb(){
  43. $('.div-select-keyword').addClass('none');
  44. }
  45. })
  46. }
  47. $(".banner-three form").mouseleave(function(){
  48. valblur();
  49. $('.div-select-keyword').slideUp(500);
  50. setTimeout(noneb,500)
  51. function noneb(){
  52. $('.div-select-keyword').addClass('none');
  53. }
  54. $('.drop-down').slideUp(500);
  55. })
  56. //
  57. //
  58. // 首页开始轮播图
  59. var timer;
  60. var k = 0;
  61. var banLen = $('.banner-if>ul>li').length;
  62. //要执行的动画
  63. function show(){
  64. $('.banner-if>ul>li').eq(k).stop().fadeIn(500).siblings().stop().fadeOut(500);
  65. $('.xiabiao a').eq(k).addClass('active').siblings().removeClass('active')
  66. }
  67. function showtimer(){
  68. timer = setInterval(function(){
  69. if(k < banLen - 1){
  70. k ++;
  71. } else{
  72. k = 0
  73. }
  74. show()
  75. },5000)
  76. }
  77. $(function(){
  78. $('.banner-if>ul>li').eq(0).show().siblings().hide();
  79. showtimer();
  80. $('.banner-if>ul>li').hover(
  81. function(){
  82. clearInterval(timer);
  83. },
  84. function(){
  85. showtimer();
  86. })
  87. $('.xiabiao a').hover(function(){
  88. k = $(this).index();
  89. show();
  90. clearInterval(timer);
  91. },function(){
  92. showtimer();
  93. })
  94. })
  95. // 推荐部分的动画效果
  96. $('.fine-left-bottomL ul li').eq(0).css({'position':'relative'});
  97. $('.fine-left-top ul li').click(function(){
  98. $(this).addClass('opactive').siblings().removeClass('opactive');
  99. })
  100. var windowhtight = $(window).height()/2
  101. // 轮播图
  102. $('#slideInner1').carousel({
  103. interval: 3000
  104. })
  105. $('#myCarousel').carousel({
  106. interval: 3000
  107. })
  108. $('#lunbobox1').carousel({
  109. interval: 3000
  110. })
  111. $('#lunbobox2').carousel({
  112. interval: 3000
  113. })
  114. $('#lunbobox3').carousel({
  115. interval: 3000
  116. })
  117. $('#lunbobox4').carousel({
  118. interval: 3000
  119. })
  120. $('#lunbobox5').carousel({
  121. interval: 3000
  122. })
  123. $('#lunbobox6').carousel({
  124. interval: 3000
  125. })
  126. $('#lunbobox7').carousel({
  127. interval: 3000
  128. })
  129. $('#lunbobox8').carousel({
  130. interval: 3000
  131. })
  132. $('#lunbobox9').carousel({
  133. interval: 3000
  134. })
  135. $('#lunbobox10').carousel({
  136. interval: 3000
  137. })
  138. $('#lunbobox11').carousel({
  139. interval: 3000
  140. })
  141. $('#lunbobox12').carousel({
  142. interval: 3000
  143. })
  144. // 选项卡
  145. // 第一个选项卡
  146. $('.hit-nav-jeep').eq(0).addClass('block');
  147. $('.hit #myTab li').eq(0).addClass('active');
  148. $('.hit #myTab li a').mouseover(function(){
  149. var index = $(this).parent().index();
  150. $('.hit-nav-jeep').eq(index).addClass('block').siblings('.hit-nav-jeep').removeClass('block');
  151. $('.hit #myTab li').eq(index).addClass('active').siblings().removeClass('active');
  152. })
  153. $('.second-content1 .second-content-cont').eq(0).addClass('block');
  154. $('.second-content1 #content1 li').eq(0).addClass('active');
  155. $('.second-content1 #content1 li a').mouseover(function(){
  156. var index = $(this).parent().index();
  157. $('.second-content1 .second-content-cont').eq(index).addClass('block').siblings('.second-content-cont').removeClass('block');
  158. $('.second-content1 #content1 li').eq(index).addClass('active').siblings().removeClass('active');
  159. })
  160. $('.second-content2 .second-content-cont').eq(0).addClass('block');
  161. $('.second-content2 #content1 li').eq(0).addClass('active');
  162. $('.second-content2 #content1 li a').mouseover(function(){
  163. var index = $(this).parent().index();
  164. $('.second-content2 .second-content-cont').eq(index).addClass('block').siblings('.second-content-cont').removeClass('block');
  165. $('.second-content2 #content1 li').eq(index).addClass('active').siblings().removeClass('active');
  166. })
  167. $('.second-content3 .second-content-cont').eq(0).addClass('block');
  168. $('.second-content3 #content1 li').eq(0).addClass('active');
  169. $('.second-content3 #content1 li a').mouseover(function(){
  170. var index = $(this).parent().index();
  171. $('.second-content3 .second-content-cont').eq(index).addClass('block').siblings('.second-content-cont').removeClass('block');
  172. $('.second-content3 #content1 li').eq(index).addClass('active').siblings().removeClass('active');
  173. })
  174. $(function(){
  175. $(".banner-con ul li").hover(function(){
  176. $(this).find(".contentbox").stop().fadeIn(500);
  177. $(this).addClass("on").siblings().removeClass("on");
  178. },function(){
  179. $(this).find(".contentbox").stop().fadeOut(500);
  180. $(".banner-con ul li").removeClass("on")
  181. })
  182. $(window).scroll(function() {
  183. if ($(window).scrollTop() > 600) {
  184. $(".fixleftbox").fadeIn(800);
  185. } else {
  186. $(".fixleftbox").fadeOut(800);
  187. $(".fixleftbox ul li").removeClass("on")
  188. }
  189. });
  190. $(".gotop").click(function(){
  191. $("body,html").animate({
  192. scrollTop:0
  193. },500)
  194. })
  195. $(".erweima").hover(function(){
  196. $(".erweimabox").show()
  197. },function(){
  198. $(".erweimabox").hide()
  199. })
  200. $('.fixleftbox ul li').click(function(){
  201. $(this).addClass("on").siblings().removeClass("on")
  202. var box_h= $(".navhotbox").eq($(this).index()).offset().top;
  203. $("body,html").animate({
  204. scrollTop:box_h+20
  205. },200)
  206. });
  207. $(".hotselecetbox a:last-child").css("border","0 none");
  208. $(".newfinetopbox ul li").each(function(){
  209. $(this).hover(function(){
  210. $(this).find(".imgname").show()
  211. },function(){
  212. $(this).find(".imgname").hide()
  213. })
  214. });
  215. $('.boutique-content dl').mouseover(function(){
  216. $(this).addClass('active').siblings().removeClass('active');
  217. });
  218. $(".industrybox .industry:last-child").css("border","0 none");
  219. // 1
  220. var box1_h=$(".fine").offset().top;
  221. var box1h = $(".fine").height();
  222. // 2
  223. var box2_h =$(".newbox0").offset().top;
  224. var box2h = $(".newbox0").height();
  225. // 3
  226. var box3_h =$(".launch").offset().top;
  227. var box3h = $(".launch").height();
  228. // 4
  229. var box4_h =$(".newbox1").offset().top;
  230. var box4h = $(".newbox1").height();
  231. // 5
  232. var box5_h =$(".newbox2").offset().top;
  233. var box5h = $(".newbox2").height();
  234. // 6
  235. var box6_h =$(".newbox3").offset().top;
  236. var box6h = $(".newbox3").height();
  237. // 7
  238. var box7_h =$(".newbox4").offset().top;
  239. var box7h = $(".newbox4").height();
  240. // 8
  241. var box8_h =$(".newbox5").offset().top;
  242. var box8h = $(".newbox5").height();
  243. // 9
  244. var box9_h =$(".newbox6").offset().top;
  245. var box9h = $(".newbox6").height();
  246. // 10
  247. var box10_h =$(".newbox7").offset().top;
  248. var box10h = $(".newbox7").height();
  249. // 11
  250. var box11_h =$(".newbox8").offset().top;
  251. var box11h = $(".newbox8").height();
  252. // 12
  253. var box12_h =$(".newbox9").offset().top;
  254. var box12h = $(".newbox9").height();
  255. // 13
  256. var box13_h =$(".newbox10").offset().top;
  257. var box13h = $(".newbox10").height();
  258. // 14
  259. var box14_h =$(".newbox11").offset().top;
  260. var box14h = $(".newbox11").height();
  261. // 15
  262. var box15_h =$(".newbox12").offset().top;
  263. var box15h = $(".newbox12").height();
  264. $(window).scroll(function() {
  265. if ($(window).scrollTop() > box1_h - windowhtight && $(window).scrollTop() < box1_h + box1h - windowhtight) {
  266. $(".projectli1").addClass("on");
  267. }
  268. else{
  269. $(".projectli1").removeClass("on");
  270. }
  271. });
  272. $(window).scroll(function() {
  273. if ($(window).scrollTop() > box2_h - windowhtight && $(window).scrollTop() < box2_h + box2h-windowhtight) {
  274. $(".projectli2").addClass("on");
  275. }
  276. else{
  277. $(".projectli2").removeClass("on");
  278. }
  279. });
  280. $(window).scroll(function() {
  281. if ($(window).scrollTop() > box3_h - windowhtight && $(window).scrollTop() < box3_h + box3h - windowhtight) {
  282. $(".projectli3").addClass("on");
  283. }
  284. else{
  285. $(".projectli3").removeClass("on");
  286. }
  287. });
  288. $(window).scroll(function() {
  289. if ($(window).scrollTop() > box4_h - windowhtight && $(window).scrollTop() < box4_h + box4h - windowhtight) {
  290. $(".projectli4").addClass("on");
  291. }
  292. else{
  293. $(".projectli4").removeClass("on");
  294. }
  295. });
  296. $(window).scroll(function() {
  297. if ($(window).scrollTop() > box5_h - windowhtight && $(window).scrollTop() < box5_h + box5h - windowhtight) {
  298. $(".projectli5").addClass("on");
  299. }
  300. else{
  301. $(".projectli5").removeClass("on");
  302. }
  303. });
  304. $(window).scroll(function() {
  305. if ($(window).scrollTop() > box6_h - windowhtight && $(window).scrollTop() < box6_h + box6h - windowhtight) {
  306. $(".projectli6").addClass("on");
  307. }
  308. else{
  309. $(".projectli6").removeClass("on");
  310. }
  311. });
  312. $(window).scroll(function() {
  313. if ($(window).scrollTop() > box7_h - windowhtight && $(window).scrollTop() < box7_h + box7h - windowhtight) {
  314. $(".projectli7").addClass("on");
  315. }
  316. else{
  317. $(".projectli7").removeClass("on");
  318. }
  319. });
  320. $(window).scroll(function() {
  321. if ($(window).scrollTop() > box8_h - windowhtight && $(window).scrollTop() < box8_h + box8h - windowhtight) {
  322. $(".projectli8").addClass("on");
  323. }
  324. else{
  325. $(".projectli8").removeClass("on");
  326. }
  327. });
  328. $(window).scroll(function() {
  329. if ($(window).scrollTop() > box9_h - windowhtight && $(window).scrollTop() < box9_h + box9h - windowhtight) {
  330. $(".projectli9").addClass("on");
  331. }
  332. else{
  333. $(".projectli9").removeClass("on");
  334. }
  335. });
  336. $(window).scroll(function() {
  337. if ($(window).scrollTop() > box10_h - windowhtight && $(window).scrollTop() < box10_h + box10h - windowhtight) {
  338. $(".projectli10").addClass("on");
  339. }
  340. else{
  341. $(".projectli10").removeClass("on");
  342. }
  343. });
  344. $(window).scroll(function() {
  345. if ($(window).scrollTop() > box11_h - windowhtight && $(window).scrollTop() < box11_h + box11h - windowhtight) {
  346. $(".projectli11").addClass("on");
  347. }
  348. else{
  349. $(".projectli11").removeClass("on");
  350. }
  351. });
  352. $(window).scroll(function() {
  353. if ($(window).scrollTop() > box12_h - windowhtight && $(window).scrollTop() < box12_h + box12h - windowhtight) {
  354. $(".projectli12").addClass("on");
  355. }
  356. else{
  357. $(".projectli12").removeClass("on");
  358. }
  359. });
  360. $(window).scroll(function() {
  361. if ($(window).scrollTop() > box13_h - windowhtight && $(window).scrollTop() < box13_h + box13h - windowhtight) {
  362. $(".projectli13").addClass("on");
  363. }
  364. else{
  365. $(".projectli13").removeClass("on");
  366. }
  367. });
  368. $(window).scroll(function() {
  369. if ($(window).scrollTop() > box14_h - windowhtight && $(window).scrollTop() < box14_h + box14h - windowhtight) {
  370. $(".projectli14").addClass("on");
  371. }
  372. else{
  373. $(".projectli14").removeClass("on");
  374. }
  375. });
  376. $(window).scroll(function() {
  377. if ($(window).scrollTop() > box15_h - windowhtight && $(window).scrollTop() < box15_h + box15h - windowhtight) {
  378. $(".projectli15").addClass("on");
  379. }
  380. else{
  381. $(".projectli15").removeClass("on");
  382. }
  383. });
  384. })