源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

jQuery 入门级学习笔记及源码

  • 时间:2020-12-07 09:28 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:jQuery 入门级学习笔记及源码
jQuery真的很好,有些效果甚至让我尖叫。而各种插件能实现你喜欢的效果,这种方式为jQuery的流行奠定了基础,就像那个crocs鞋子似的。jQuery还有一个优点是达到了将行为与结构分开的目的。 内容概要: 1. 安装 2. Hello jQuery 3. Find me:使用选择器和事件 4. Rate me:使用AJAX 5. Animate me(让我生动起来):使用FX (jQuery FX,jQuery UI后的第二个子库,强调动画效果而非UI的外观模块,包括对象的消失、出现;颜色、大小、位置变换。) 6. Sort me(将我有序化):使用tablesorter插件(表格排序) custom.js
[url=#]} // add markup to container and applier click handlers to anchors $("#rating").append(ratingMarkup.join('')).find("a").click(function(e) { //用join方法返回一个将数组所有元素用指定符号连在一起的字符串 e.preventDefault(); //该方法将通知 Web 浏览器不要执行与事件关联的默认动作(如果存在这样的动作)。 // send requests $.post("rate.aspx?rating=" + $(this).html(), {}, function(xml) { //这里要用{}占一个位 // format result var result = [ "Thanks for rating, current average: ", $("average", xml).text(), ", number of votes: ", $("count", xml).text() ]; // output result $("#rating").html(result.join('')); }); }); ## 一些动态的效果可以使用 show() 和 hide()来表现。伸缩效果。 $("a").toggle(function() { //toggle双向开关 $(".stuff").hide('slow'); }, function() { $(".stuff").show('fast'); }); ## 可以与 animate()联合起来创建一些效果,如一个带渐显的滑动效果 $("a").toggle(function() { $(".stuff").animate({ height: 'hide', opacity: 'hide' }, 'slow'); }, function() { $(".stuff").animate({ height: 'show', opacity: 'show' }, 'slow'); }); ## 使用tablesorter插件(表格排序) ## 几乎所有的特件都是这样用的:先include插件的js文件,然后在某些元素上使用插件定义的方法,当然也有一些参数选项是可以配置的 $("#large").tableSorter(); ## 这个表格还可以加一些突出显示的效果,我们可以做这样一个隔行背景色(斑马线)效果 $("#large").tableSorter({ stripingRowClass: ['odd', 'even'], // Class names for striping supplyed as a array. stripRowsOnStartUp: true // Strip rows on tableSorter init. }); });
jquery-starterkit.rar[/url]
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部