亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長(zhǎng)資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    Laravel項(xiàng)目全站接入paxj的方法

    下面由laravel教程欄目給大家介紹Laravel項(xiàng)目全站接入paxj的方法,希望對(duì)需要的朋友有所幫助!

    pajx:
    在不刷新頁(yè)面的狀態(tài)下改變url地址

    Laravel項(xiàng)目全站接入paxj的方法

    引入js

    <script src="https://cdn.bootcss.com/jquery.pjax/2.0.1/jquery.pjax.min.js"></script>
    //定義加載區(qū)域$(document).pjax('a', 'body');//定義pjax有效時(shí)間,超過(guò)這個(gè)時(shí)間會(huì)整頁(yè)刷新$.pjax.defaults.timeout = 12000;//顯示加載動(dòng)畫(huà)$(document).on('pjax:click', function () {   $("#loading").show();});//隱藏加載動(dòng)畫(huà)$(document).on('pjax:end', function () {   $("#loading").hide();});
    #loading {   background-color: rgba(238, 238, 238, 0.6);   display: none;   position: absolute;   left: 0;   top: 0;   right: 0;   z-index: 2000;   bottom: 0;   padding-top: 10%;}#loading .spinner {   margin: 100px auto;   width: 50px;   height: 60px;   text-align: center;   font-size: 10px;}#loading .spinner > p {   background-color: rgba(0, 0, 0, 0.2);   height: 100%;   width: 6px;   display: inline-block;   -webkit-animation: stretchdelay 1.2s infinite ease-in-out;   animation: stretchdelay 1.2s infinite ease-in-out;}#loading .spinner .rect2 {   -webkit-animation-delay: -1.1s;   animation-delay: -1.1s;}#loading .spinner .rect3 {   -webkit-animation-delay: -1s;   animation-delay: -1s;}#loading .spinner .rect4 {   -webkit-animation-delay: -0.9s;   animation-delay: -0.9s;}#loading .spinner .rect5 {   -webkit-animation-delay: -0.8s;   animation-delay: -0.8s;}@-webkit-keyframes stretchdelay {   0%,   40%,   100% {     -webkit-transform: scaleY(0.4);   }   20% {     -webkit-transform: scaleY(1);   }}@keyframes stretchdelay {   0%,   40%,   100% {     transform: scaleY(0.4);     -webkit-transform: scaleY(0.4);   }   20% {     transform: scaleY(1);     -webkit-transform: scaleY(1);   }}

    文件目錄
    Laravel項(xiàng)目全站接入paxj的方法
    composer require spatie/laravel-pjax

    composer引入laravel-pjax
    在 app/Http/Kernel.php 文件添加

    protected $middleware = [     ...     SpatiePjaxMiddlewareFilterIfPjax::class,];
        <p id="loading">         <p class="spinner">             <p class="rect1"></p>             <p class="rect2"></p>             <p class="rect3"></p>             <p class="rect4"></p>             <p class="rect5"></p>         </p>     </p>
    贊(0)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)