common.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //打开详情
  2. function openDetialPage(url){
  3. $("#listPage").hide();//隐藏列表
  4. $("#detialPage").load(url,function(){
  5. if($('#detialPage').height() < 720){
  6. $('#iframe-main', parent.document).css('height', 720)
  7. }else{
  8. $('#iframe-main', parent.document).css('height', $('#detialPage').height() + 40)
  9. }
  10. });
  11. }
  12. // function openDetialPage(url){
  13. // $("#listPage").hide();//隐藏列表
  14. // $.ajaxSetup ({
  15. // cache: false
  16. // });
  17. // $.ajax({
  18. // url: url,
  19. // type: 'get',
  20. // data: "",
  21. // beforeSend: function (XMLHttpRequest) {
  22. // loadingFlag = layer.load();
  23. // },
  24. // success: function (data) {
  25. // layer.close(loadingFlag);
  26. // $("#detialPage").html(data);
  27. // }
  28. // })
  29. // $("#detialPage").load(url,function(){
  30. // scrollBar();
  31. // });
  32. // }
  33. // 详情返回列表函数
  34. function goback(url){
  35. // console.log($("#listPage").length)
  36. if($("#listPage").length){
  37. $("#detialPage").empty();
  38. $("#listPage").show();//显示列表
  39. if($('#listPage').height() < 720){
  40. $('#iframe-main', parent.document).css('height', 720)
  41. }else{
  42. $('#iframe-main', parent.document).css('height', $('#listPage').height() + 20)
  43. }
  44. }else{
  45. location.href = url;
  46. // window.history.back(-1)
  47. }
  48. }
  49. // 滚动条
  50. function scrollBar() {
  51. if($('.content').height() < 720){
  52. $('#iframe-main', parent.document).css('height', 720);
  53. }else{
  54. $('#iframe-main', parent.document).css('height', $('.content').height() + 20)
  55. }
  56. }