Jquery 投票插件
2010-07-22 17:33
92 查看
交 通:12345
环 境:12345
规 划:12345
配 套:12345
物 业:12345
开发商:12345
(function ($) {
$.fn.score = function (options) {
var opts = $.extend({}, $.fn.score.defaults, options);
$(this).find("a").each(function (i, e) {
$(e).attr("class", opts.offClass);
});
$(this).find("li").each(function (i, e) {
var key = $(e).children("input")[0].value;
$(e).children("a").each(function (ai, ae) {
$(ae).mouseover(function () {
$(this).prevAll("a").attr("class", opts.onClass);
$(this).attr("class", opts.onClass);
}).mouseout(function () {
$(this).prevAll("a").attr("class", opts.offClass);
$(this).attr("class", opts.offClass);
}).click(function () {
var st = $(this).html();
$.ajax({
url: "http://" + location.host + "/Score.ashx",
data: { "type": key, "pid": opts.targetId, "score": st },
dataType: "text",
type: "GET",
success: function (responseText) {
if (responseText == "1") {
alert("评分成功!感想你的参入!!");
} else {
alert("评分失败!感想你的参入!!");
}
}
});
});
});
});
return this;
}
$.fn.score.defaults = {
targetId: 0,
onClass: "on",
offClass: "off"
}
})(jQuery);
相关文章推荐
- 投票系统显示结果--jQuery插件
- 基于jQuery的投票系统显示结果插件
- 一个简单的投票插件(jQuery rater plugin)
- JQUERY插件:仿QQ今日话题正反方投票百分比显示
- 基于jQuery的投票系统显示结果插件
- Jquery 投票插件
- 基于jQuery的投票系统显示结果插件
- 投票系统显示结果--jQuery插件
- 投票系统显示结果--jQuery插件
- jQuery插件EasyDrag轻松实现JS拖动的效果
- 把jQuery的类、插件封装成seajs的模块的方法
- 编写jQuery插件
- jQuery formValidator表单校验插件ver3.0全新功能发布,支持自动创建提示层。
- JQuery插件开发教程
- firefox浏览器用jquery.uploadify插件上传时报HTTP 302错误
- 创建基于Bootstrap的下拉菜单的DropDownList的JQuery插件
- jQuery 投票
- jQuery全屏滚动插件fullPage
- 关于锚点跳转及jQuery下相关操作与插件
- jquery.infinitescroll无限加载插件