HTML点赞功能
10个回答
展开全部
HTML+CSS网站点赞和打赏的功能,实现方法如下:
1、HTML代码:
<body>
<div class="thumbs_content">
<a href="javascript:void(0)" class="thumbs_button fa fa-thumbs-up" title="点赞,支持一下"> 点赞</a>
<a href="javascript:void(0)" class="reward_button fa fa-money" title="打赏,支持一下"> 打赏</a>
<span class="clear"></span>
</div>
</body>
2、CSS代码如下:
<style type="text/css">
.thumbs_content{
width: 291px;
margin: 0 auto;
}
.thumbs_button{
float: left;
width:145px;
text-align: center;
margin:5px auto;
height: 45px;
line-height: 45px;
background-color:#444;
color:#fbfbfb;
text-align:center;
text-decoration:none;
font-weight:bold;
font-size:16px;
transition: all 0.3s;
border-radius: 0 0 0 25px;
-webkit-border-radius: 0 0 0 25px;
-moz-border-radius: 0 0 0 25px;
-o-border-radius: 0 0 0 25px;
}
.reward_button{
float: left;
width:145px;
text-align: center;
margin:5px auto;
height: 45px;
line-height: 45px;
background-color:#cd4450;
color:#fbfbfb;
text-align:center;
text-decoration:none;
font-weight:bold;
font-size:16px;
border-left:1px solid #fbfbfb;
transition: all 0.3s;
border-radius: 0 25px 0 0;
-webkit-border-radius: 0 25px 0 0;
-moz-border-radius: 0 25px 0 0;
-o-border-radius: 0 25px 0 0;
}
.thumbs_button:hover, .reward_button:hover{
opacity:0.8;
font-size:18px;
}
.clear{
clear:both;
}
</style>
3、效果图:
展开全部
var paramJSON = {参数1:"值0",参数2:"值1"};
//URL路径为你提交到后台录入数据库的操作,也就是你的图片对应的路径
//paramJSON为你需要传递的参数 可选
//function回调函数为你点赞录入数据库后返回的消息,比如是否录入数据库成功等
$.post("URL路径", paramJSON,
function(data){
alert("Data Loaded: " + data);
});
//URL路径为你提交到后台录入数据库的操作,也就是你的图片对应的路径
//paramJSON为你需要传递的参数 可选
//function回调函数为你点赞录入数据库后返回的消息,比如是否录入数据库成功等
$.post("URL路径", paramJSON,
function(data){
alert("Data Loaded: " + data);
});
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
HTML没法做这个,只能做临时的,关闭浏览器又变成原始的数字了
追问
js呢?
追答
js只能实现他的业务方法
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
$("#btn").click(function () {
var count = $("#lbl").text();
count++;
$("#lbl").text(count);
})
<input type="button" id="btn" value="赞" />
<label id="lbl">0</label>
追问
可以写成文件格式?然后上传或发给我
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xap="http://ns.adobe.com/xap/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:xapMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:exif="http://ns.adobe.com/exif/1.0/" xap:CreateDate="2016-09-18T11:18:07+08:00" xap:ModifyDate="2016-09-18T11:20:18+08:00" xap:MetadataDate="2016-09-18T11:20:18+08:00" xap:CreatorTool="Adobe Photoshop CS3 Windows" dc:format="image/jpeg" photoshop:ColorMode="3" photoshop:History="" xapMM:InstanceID="uuid:1735C7B54E7DE61190A49A7CCB0C6B68" tiff:Orientation="1" tiff:XResolution="960000/10000" tiff:YResolution="960000/10000" tiff:ResolutionUnit="2" tiff:NativeDigest="256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;187CE6B471FF12A6ACD2F43E71F30608" exif:PixelXDimension="650" exif:PixelYDimension="400" exif:ColorSpace="-1" exif:NativeDigest="36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;30B3CF7EF56799A53D30CE58FD799F0D"/> </rdf:RDF> </x:xmpmeta>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询