search.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. $(function(){
  2. // debugger;
  3. try{
  4. console.log("1111111111");
  5. $(".longCardList-div td").each(function(){
  6. //debugger;
  7. if ($(this).find('.longCardList-thumbnail').length>0) {//有图片的情况下
  8. var tdW = $(this).width();
  9. var thumbnailW = $(this).find(".longCardList-thumbnail").width();
  10. var infoW = parseInt(tdW- thumbnailW -18 - 76);
  11. $(this).find('.longCardList-info').width(infoW);
  12. var thisH = $(this).height();
  13. var infoH = $(this).find('.longCardList-info').height();
  14. var imgH = $(this).find('.longCardList-thumbnail').height();
  15. if (imgH>infoH) {
  16. var top = parseInt(imgH-infoH);
  17. $(this).find('.longCardList').css("margin-top",top+"px");
  18. }else if(imgH<infoH){
  19. var marginTop = (infoH - imgH)/2;
  20. $(this).find('.longCardList-thumbnail').css("margin-top",marginTop+"px");
  21. }
  22. // $(this).find(".change-button").height(thisH).css("line-height",thisH);
  23. }else{
  24. // 2019.5.21修改这个eles里面的内容
  25. if(window.ActiveXObject || "ActiveXObject" in window) {
  26. var tdW = $(".longCardList-div").width();
  27. //没图片的情况下
  28. $(this).find('.longCardList-info').width(tdW - 85);
  29. console.log('ie')
  30. }else {
  31. var tdW = $(this).width();
  32. //没图片的情况下
  33. $(this).find('.longCardList-info').width(tdW - 85);
  34. console.log('no ie')
  35. }
  36. }
  37. var thisH = $(this).height();
  38. // $(this).find('.button-change').css("height",thisH);
  39. // $(this).find('.button-revise').css("height",thisH);
  40. // $(this).find('.button-enable').css("height",thisH);
  41. // $(this).find('.button-reason').css("height",thisH);
  42. // $(this).find('.button-recruit').css("height",thisH);
  43. $(this).find(".button").css({
  44. "line-height":thisH + 22 +"px",
  45. "height":thisH
  46. });
  47. if (thisH<45) {
  48. // $(this).find('.lbutton').css({
  49. // "font-size":"0px",
  50. // "background-position-y":"center",
  51. // "height":"36px",
  52. // "line-height":"36px"
  53. // })
  54. $(this).find('.button').css({
  55. "font-size":"0px",
  56. "background-position-y":"center",
  57. "height":"36px",
  58. "line-height":"36px"
  59. })
  60. }
  61. });
  62. $(".ellipsisDiv").css({"text-overflow": "ellipsis","overflow": "hidden","-webkit-line-clamp": "2","-webkit-box-orient": "vertical","display": "-webkit-box"});
  63. }catch(e){
  64. console.log(e);
  65. }
  66. });