jQuery html css实现购物车案例

本文展示了如何结合jQuery、CSS3和HTML技术实现一个购物车的全选功能模块。通过代码示例,详细解释了各个部分的实现逻辑和效果。
摘要由CSDN通过智能技术生成

效果如下图所示
在这里插入图片描述全选功能模块链接
代码

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<script src="Jq.js"></script>
	<script type="text/javascript">
	$(function(){
   
		$('#id_1 ul :first-child').siblings('li').hide();
		$('#id_1 ul :first-child').siblings('li').css('border-bottom','1px solid black');
		$('#id_1 ul').mousedown(function(){
   
			$(this).children('li').show();
		});
		$('#id_1 ul').mouseleave(function(){
   
			$(this).children('li').eq(0).siblings('li').hide();
		});
		$('#checkall').change(function(){
   
			/*全选按钮控制下面的按钮*/
			$('.cargo').find('input').prop('checked',$(this).prop('checked'));
		})
		$('.cargo').find('input').change(function(){
   
			/*下面的按钮控制全选按钮*/
			//console.log($('.cargo input:checked').length);
			/*先刷新一下 总计*/
			if($('.cargo input:checked').length==3){
   
				$('#checkall').prop('checked',true);
			}else{
   
				$('#checkall').prop('checked',false);
			}
		})
		$('.delete').click(function(){
   
			/*删除键  */
			$(this).parent().parent().find('input').prop('value',0);
			$(this).parent().parent().hide();
		
			var money=parseFloat($(this).parent().parent().find('.univalence').html());
			var num=parseInt($(this).parent().parent().find('input'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值