Jquery 代码参考

jquery 代码参考

  1. jQuery(document).ready(function($){});
  2. jQuery(window).on('load', function(){});
  3. $('.video_section[data-name="'+id+'"]').removeClass('hide').siblings().addClass('hide');
  4. if($('.menu_desktop').is(':visible')){};
  5. $(this).parents('ul').find('a').each(function(){});

常用js代码

  • cookie
function getCookie(cname) {
	var name = cname + "=";
	var decodedCookie = decodeURIComponent(document.cookie);
	var ca = decodedCookie.split(';');
	for(var i = 0; i < ca.length; i++) {
		var c = ca[i];
		while (c.charAt(0) == ' ') {
			c = c.substring(1);
		}
		if (c.indexOf(name) == 0) {
			return c.substring(name.length, c.length);
		}
	}
	return "";
}

学习链接

未完,,后续更新中,,

posted @ 2019-08-15 20:02  绝技小嗨皮  阅读(165)  评论(0编辑  收藏  举报
Title