//jquery特效制作复选框全选反选取消(无插件) // 全选 $(".allselect").click(function () { $(".gwc_tb2 input[name=newslist]").each(function () { $(this).attr("checked", true); // $(this).next().css({ "background-color": "#3366cc", "color": "#ffffff" }); }); GetCount(); }); //反选 $("#invert").click(function () { $(".gwc_tb2 input[name=newslist]").each(function () { if ($(this).attr("checked")) { $(this).attr("checked", false); //$(this).next().css({ "background-color": "#ffffff", "color": "#000000" }); } else { $(this).attr("checked", true); //$(this).next().css({ "background-color": "#3366cc", "color": "#000000" }); } }); GetCount(); }); //取消 $("#cancel").click(function () { $(".gwc_tb2 input[name=newslist]").each(function () { $(this).attr("checked", false); // $(this).next().css({ "background-color": "#ffffff", "color": "#000000" }); }); GetCount(); }); // 所有复选(:checkbox)框点击事件 $(".gwc_tb2 input[name=newslist]").click(function () { if ($(this).attr("checked")) { //$(this).next().css({ "background-color": "#3366cc", "color": "#ffffff" }); } else { // $(this).next().css({ "background-color": "#ffffff", "color": "#000000" }); } }); // 输出 $(".gwc_tb2 input[name=newslist]").click(function () { // $("#total2").html() = GetCount($(this)); GetCount(); //alert(conts); });});//******************function GetCount() { var conts = 0; var aa = 0; $(".gwc_tb2 input[name=newslist]").each(function () { if ($(this).attr("checked")) { for (var i = 0; i < $(this).length; i++) { conts += parseInt($(this).val()); aa += 1; } } }); $("#shuliang").text(aa); $("#zong1").html((conts).toFixed(2)); $("#jz1").css("display", "none"); $("#jz2").css("display", "block");}商品加减算总数var t = $("#text_box1"); $("#add1").click(function () { t.val(parseInt(t.val()) + 1) setTotal(); GetCount(); }) $("#min1").click(function () { t.val(parseInt(t.val()) - 1) setTotal(); GetCount(); }) function setTotal() { $("#total1").html((parseInt(t.val()) * 9).toFixed(2)); $("#newslist-1").val(parseInt(t.val()) * 9); } setTotal();总数$(".quanxun").click(function () { setTotal(); //alert($(lens[0]).text()); }); function setTotal() { var len = $(".tot"); var num = 0; for (var i = 0; i < len.length; i++) { num = parseInt(num) + parseInt($(len[i]).text()); } //alert(len.length); $("#zong1").text(parseInt(num).toFixed(2)); $("#shuliang").text(len.length); }
文件目录······
暂无数据
猜你喜欢
更多»
项目推荐
更多»
PDF电子书
更多»
Java多线程编程核心技术
(2)
Linux命令详解词典.pdf
(5)
深入Python3中文版
(0)
百度SEO一本通.pdf
(0)
mysql必知必会.pdf
(2)
疯狂JAVA讲义 pdf电子书
(3)
C# 图解教程pdf电子书
(3)
研磨设计模式 pdf电子书
(0)