SlideShare une entreprise Scribd logo
1  sur  16
http://lzlu.com/blog 我的 kissy 学习笔记
如何获取 KISSY ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
如何使用 KISSY Kissy 下载包中包含所有的源码和 build 好的文件 项目中我们只需要包含 kissy/build/ 文件夹即可 1. 引用 kissy core <script  src=“build/packages/ks-core-min.js”></script> 2. 使用 kissy <script> KISSY.ready(function(S) { var DOM= S.DOM, str= &quot;<div class='hello'> 你好, kissy ! <div>&quot; +   &quot;<script>alert(' 大家好,才是真的好! ')<script>&quot;; DOM.html(document.body,str,true); });  </ script>
如何使用 KISSY 如果需要引用组建,直接引用组建地址即可,比如要引用 switchable <script  src=&quot;kissy/build/packages/ks-core-min.js&quot;></script> <script  src=&quot;kissy/build/switchable/switchable-pkg-min.js&quot;></script> <script> KISSY.ready(function(S) { var tabs = new S.Tabs('#demo1'); }); </script> 最新版的 KISSY  核心已支持  loader  机制,引用多个组建时,我们的代码可以更加漂亮 <script  src=&quot;kissy/build/packages/ks-core-min.js&quot;></script> <script src=“kissy/build/seed-min.js&quot;></script> <script> KISSY.use('switchable', function(S) {  new S.Slide('#id'); }); </script>
KISSY 的结构
KS – Core  :  mix() 方法 KS – Core  :  mix() 方法 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
KS – Core  :  merge,augment,extend merge ( arguments : object) :将多个对象的成员合并到一个新对象上。
KS – Core  :  merge,augment,extend augment ( r, s, ov, wl ) : 将  s.prototype  的成员复制到  r.prototype  上。
KS – Core  :  merge,augment,extend extend ( r, s, px, sx ) : 让函数对象  r  继承函数对象  s. Chicken.superclass.constructor.call(this,name)  表示执行父类的构造函数 用过 Ext 的朋友肯定很熟悉
KS – Core  :  add,app,namespace ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
KS – Core  : DOM  selector kissy 选择器有以下四个方法: query( selector, context ) :获取符合选择器的所有元素。该方法的返回值始终是数组。  get ( selector, context ) :获取符合选择器的第一个元素。不存在时返回  null.  filter ( selector, filter ) :根据选择器获取满足过滤条件的所有元素。  test ( selector, filter ) :判断根据选择器获取的所有元素是否都符合过滤条件  参数 selector 可以为选择器、 Node 、 NodeList // 目前只支持以下选择器: #id  tag  .cls  #id tag  #id .cls  tag.cls  #id tag.cls 如果觉得以上选择器不够用,我们可以通过设置 KISSY. ExternalSelector 来扩展选择器的功能。 KISSY 源码中自带了一个 Sizzle ,你直接引用 Sizzle.js 就行了。
KS – Core  : DOM ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
KS – Core  :  Event ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
KS – Core  :  Event ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
KS – Widgets  :  switchable  该模块由  Switchable  基础类、插件和  Widget  类组成。 Switchable  基础类抽象了切换的基本操作,通过插件机制实现了自动播放、循环、切换效果、延迟加载、倒计时动画等扩展功能,最后封装成各个  Widget  类,让用户能简明快速地调用。 http://lifesinger.org/blog/2010/07/what-it-really-is-not-what-it-is/
谢谢  !!

Contenu connexe

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

我的Kissy学习笔记

  • 2.
  • 3. 如何使用 KISSY Kissy 下载包中包含所有的源码和 build 好的文件 项目中我们只需要包含 kissy/build/ 文件夹即可 1. 引用 kissy core <script src=“build/packages/ks-core-min.js”></script> 2. 使用 kissy <script> KISSY.ready(function(S) { var DOM= S.DOM, str= &quot;<div class='hello'> 你好, kissy ! <div>&quot; + &quot;<script>alert(' 大家好,才是真的好! ')<script>&quot;; DOM.html(document.body,str,true); }); </ script>
  • 4. 如何使用 KISSY 如果需要引用组建,直接引用组建地址即可,比如要引用 switchable <script src=&quot;kissy/build/packages/ks-core-min.js&quot;></script> <script src=&quot;kissy/build/switchable/switchable-pkg-min.js&quot;></script> <script> KISSY.ready(function(S) { var tabs = new S.Tabs('#demo1'); }); </script> 最新版的 KISSY 核心已支持 loader 机制,引用多个组建时,我们的代码可以更加漂亮 <script src=&quot;kissy/build/packages/ks-core-min.js&quot;></script> <script src=“kissy/build/seed-min.js&quot;></script> <script> KISSY.use('switchable', function(S) { new S.Slide('#id'); }); </script>
  • 6.
  • 7. KS – Core : merge,augment,extend merge ( arguments : object) :将多个对象的成员合并到一个新对象上。
  • 8. KS – Core : merge,augment,extend augment ( r, s, ov, wl ) : 将 s.prototype 的成员复制到 r.prototype 上。
  • 9. KS – Core : merge,augment,extend extend ( r, s, px, sx ) : 让函数对象 r 继承函数对象 s. Chicken.superclass.constructor.call(this,name) 表示执行父类的构造函数 用过 Ext 的朋友肯定很熟悉
  • 10.
  • 11. KS – Core : DOM selector kissy 选择器有以下四个方法: query( selector, context ) :获取符合选择器的所有元素。该方法的返回值始终是数组。 get ( selector, context ) :获取符合选择器的第一个元素。不存在时返回 null. filter ( selector, filter ) :根据选择器获取满足过滤条件的所有元素。 test ( selector, filter ) :判断根据选择器获取的所有元素是否都符合过滤条件 参数 selector 可以为选择器、 Node 、 NodeList // 目前只支持以下选择器: #id tag .cls #id tag #id .cls tag.cls #id tag.cls 如果觉得以上选择器不够用,我们可以通过设置 KISSY. ExternalSelector 来扩展选择器的功能。 KISSY 源码中自带了一个 Sizzle ,你直接引用 Sizzle.js 就行了。
  • 12.
  • 13.
  • 14.
  • 15. KS – Widgets : switchable 该模块由 Switchable 基础类、插件和 Widget 类组成。 Switchable 基础类抽象了切换的基本操作,通过插件机制实现了自动播放、循环、切换效果、延迟加载、倒计时动画等扩展功能,最后封装成各个 Widget 类,让用户能简明快速地调用。 http://lifesinger.org/blog/2010/07/what-it-really-is-not-what-it-is/