jquery支持缓存存储和添加删除的购物车特效代码

所属分类: 网页特效-其它&杂项    2024-02-18 09:29:57

jquery支持缓存存储和添加删除的购物车特效代码 ie兼容6
 查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

jquery支持缓存存储和添加删除的购物车特效代码(共-2个文件)

使用方法

$(document).ready(function(){
	
	var textInput = $('#inputshop').val();
	
	$(".b-popup").hide();
	
	
	if (localStorage.getItem('shoplistlocal')) {
    	$('.list').html(localStorage.getItem('shoplistlocal'));
	}
			
	
    $("#market .items").on("click",function(e){
		$('.count').css({"display":"block"});
    	var itemvalue =  $(this).html();
		$('.list').append('<li    class="item">'+$(this).html()+'</li>');
		var shoplistlocal = $('.list').html();
		localStorage.setItem('shoplistlocal', shoplistlocal);
		return false;
    });

	  			
	$(".list").on("click", ".item", function () {
    	$(this).remove();
		  $('.count').css({"display":"block"});
		  var itemlength = $(".app-body li").length;
		  $('.count').text(itemlength);
		  var shoplistlocal = $('.list').html();
    	localStorage.setItem('shoplistlocal', shoplistlocal);
		return false;
    });
	
	    			 
     $(".closepopup").click(function(){
	 $(".b-popup").hide(200);
    });
	

    $(".openpopup").click(function(){
		if ($('.item').is('li')) {
		$(".b-popup").fadeIn(200);}
	else {
		$(".tooltipshop2").animate({marginLeft: "20px",easing: "easeout",opacity:"1"},300);
		$(".tooltipshop2").delay(900).animate({opacity:"0",marginLeft: "-90px"});
	}
	});
    $("#send").click(function(){
		var itemname = $("#inputname").val();
		var itememail = $("#inputemail").val();
		var itemtel = $("#inputtel").val();
		var shopbox = $(".app-body").html();
		$.ajax({
			url: "sendmessege.php",
			type: "post",
			dataType: "json",
			  data: {
				 "itemname": user_name,
				 "itememail": user_email,
				 "itemtel": user_comment,
				 "shopbox": user_money
			  },
			 success: function() {
				 alert("Ваше сообщение отправлено!");
				 
				  }
	});
		});
		
		$('.closewindow').click(function(){
			$('.app').fadeOut(500);
		});	
	    	$('#tray').click(function(){
			$('.app').fadeIn(500);
		});	
		
		
	$('.items').click(function() {
		var itemlength = $(".app-body li").length;
		$('.count').text(itemlength);	
	});
		
		
	$(".openpopup2").click(function() {
   		window.localStorage.clear();
		$('.list').children().remove();
		$('.count').hide();
    	return false;
	});		
});

站长提示:
1. 苦力吧素材官方QQ群:950875342
2. 平台上所有素材资源,需注册登录会员方能正常下载。
3. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励2K币
4. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
5. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
相关资源 / 其它&杂项

jquery带拖动的进度条播放停止代码

一款可控制进度条的脚本特效,带开始和停止按钮,超实用的功能。
  其它&杂项
 2906  0

jquery鼠标拖拽拖动div元素特效DEMO演示

一款可鼠标拖拽移动的DIV元素,非常简单就可以运用了!
  其它&杂项
 4724  0

jquery滚动页面侧边栏吸顶浮动固定插件

一个轻量级滚动侧边栏吸顶插件,能在滚动页面时将边栏模块紧贴页面顶部固定浮动。
  其它&杂项
 2833  0

jquery根据页面滚动方向自动显示隐藏header头部模块

一款可自动隐藏显示的粘性头部插件,根据页面滚动条滚动方向自动显示和消失header页面头部模块。
  其它&杂项
 1603  0

评论数(0) 回复有机会获得K币 用户协议

^_^ 还没有人评论,快来抢个沙发!
😀
  • 😀
  • 😊
  • 😂
  • 😍
  • 😑
  • 😷
  • 😵
  • 😛
  • 😣
  • 😱
  • 😋
  • 😎
  • 😵
  • 😕
  • 😶
  • 😚
  • 😜
  • 😭
发表评论