Discuz! X3.4网页自适应方法
将以下代码放到后台统计代码里即可:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | <script src= "https://cdn.bootcss.com/jquery/3.4.1/jquery.slim.min.js" ></script> <script> var jq = jQuery.noConflict();</script> <script> jq(document).ready(function () { jq( "head" ).append( '<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">' ) jq( "head" ).append( '<style>.tedt{width:100% !important; max-width:600px}</style>' ) jq( "head" ).append( '<style>.quote{width:100% !important}</style>' ) jq( "#toptb" ).css( "min-width" , "0" ) jq( ".hdc.cl" ).css( "min-height" , "0" ) jq( ".wp" ).css( "min-width" , "0" ) jq( ".zoom" ).css( "width" , "100%" ) jq( ".zoom" ).css( "max-width" , "600px" ) jq( ".attach_nopermission.attach_tips" ).css( "width" , "100%" ) jq( ".attach_nopermission.attach_tips" ).css( "max-width" , "600px" ) jq( ".tedt.mtn" ).css( "width" , "100%" ) jq( ".tedt.mtn" ).css( "max-width" , "600px" ) jq( "#scrolltop" ).children( "span:eq(0)" ).children( "a" ).attr( "onclick" , "void(0)" ) resized() }) window.addEventListener( "resize" , resized) function resized() { if (jq(document).width() <= 650) { jq( "#online" ).hide() jq( "#qmenu" ).hide() jq( "#um" ).children( "p:eq(1)" ).hide() jq( "#um" ).css( "padding-right" , "0" ) jq( "#scbar_txt" ).css( "width" , "calc(100vw - 145px)" ) jq( ".scbar_hot_td" ).hide() jq( ".fl_i" ).hide() jq( ".fl_by" ).hide() jq( ".hdc.cl" ).children( "h2" ).children( "a" ).children( "img" ).css( "height" , "32px" ) jq( "#chart" ).hide() jq( "#loginstatus" ).hide() jq( ".avt.y" ).hide() jq( ".y.pns" ).children( "table" ).children( "tbody" ).children( "tr:eq(0)" ).hide() jq( ".y.pns" ).children( "table" ).children( "tbody" ).children( "tr:eq(1)" ).children( "td:eq(0)" ).hide() jq( ".y.pns" ).children( "table" ).children( "tbody" ).children( "tr:eq(1)" ).children( "td:eq(1)" ).hide() jq( "#frt" ).hide() jq( ".by" ).hide() jq( ".num" ).hide() jq( ".bm_h.cl" ).children( ".y" ).hide() jq( "#toptb" ).children( ".wp" ).children( ".y" ).hide() jq( ".pls" ).hide() jq( "#fj" ).hide() jq( "#fastsmiliesdiv" ).hide() jq( "#fastposteditor" ).css( "margin-right" , "0" ) jq( "#p_btn" ).hide() } else { jq( "#online" ).show() jq( "#qmenu" ).show() jq( "#um" ).children( "p:eq(1)" ).show() jq( "#um" ).css( "padding-right" , "60px" ) jq( "#scbar_txt" ).css( "width" , "400px" ) jq( ".scbar_hot_td" ).show() jq( ".fl_i" ).show() jq( ".fl_by" ).show() jq( ".hdc.cl" ).children( "h2" ).children( "a" ).children( "img" ).css( "height" , "66px" ) jq( ".pipe" ).show() jq( "#chart" ).show() jq( "#loginstatus" ).show() jq( ".avt.y" ).show() jq( ".y.pns" ).children( "table" ).children( "tbody" ).children( "tr:eq(0)" ).show() jq( ".y.pns" ).children( "table" ).children( "tbody" ).children( "tr:eq(1)" ).children( "td:eq(0)" ).show() jq( ".y.pns" ).children( "table" ).children( "tbody" ).children( "tr:eq(1)" ).children( "td:eq(1)" ).show() jq( "#frt" ).show() jq( ".by" ).show() jq( ".num" ).show() jq( ".bm_h.cl" ).children( ".y" ).show() jq( "#toptb" ).children( ".wp" ).children( ".y" ).show() jq( ".pls" ).show() jq( "#fj" ).show() jq( "#fastsmiliesdiv" ).show() jq( "#fastposteditor" ).css( "margin-right" , "170px" ) jq( "#p_btn" ).show() } } </script> |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!