common.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. function getDate(sep='-'){
  2. var myDate = new Date();
  3. return myDate.getFullYear()+sep+(myDate.getMonth()+1)+sep+myDate.getDate();
  4. }
  5. $(function (){
  6. var myDate = new Date();
  7. $('.line1 .datenow').text(getDate())
  8. $(".login-content .select-input").click(function(){
  9. $(".login-content .select-input .muchang-list").toggle();
  10. })
  11. $(".login-content .select-input .muchang-list li").on("click",function(){
  12. var title = $(this).text();
  13. $(".login-content .select-input .muchang-title").text(title);
  14. })
  15. var poly = $(".header-wrapper .title svg polygon");
  16. var coorddd = "0,0 75,100 114,100 135,82 765,82 786,100 825,100 900,0";//原坐标
  17. var t_width = $(".header-wrapper .title").width();
  18. var svg = $(".header-wrapper .title svg");
  19. var y_width = svg.attr('width');//原来的宽度
  20. var h_width = t_width + 280;//后来的宽度
  21. var c_width = h_width - y_width;//相差多少宽度
  22. svg.attr('width',h_width);
  23. var cood_arrs = coorddd.split(' ');
  24. var af_coodarrs = [];
  25. for(var i = 0;i<8;++i){
  26. if(i>=4){
  27. var cood = cood_arrs[i].split(',');
  28. cood[0] = parseInt(cood[0])+c_width;//坐标相应调整相差的宽度
  29. cooo = cood.join(',');
  30. af_coodarrs[i] = cooo;
  31. }else{
  32. af_coodarrs[i] = cood_arrs[i];
  33. }
  34. }
  35. var af_coods = af_coodarrs.join(' ');
  36. poly.attr('points',af_coods);
  37. //console.log(af_coods)
  38. //console.log(cood_arrs)
  39. })