pbootcms無(wú)刷新點(diǎn)贊
<a href="javascript:void(0);" class="zan fr"><span>贊</span>(<span id="likes-num">{content:likes}</span>)<span class="tac click-tip">您已點(diǎn)贊!</span></a> <style> .likes a:hover { background: #4fc08d; color: #fff; transition: all .5s; -webkit-transition: all .5s; } .likes .zan { position: relative !important; } .likes a { height: 40px; line-height: 40px; display: inline-block; padding: 0 15px; background: #fff; border: 1px solid #4fc08d; color: #4fc08d; border-radius: 30px; transition: all .5s; -webkit-transition: all .5s; } .likes a span { text-align: center; margin: 0 3px; } .likes-tip, .click-tip { position: absolute; top: -45px; left: 50%; margin-left: -45px !important; margin-right: 0px !important; width: 90px; height: 30px; line-height: 30px; background: #4fc08d; border-radius: 3px; color: #fff; font-size: 14px; text-align: center; display: none; } </style> <script src="{pboot:sitetplpath}/js/jQuery.cookie.js"></script> <script> var Like_status = jQuery.cookie('likes_{content:id}'); if( Like_status == 1 ){ $('.likes > .iconfont').attr('class', 'iconfont hover-color'); $('.zan').attr('title','您已點(diǎn)贊'); jQuery('.zan').append('<span class="tac likes-tip">您已點(diǎn)贊!</span>'); jQuery('.like-link').removeAttr('href'); $('.click-tip').css("display","none"); } </script> <script> $('.zan').on('click',//綁定點(diǎn)贊事件 function() { $.ajax({ url: '{content:likeslink}',//點(diǎn)贊鏈接 data: { 'likes': 'likes' }, success: function(data) { $('#likes-num').load(location.href + " #likes-num");//點(diǎn)贊后刷新#support_number if (data.state) {} else { $(".click-tip").css("display","block").delay(1500).fadeOut(400);//已贊提示 }}, error: function(xhr, status, error) { console.log(error) } }); }) </script>
如果您的問(wèn)題還未解決可以聯(lián)系站長(zhǎng)付費(fèi)協(xié)助。

有問(wèn)題可以加入技術(shù)QQ群一起交流學(xué)習(xí)
本站vip會(huì)員 請(qǐng)加入無(wú)憂模板網(wǎng) VIP群(50604020) PS:加入時(shí)備注用戶名或昵稱
普通注冊(cè)會(huì)員或訪客 請(qǐng)加入無(wú)憂模板網(wǎng) 技術(shù)交流群(50604130)
客服微信號(hào):15898888535
聲明:本站所有文章資源內(nèi)容,如無(wú)特殊說(shuō)明或標(biāo)注,均為采集網(wǎng)絡(luò)資源。如若內(nèi)容侵犯了原著者的合法權(quán)益,可聯(lián)系站長(zhǎng)刪除。