Discuz! X3.4网页自适应方法-Discuz教程下载

Discuz! X3.4网页自适应方法

开通本站Svip会员,全站资源免费下
将以下代码放到后台统计代码里即可:
  1. <script src="https://CDN.bootCSS.com/jquery/3.4.1/jquery.slim.min.js"></script>
  2. <script>var jq = jQuery.noConflict();</script>
  3. <script>
  4.   jq(document).ready(function () {
  5.     jq("head").append('<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">')
  6.     jq("head").append('<style>.tedt{width:100% !important; max-width:600px}</style>')
  7.     jq("head").append('<style>.quote{width:100% !important}</style>')
  8.     jq("#toptb").css("min-width", "0")
  9.     jq(".hdc.cl").css("min-height", "0")
  10.     jq(".wp").css("min-width", "0")
  11.     jq(".zoom").css("width", "100%")
  12.     jq(".zoom").css("max-width", "600px")
  13.     jq(".attach_nopermission.attach_tips").css("width", "100%")
  14.     jq(".attach_nopermission.attach_tips").css("max-width", "600px")
  15.     jq(".tedt.mtn").css("width", "100%")
  16.     jq(".tedt.mtn").css("max-width", "600px")
  17.     jq("#scrolltop").children("span:eq(0)").children("a").attr("onclick", "void(0)")
  18.     resized()
  19.   })
  20.   window.addEventListener("resize", resized)
  21.   function resized() {
  22.     if (jq(document).width() <= 650) {
  23.       jq("#online").hide()
  24.       jq("#qmenu").hide()
  25.       jq("#um").children("p:eq(1)").hide()
  26.       jq("#um").css("padding-right", "0")
  27.       jq("#scbar_txt").css("width", "calc(100vw - 145px)")
  28.       jq(".scbar_hot_td").hide()
  29.       jq(".fl_i").hide()
  30.       jq(".fl_by").hide()
  31.       jq(".hdc.cl").children("h2").children("a").children("img").css("height", "32px")
  32.       jq("#chart").hide()
  33.       jq("#loginstatus").hide()
  34.       jq(".avt.y").hide()
  35.       jq(".y.pns").children("table").children("tbody").children("tr:eq(0)").hide()
  36.       jq(".y.pns").children("table").children("tbody").children("tr:eq(1)").children("td:eq(0)").hide()
  37.       jq(".y.pns").children("table").children("tbody").children("tr:eq(1)").children("td:eq(1)").hide()
  38.       jq("#frt").hide()
  39.       jq(".by").hide()
  40.       jq(".num").hide()
  41.       jq(".bm_h.cl").children(".y").hide()
  42.       jq("#toptb").children(".wp").children(".y").hide()
  43.       jq(".pls").hide()
  44.       jq("#fj").hide()
  45.       jq("#fastsmiliesdiv").hide()
  46.       jq("#fastposteditor").css("margin-right", "0")
  47.       jq("#p_btn").hide()
  48.     } else {
  49.       jq("#online").show()
  50.       jq("#qmenu").show()
  51.       jq("#um").children("p:eq(1)").show()
  52.       jq("#um").css("padding-right", "60px")
  53.       jq("#scbar_txt").css("width", "400px")
  54.       jq(".scbar_hot_td").show()
  55.       jq(".fl_i").show()
  56.       jq(".fl_by").show()
  57.       jq(".hdc.cl").children("h2").children("a").children("img").css("height", "66px")
  58.       jq(".pipe").show()
  59.       jq("#chart").show()
  60.       jq("#loginstatus").show()
  61.       jq(".avt.y").show()
  62.       jq(".y.pns").children("table").children("tbody").children("tr:eq(0)").show()
  63.       jq(".y.pns").children("table").children("tbody").children("tr:eq(1)").children("td:eq(0)").show()
  64.       jq(".y.pns").children("table").children("tbody").children("tr:eq(1)").children("td:eq(1)").show()
  65.       jq("#frt").show()
  66.       jq(".by").show()
  67.       jq(".num").show()
  68.       jq(".bm_h.cl").children(".y").show()
  69.       jq("#toptb").children(".wp").children(".y").show()
  70.       jq(".pls").show()
  71.       jq("#fj").show()
  72.       jq("#fastsmiliesdiv").show()
  73.       jq("#fastposteditor").css("margin-right", "170px")
  74.       jq("#p_btn").show()
  75.     }
  76.   }
  77. </script>
复制代码

相关教程
【实测】DZ论坛首页用手机访问怎么才能自适应显示PC端的首页
【实测】把Discuz网站或论坛改成自适应网页的方法,无需开启手机版及安装手机模板
【原创】制作CSS自适应网站,常用像素大全

全部评论 0

您需要登录后才可以回帖 立即登录
登录
0
0
0
返回顶部