index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. $(function(){
  2. //添富汇优势滚动效果
  3. $("#go_left").click(function(){
  4. if($("#advantage_con_ul").css("left") == "0px"){
  5. $("#advantage_con_ul").css({"left":"-1200px"});
  6. $("#go_left").css("background","url(./img/index/20180116221147.png)0 0 no-repeat");
  7. $("#go_right").css("background","url(./img/index/形状5副本3.png)0 0 no-repeat");
  8. }else{
  9. return false;
  10. }
  11. })
  12. $("#go_right").click(function(){
  13. if($("#advantage_con_ul").css("left") == "-1200px"){
  14. $("#advantage_con_ul").css({"left":"0px"});
  15. $("#go_left").css("background","url(./img/index/形状5副本.png)0 0 no-repeat");
  16. $("#go_right").css("background","url(./img/index/20180116221219.jpg)0 0 no-repeat");
  17. }else{
  18. return false;
  19. }
  20. })
  21. //优势模块
  22. var advantageMsg = new Vue({
  23. el:"#advantage_con_ul",
  24. data:{
  25. items:[]
  26. }
  27. })
  28. $.ajax({
  29. url:"./json/3.json",
  30. type:"get",
  31. dataType:"json",
  32. success:function(msg){
  33. advantageMsg.items = msg;
  34. console.log(msg);
  35. }
  36. })
  37. //新闻
  38. var newsMsg = new Vue({
  39. el:"#news_con_ul",
  40. data:{
  41. items:[]
  42. }
  43. })
  44. $.ajax({
  45. url:"./json/news.json",
  46. type:"get",
  47. dataType:"json",
  48. success:function(msg){
  49. newsMsg.items = msg;
  50. }
  51. })
  52. window.addEventListener("load",function(){
  53. $("#header_nav_list li:nth-child(1)").children("div").addClass("head_nav_subscript_active");
  54. })
  55. })