Where possible begins

希望你喜欢这里。有问题,请提问,或搜索现有帖子。

真诚、友善、团结、专业,共建你我引以为荣之社区。《常见问题解答》

子枫
子枫 [Rainy] 09-21 10:55

给网站添加一键分享到微博,微信,qq等社交媒体的功能

开发调优

<p>例如</p><p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdoAAADjCAYAAAAi5tV+AAAgAElEQVR4Ae3d/XNVVYLucev+Abdqfpip+8v9A+4PUzVVzlTdqu62xp7SueNM6R3tabW1L23Z46g4d6rV28LQjYqoKPbYKm07QitCj42ljKGRF0GB8JrwJqCEdwgBQgKEt/CWwD7PrWefnHBOcs46+2SdJMzku7pSnJy111o7n9A87nXWXvum06dPq9KXKAgggAACCCAQJXBTpZD1+xQEEEAAAQQQiBMgaOP8aI0AAggggEBQgKAN8lCJAAIIIIBAnABBG+dHawQQQAABBIICBG2Qh0oEEEAAAQTiBAjaOD9aI4AAAgggEBQgaIM8VCKAAAIIIBAnQNDG+dEaAQQQQACBoABBG+ShEgEEEEAAgTgBgjbOj9YIIIAAAggEBQjaIA+VCCCAAAIIxAkQtHF+tEYA

214

子枫
子枫 [Rainy] 11-07 12:01

HTML+JS 全选与取消全选功能

开发调优

<pre class="brush:html;toolbar:false">&lt;!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;全选框--&gt; &lt;input&nbsp;type=&quot;checkbox&quot;&nbsp;class=&quot;box-title&quot;&nbsp;onclick=&quot;selectAll()&quot;&gt; &lt;!-- 需要被选中的部分--&gt; &lt;input&nbsp;name=&#39;box&#39;&nbsp;type=&#39;checkbox&#39;&gt; &lt;input&nbsp;name=&#39;box&#39;&nbsp;type=&#39;checkbox&#39;&gt; &lt;input&nbsp;name=&#39;box&#39;&nbsp;type=&#39;checkbox&#39;&gt; &lt;input&nbsp;name=&

733

子枫
子枫 [Rainy] 11-07 10:18

给网站整个手电筒效果

开发调优

<p>直接加入下面的js代码即可</p><pre class="brush:html;toolbar:false">&nbsp;&nbsp;document.querySelector(&#39;style&#39;).append(`canvas&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;position:&nbsp;fixed; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;left:0; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top:&nbsp;0; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z-index:&nbsp;9999; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pointer-events:&nbsp;none; &nbsp;&nbsp;&nbsp;&nbsp;}`) &nb

286

子枫
子枫 [Rainy] 11-03 09:58

页面禁止右键

开发调优

<pre class="brush:php;toolbar:false">&lt;script&gt; document.oncontextmenu&nbsp;=&nbsp;function(){ &nbsp;&nbsp;return&nbsp;false; } document.onkeydown&nbsp;=&nbsp;function(){ &nbsp;&nbsp;if&nbsp;(event.ctrlKey&nbsp;&amp;&amp;&nbsp;window.event.keyCode==67){ &nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;false; &nbsp;&nbsp;} } document.body.oncopy&nbsp;=&nbsp;function&nbsp;(){ &nbsp;&nbsp;return&nbsp;false; } document.onselectstart&nbsp;=&nbsp;function(){ &nbsp;&nbsp;//return&nbsp;false; } &l

245

子枫
子枫 [Rainy] 10-19 11:49

js时间倒计时

开发调优

<pre class="brush:php;toolbar:false">var&nbsp;div&nbsp;=&nbsp;document.getElementById(&quot;showtime&quot;); &nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;showtime&nbsp;=&nbsp;function&nbsp;()&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;nowtime&nbsp;=&nbsp;new&nbsp;Date(),&nbsp;&nbsp;//获取当前时间 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;endtime&nbsp;=&nbsp;new&nbsp;Date(&quot;2022/10/19&nbsp;11:46:00&quot;);&nbsp;&nbsp;//定义结束时间 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

247

子枫
子枫 [Rainy] 10-18 14:30

php隐藏手机号码中间几位数

开发调优

<pre class="brush:php;toolbar:false">function&nbsp;hide_mobile&nbsp;($num) {&nbsp;&nbsp;&nbsp;&nbsp;$num&nbsp;=&nbsp;substr_replace($num,&nbsp;&quot;****&quot;,&nbsp;3,&nbsp;4);&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$num; }</pre><p><span style="font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 14px; background-color: rgb(238, 238, 238);">例如156***8956</span></p>

380

子枫
子枫 [Rainy] 10-13 19:36

php 抛异常

开发调优

<pre class="brush:php;toolbar:false">try&nbsp;{ }catch&nbsp;(Exception&nbsp;$e)&nbsp;{ return&nbsp;jserror($e); }</pre><p><br/></p>

274

子枫
子枫 [Rainy] 10-10 20:20

mysql通过经纬度按距离排序

开发调优

<pre class="brush:php;toolbar:false">$latitude&nbsp;=&nbsp;input(&#39;latitude&#39;,&#39;&#39;); $longitude&nbsp;=&nbsp;input(&#39;longitude&#39;,&#39;&#39;); if($longitude!=&#39;&#39;&nbsp;&amp;&amp;&nbsp;$latitude!=&#39;&#39;&nbsp;){ $_jl_str&nbsp;=&nbsp;&#39;ROUND( &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6378.138&nbsp;*&nbsp;2&nbsp;*&nbsp;ASIN( &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb

241

子枫
子枫 [Rainy] 09-19 10:21

php字符串是佛包含

开发调优

<pre class="brush:php;toolbar:false">if(strpos(&#39;www.jb51.net&#39;,&#39;jb51&#39;)&nbsp;!==&nbsp;false){&nbsp; &nbsp;echo&nbsp;&#39;包含jb51&#39;;&nbsp; }else{ &nbsp;echo&nbsp;&#39;不包含jb51&#39;;&nbsp; }</pre><p><br/></p>

308

子枫
子枫 [Rainy] 09-14 17:33

al链接去掉默认链接颜色

开发调优

<pre style="box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; word-break: break-all; overflow-wrap: break-word; color: rgb(51, 51, 51); background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); border-radius: 4px;">a&nbsp;{&nbsp;color:&nbsp;inherit;&nbsp;}</pre><p><br/></p>

292

子枫
子枫 [Rainy] 08-30 10:09

通过google接口获取经纬度和地址

开发调优

<pre class="brush:php;toolbar:false">&nbsp;&nbsp;&nbsp;&nbsp;$(&#39;.get_location&#39;).on(&#39;click&#39;,function(){ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;findLatLonFromIP().then( &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function(value)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;lat&nbsp;=&nbsp;value.lat &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;lng&nbsp;=&nbsp;value.lng &nbsp;&nbsp;&nbsp;

307

子枫
子枫 [Rainy] 08-30 09:01

tp51打印sql

开发调优

<p><span style="color: rgb(197, 200, 198); font-family: &quot;Source Code Pro&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Ubuntu Mono&quot;, &quot;Anonymous Pro&quot;, &quot;Droid Sans Mono&quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, sans-serif; font-size: 14px; white-space: pre; background-color: rgb(29, 31, 33);">-&gt;fetchSql(</span><span class="hljs-literal" style="box-sizing: border-box; outline: 0px; margin: 0px; pad

263

子枫
子枫 [Rainy] 08-24 14:10

分享几个可免费使用的网站CDN加速服务

开发调优

<p style="margin-top: 0px; margin-bottom: 18px; padding: 0px; box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; line-height: 26px; color: rgb(96, 98, 102); font-family: &quot;Joe Font&quot;; font-size: 15px; white-space: normal; background-color: rgb(255, 255, 255);"><span class="joe_message info" style="margin: 0px; padding: 8px 15px; box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; display: block; position: relative; border-left: 4

378

子枫
子枫 [Rainy] 07-09 11:00

layui table 的宽度超出自动隐藏

开发调优

<pre class="brush:php;toolbar:false">td{ min-width:&nbsp;150px; max-width:&nbsp;200px; /*&nbsp;超出长度隐藏&nbsp;*/ overflow:&nbsp;hidden; text-overflow:&nbsp;ellipsis; white-space:&nbsp;nowrap; }</pre><p><br/></p>

599

子枫
子枫 [Rainy] 07-07 12:05

TP5.1下实现手动断开mysql数据库链接操作

开发调优

<p>参考文章 :<a href="https://blog.csdn.net/qq_40364437/article/details/107388997" _src="https://blog.csdn.net/qq_40364437/article/details/107388997">https://blog.csdn.net/qq_40364437/article/details/107388997</a> </p><p><br/></p>

273