Ajax + Jquery页面无刷新投票

<!DOCTYPE html>
<html>
<head>
<title>jQuery ajax投票特效,带动画效果 柱状图</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $("#container div a").click(function() {
        $(this).parent().animate({
           width: '+=100px'
        }, 500);
        $(this).prev().html(parseInt($(this).prev().html()) + 1);
        return false;
    });
});
</script>
<style type="text/css">
* {
    font-family: Arial, "Free Sans";
}
#container {
    margin-top: 20px;
    color: #fff;
}
#container #question {
    display: block;
    padding: 20px;
    font-weight: bold;
    letter-spacing: -3px;
    margin-bottom: 20px;
    padding: 10px;
    font-size: 40px;
}
#container div {
    font-weight: bold;
    letter-spacing: -3px;
    background: #0099cc;
    margin-bottom: 15px;
    padding: 10px;
    font-size: 34px;
    color: #ffffff;
    border-left: 20px solid #333;
    width: 400px;
    -webkit-border-radius: 0.5em;
    -moz-border-radius: 0 0.5em 0.5em 0;
    border-radius: 0 1.5em 1.5em 0;
}
#container div a {
    border-radius: 0.3em;
    text-decoration: none;
    color: #0099cc;
    padding: 5px 15px;
    background: #333;
    margin: 0 20px;
}
#container div a:hover {
    color: #fff;
}
#main {
    background: #0099cc;
    margin-top: 0;
    padding: 2px 0 4px 0;
    text-align: center;
}
#main a {
    color: #ffffff;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    font-family: Arial;
}
#main a:hover {
    text-decoration: underline;
}
body {
    margin: 0;
    padding: 0;
    background: #ffffff url('/jscss/demoimg/201402/trentanove.gif') repeat right top;
}
#text {
    margin: 0 auto;
    width: 500px;
    font-size: 12px;
    color: #0099cc;
    font-weight: bold;
    text-align: center;
    margin-top: 20px;
}
</style>
</head>
<body>
  <div id="container">
      <span id="question">你最喜欢的编程语言是哪一种?</span>
      <div><span>0</span><a href="">投票</a>PHP</div>
      <div><span>0</span><a href="">投票</a>Ruby</div>
      <div><span>0</span><a href="">投票</a>Java</div>
      <div><span>0</span><a href="">投票</a>ASP</div>
      <div><span>0</span><a href="">投票</a>Perl</div>
      <div><span>0</span><a href="">投票</a>ColdFusion</div>
  </div>
</body>
</html>

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值