SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
Slideshow
                          虎牙
                        2011/06/21


2011/6/21
http://docs.kissyui.com/kissy/src/switchable/demo.html




2011/6/21
2011/6/21
HTML Structure
<!-- Container -->
<div id="J_slideshow">
    <!-- Panels -->
    <ul class="yui3-slideshow-panelcon">
        <li class="yui3-slideshow-panel yui3-slideshow-selected">
            <img src="http://img02.taobaocdn.com/tps/i2/T1Gk8nXaJkXXXXXXXX-505-320.jpg" />
        </li>
        <li class="yui3-slideshow-panel">
            <img src="http://img07.taobaocdn.com/tps/i7/T1UA4nXeVlXXXXXXXX-505-320.jpg" />
        </li>
        <li class="yui3-slideshow-panel">
            <img src="http://img01.taobaocdn.com/tps/i1/T1sk8nXhlkXXXXXXXX-505-320.jpg" />
        </li>
    </ul>
    <!-- Triggers -->
    <ul class="yui3-slideshow-triggercon">
        <li class="yui3-slideshow-trigger yui3-slideshow-selected">1</li>
        <li class="yui3-slideshow-trigger">2</li>
        <li class="yui3-slideshow-trigger">3</li>
    </ul>
</div>




2011/6/21
Utility
•   Automatically play
•   Lazyload
•   Circular
•   Effect
•   IO
•   …



2011/6/21
Effect
•   Tab
•   Fade
•   Slide
•   Carousel
•   …




2011/6/21
Effect - Fade
// 1 show toEl, fade fromEl to opacity 0
fromEl.setStyle('zIndex', 9);
toEl.setStyle('zIndex', 1);
toEl.setStyle('opacity', 1);
Y.Anim(fromEl, { 'opactity': 0 });

// 2 fade toEl to opaticy 1
fromEl.setStyle('zIndex', 1);
toEl.setStyle('zIndex', 9);
toEl.setStyle('opacity', 0);
Y.Anim(toEl, { 'opactity': 1 });



2011/6/21
Effect - Carousel




            http://developer.yahoo.com/ypatterns/richinteraction/transition/slide.
            html
            http://developer.yahoo.com/ypatterns/selection/carousel.html




2011/6/21
Effect - Carousel




2011/6/21
Utility – Circular
• Move nodes
• Copy nodes
• Position: relative
   adjustPos: function() { },
   switchTo: function() { },
   resetPos: function() { }




2011/6/21
Utility - Automatically Play
   play: function() {
       var self = this;
       if (self.timer != null) { clearTimeout(self.timer); }
       self.timer = setTimeout(function() {
           self.next();
           self.timer = setTimeout(arguments.callee, self.timeOut);
       }, self.timeOut);
       return this;
   },
   stop: function() {
       var self = this;
       if (self.timer) {
           clearTimeout(self.timer);
           self.timer = null;
       }
       return this;
   }




2011/6/21
Design Pattern
•   Adapter
•   Factory
•   Extend
•   Plugin
•   …




2011/6/21
Adapter – Y.Slide
if (that.effect == 'none') {

} else if (that.effect == 'v-slide') {

} else if (that.effect == 'h-slide') {

} else if (that.effect == 'fade') {

}




2011/6/21
Factory – Y.Anim And Y.Easing
var Easing = {
    easeNone: function (t, b, c, d) {
        return c*t/d + b;
    },
    easeIn: function (t, b, c, d) {
        return c*(t/=d)*t + b;
    },
    ...
};
var anim = new Y.Anim({
    easing: Y.Easing.easeIn
});



2011/6/21
Plugin – S.Switchable
Switchable.Plugins = [];
Switchable.Plugins.push({
    name: 'circular',
    init: function(host) { }
});
S.each(Switchable.Plugins, function(plugin) {
    if(plugin.init) {
        plugin.init(self);
    }
});




2011/6/21
Extend – S.Switchable
•   Tabs
•   Slide
•   Carousel
•   Accordion




2011/6/21
Extend – S.Switchable
function Switchable(container, config) { }
function Carousel(container, config) {
    Carousel.superclass.constructor.call(
        self,
        container,
        S.merge(defaultConfig, config)
    );
}
S.extend(Carousel, S.Switchable);
Carousel.prototype._switchView = function() { };




2011/6/21
Slideshow




2011/6/21
Postscript
• Y.Anim
• CSS3 Transitions, Transforms &
  Animation
• Memory Leak




 2011/6/21
CSS3 Transitions, Transforms And Animation

• http://css3.bradshawenterprises.com/dem
  os/multiple_images.php
• http://css3.bradshawenterprises.com/dem
  os/imageslider.php
• http://css3.bradshawenterprises.com/




2011/6/21
Memory Leak




     YUI 3.0.0 & YUI 3.1.0


2011/6/21
Memory Leak




     YUI 3.2.0 & YUI 3.3.0

2011/6/21
Thanks!



2011/6/21

Weitere ähnliche Inhalte

Was ist angesagt?

UI 모듈화로 워라밸 지키기
UI 모듈화로 워라밸 지키기UI 모듈화로 워라밸 지키기
UI 모듈화로 워라밸 지키기NAVER SHOPPING
 
Advanced jQuery
Advanced jQueryAdvanced jQuery
Advanced jQuerysergioafp
 
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012Eduardo Lundgren
 
Animating angular applications
Animating angular applicationsAnimating angular applications
Animating angular applicationsTomek Sułkowski
 
Introducing AlloyUI DiagramBuilder
Introducing AlloyUI DiagramBuilderIntroducing AlloyUI DiagramBuilder
Introducing AlloyUI DiagramBuilderEduardo Lundgren
 
Front-End Developers Can Makes Games, Too!
Front-End Developers Can Makes Games, Too!Front-End Developers Can Makes Games, Too!
Front-End Developers Can Makes Games, Too!FITC
 

Was ist angesagt? (8)

UI 모듈화로 워라밸 지키기
UI 모듈화로 워라밸 지키기UI 모듈화로 워라밸 지키기
UI 모듈화로 워라밸 지키기
 
Advanced jQuery
Advanced jQueryAdvanced jQuery
Advanced jQuery
 
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
 
Animating angular applications
Animating angular applicationsAnimating angular applications
Animating angular applications
 
$.Template
$.Template$.Template
$.Template
 
Introducing AlloyUI DiagramBuilder
Introducing AlloyUI DiagramBuilderIntroducing AlloyUI DiagramBuilder
Introducing AlloyUI DiagramBuilder
 
Akka / Lts behavior
Akka / Lts behaviorAkka / Lts behavior
Akka / Lts behavior
 
Front-End Developers Can Makes Games, Too!
Front-End Developers Can Makes Games, Too!Front-End Developers Can Makes Games, Too!
Front-End Developers Can Makes Games, Too!
 

Andere mochten auch

新业务新员工培训 Banner设计
新业务新员工培训   Banner设计新业务新员工培训   Banner设计
新业务新员工培训 Banner设计jay li
 
Html5form
Html5formHtml5form
Html5formjay li
 
夏之 专题设计
夏之 专题设计夏之 专题设计
夏之 专题设计jay li
 
Jswebapps
JswebappsJswebapps
Jswebappsjay li
 
Js doc toolkit
Js doc toolkitJs doc toolkit
Js doc toolkitjay li
 
JavaScript Engine
JavaScript EngineJavaScript Engine
JavaScript Enginejay li
 
高性能远程调用解决方案
高性能远程调用解决方案高性能远程调用解决方案
高性能远程调用解决方案Ady Liu
 

Andere mochten auch (7)

新业务新员工培训 Banner设计
新业务新员工培训   Banner设计新业务新员工培训   Banner设计
新业务新员工培训 Banner设计
 
Html5form
Html5formHtml5form
Html5form
 
夏之 专题设计
夏之 专题设计夏之 专题设计
夏之 专题设计
 
Jswebapps
JswebappsJswebapps
Jswebapps
 
Js doc toolkit
Js doc toolkitJs doc toolkit
Js doc toolkit
 
JavaScript Engine
JavaScript EngineJavaScript Engine
JavaScript Engine
 
高性能远程调用解决方案
高性能远程调用解决方案高性能远程调用解决方案
高性能远程调用解决方案
 

Ähnlich wie Slide

Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponentsMartin Hochel
 
Web components with java by Haijian Wang
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian WangGWTcon
 
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloadingRiga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloadingAnton Arhipov
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCpootsbook
 
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...Alessandro Nadalin
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterpriseDave Artz
 
Reactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJSReactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJSMartin Hochel
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Chris Alfano
 
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)Alessandro Nadalin
 
2009 Hackday Taiwan Yui
2009 Hackday Taiwan Yui2009 Hackday Taiwan Yui
2009 Hackday Taiwan YuiJH Lee
 
How to develop a Graphical User Interface (GUI) in Scilab
How to develop a Graphical User Interface (GUI) in ScilabHow to develop a Graphical User Interface (GUI) in Scilab
How to develop a Graphical User Interface (GUI) in ScilabScilab
 
Lhy tutorial gui(1)
Lhy tutorial gui(1)Lhy tutorial gui(1)
Lhy tutorial gui(1)Brijesh Naik
 
Beyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance JavascriptBeyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance Javascriptaglemann
 
New text documentfsdfs
New text documentfsdfsNew text documentfsdfs
New text documentfsdfsAh Lom
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript FrameworkAll Things Open
 

Ähnlich wie Slide (20)

YUI 3
YUI 3YUI 3
YUI 3
 
Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponents
 
Web components with java by Haijian Wang
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian Wang
 
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloadingRiga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
 
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
Reactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJSReactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJS
 
14709302.ppt
14709302.ppt14709302.ppt
14709302.ppt
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
 
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
 
2009 Hackday Taiwan Yui
2009 Hackday Taiwan Yui2009 Hackday Taiwan Yui
2009 Hackday Taiwan Yui
 
How to develop a Graphical User Interface (GUI) in Scilab
How to develop a Graphical User Interface (GUI) in ScilabHow to develop a Graphical User Interface (GUI) in Scilab
How to develop a Graphical User Interface (GUI) in Scilab
 
Lhy tutorial gui(1)
Lhy tutorial gui(1)Lhy tutorial gui(1)
Lhy tutorial gui(1)
 
Beyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance JavascriptBeyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance Javascript
 
New text documentfsdfs
New text documentfsdfsNew text documentfsdfs
New text documentfsdfs
 
J query
J queryJ query
J query
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
 
Yuihacku iitd-sumana
Yuihacku iitd-sumanaYuihacku iitd-sumana
Yuihacku iitd-sumana
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript Framework
 

Mehr von jay li

犀牛书第六版
犀牛书第六版犀牛书第六版
犀牛书第六版jay li
 
淘宝移动端Web开发最佳实践
淘宝移动端Web开发最佳实践淘宝移动端Web开发最佳实践
淘宝移动端Web开发最佳实践jay li
 
潜力无限的编程语言Javascript
潜力无限的编程语言Javascript潜力无限的编程语言Javascript
潜力无限的编程语言Javascriptjay li
 
Responsive Web UI Design
Responsive Web UI DesignResponsive Web UI Design
Responsive Web UI Designjay li
 
深入剖析浏览器
深入剖析浏览器深入剖析浏览器
深入剖析浏览器jay li
 
HTML/CSS/JS基础
HTML/CSS/JS基础HTML/CSS/JS基础
HTML/CSS/JS基础jay li
 
淘宝前端技术巡礼
淘宝前端技术巡礼淘宝前端技术巡礼
淘宝前端技术巡礼jay li
 
F2e security
F2e securityF2e security
F2e securityjay li
 
中国元素在设计中的应用 -如瑟
中国元素在设计中的应用 -如瑟中国元素在设计中的应用 -如瑟
中国元素在设计中的应用 -如瑟jay li
 
卫银霞 -统计数字会撒谎
卫银霞 -统计数字会撒谎卫银霞 -统计数字会撒谎
卫银霞 -统计数字会撒谎jay li
 
编码大全 拔赤
编码大全 拔赤编码大全 拔赤
编码大全 拔赤jay li
 
小控件、大学问
小控件、大学问小控件、大学问
小控件、大学问jay li
 
Mobile UI design and Developer
Mobile UI design and DeveloperMobile UI design and Developer
Mobile UI design and Developerjay li
 
Javascript autoload
Javascript autoloadJavascript autoload
Javascript autoloadjay li
 
赤骥 用户研究入门
赤骥 用户研究入门赤骥 用户研究入门
赤骥 用户研究入门jay li
 
Ecmascript
EcmascriptEcmascript
Ecmascriptjay li
 
2011彩票首页开发实践
2011彩票首页开发实践2011彩票首页开发实践
2011彩票首页开发实践jay li
 
Web设计的画纸深入了解我们的显示器
Web设计的画纸深入了解我们的显示器Web设计的画纸深入了解我们的显示器
Web设计的画纸深入了解我们的显示器jay li
 
潜意识设计
潜意识设计潜意识设计
潜意识设计jay li
 
Html&css培训 舒克
Html&css培训 舒克Html&css培训 舒克
Html&css培训 舒克jay li
 

Mehr von jay li (20)

犀牛书第六版
犀牛书第六版犀牛书第六版
犀牛书第六版
 
淘宝移动端Web开发最佳实践
淘宝移动端Web开发最佳实践淘宝移动端Web开发最佳实践
淘宝移动端Web开发最佳实践
 
潜力无限的编程语言Javascript
潜力无限的编程语言Javascript潜力无限的编程语言Javascript
潜力无限的编程语言Javascript
 
Responsive Web UI Design
Responsive Web UI DesignResponsive Web UI Design
Responsive Web UI Design
 
深入剖析浏览器
深入剖析浏览器深入剖析浏览器
深入剖析浏览器
 
HTML/CSS/JS基础
HTML/CSS/JS基础HTML/CSS/JS基础
HTML/CSS/JS基础
 
淘宝前端技术巡礼
淘宝前端技术巡礼淘宝前端技术巡礼
淘宝前端技术巡礼
 
F2e security
F2e securityF2e security
F2e security
 
中国元素在设计中的应用 -如瑟
中国元素在设计中的应用 -如瑟中国元素在设计中的应用 -如瑟
中国元素在设计中的应用 -如瑟
 
卫银霞 -统计数字会撒谎
卫银霞 -统计数字会撒谎卫银霞 -统计数字会撒谎
卫银霞 -统计数字会撒谎
 
编码大全 拔赤
编码大全 拔赤编码大全 拔赤
编码大全 拔赤
 
小控件、大学问
小控件、大学问小控件、大学问
小控件、大学问
 
Mobile UI design and Developer
Mobile UI design and DeveloperMobile UI design and Developer
Mobile UI design and Developer
 
Javascript autoload
Javascript autoloadJavascript autoload
Javascript autoload
 
赤骥 用户研究入门
赤骥 用户研究入门赤骥 用户研究入门
赤骥 用户研究入门
 
Ecmascript
EcmascriptEcmascript
Ecmascript
 
2011彩票首页开发实践
2011彩票首页开发实践2011彩票首页开发实践
2011彩票首页开发实践
 
Web设计的画纸深入了解我们的显示器
Web设计的画纸深入了解我们的显示器Web设计的画纸深入了解我们的显示器
Web设计的画纸深入了解我们的显示器
 
潜意识设计
潜意识设计潜意识设计
潜意识设计
 
Html&css培训 舒克
Html&css培训 舒克Html&css培训 舒克
Html&css培训 舒克
 

Slide

  • 1. Slideshow 虎牙 2011/06/21 2011/6/21
  • 4. HTML Structure <!-- Container --> <div id="J_slideshow"> <!-- Panels --> <ul class="yui3-slideshow-panelcon"> <li class="yui3-slideshow-panel yui3-slideshow-selected"> <img src="http://img02.taobaocdn.com/tps/i2/T1Gk8nXaJkXXXXXXXX-505-320.jpg" /> </li> <li class="yui3-slideshow-panel"> <img src="http://img07.taobaocdn.com/tps/i7/T1UA4nXeVlXXXXXXXX-505-320.jpg" /> </li> <li class="yui3-slideshow-panel"> <img src="http://img01.taobaocdn.com/tps/i1/T1sk8nXhlkXXXXXXXX-505-320.jpg" /> </li> </ul> <!-- Triggers --> <ul class="yui3-slideshow-triggercon"> <li class="yui3-slideshow-trigger yui3-slideshow-selected">1</li> <li class="yui3-slideshow-trigger">2</li> <li class="yui3-slideshow-trigger">3</li> </ul> </div> 2011/6/21
  • 5. Utility • Automatically play • Lazyload • Circular • Effect • IO • … 2011/6/21
  • 6. Effect • Tab • Fade • Slide • Carousel • … 2011/6/21
  • 7. Effect - Fade // 1 show toEl, fade fromEl to opacity 0 fromEl.setStyle('zIndex', 9); toEl.setStyle('zIndex', 1); toEl.setStyle('opacity', 1); Y.Anim(fromEl, { 'opactity': 0 }); // 2 fade toEl to opaticy 1 fromEl.setStyle('zIndex', 1); toEl.setStyle('zIndex', 9); toEl.setStyle('opacity', 0); Y.Anim(toEl, { 'opactity': 1 }); 2011/6/21
  • 8. Effect - Carousel http://developer.yahoo.com/ypatterns/richinteraction/transition/slide. html http://developer.yahoo.com/ypatterns/selection/carousel.html 2011/6/21
  • 10. Utility – Circular • Move nodes • Copy nodes • Position: relative adjustPos: function() { }, switchTo: function() { }, resetPos: function() { } 2011/6/21
  • 11. Utility - Automatically Play play: function() { var self = this; if (self.timer != null) { clearTimeout(self.timer); } self.timer = setTimeout(function() { self.next(); self.timer = setTimeout(arguments.callee, self.timeOut); }, self.timeOut); return this; }, stop: function() { var self = this; if (self.timer) { clearTimeout(self.timer); self.timer = null; } return this; } 2011/6/21
  • 12. Design Pattern • Adapter • Factory • Extend • Plugin • … 2011/6/21
  • 13. Adapter – Y.Slide if (that.effect == 'none') { } else if (that.effect == 'v-slide') { } else if (that.effect == 'h-slide') { } else if (that.effect == 'fade') { } 2011/6/21
  • 14. Factory – Y.Anim And Y.Easing var Easing = { easeNone: function (t, b, c, d) { return c*t/d + b; }, easeIn: function (t, b, c, d) { return c*(t/=d)*t + b; }, ... }; var anim = new Y.Anim({ easing: Y.Easing.easeIn }); 2011/6/21
  • 15. Plugin – S.Switchable Switchable.Plugins = []; Switchable.Plugins.push({ name: 'circular', init: function(host) { } }); S.each(Switchable.Plugins, function(plugin) { if(plugin.init) { plugin.init(self); } }); 2011/6/21
  • 16. Extend – S.Switchable • Tabs • Slide • Carousel • Accordion 2011/6/21
  • 17. Extend – S.Switchable function Switchable(container, config) { } function Carousel(container, config) { Carousel.superclass.constructor.call( self, container, S.merge(defaultConfig, config) ); } S.extend(Carousel, S.Switchable); Carousel.prototype._switchView = function() { }; 2011/6/21
  • 19. Postscript • Y.Anim • CSS3 Transitions, Transforms & Animation • Memory Leak 2011/6/21
  • 20. CSS3 Transitions, Transforms And Animation • http://css3.bradshawenterprises.com/dem os/multiple_images.php • http://css3.bradshawenterprises.com/dem os/imageslider.php • http://css3.bradshawenterprises.com/ 2011/6/21
  • 21. Memory Leak YUI 3.0.0 & YUI 3.1.0 2011/6/21
  • 22. Memory Leak YUI 3.2.0 & YUI 3.3.0 2011/6/21