FOCUS ON JAVASCRIPT
One of JavaScript’s best features is the ability to augment the built-in types. If we want to add a new method to a type, we simply assign a function to the type’s prototype.[Details]
newsCarousel - 滚动新闻特效,我用我自己写的YaoUI代码库,模仿的YAHOO.COM新版首页的一个滚动新闻效果,新闻滚动的瞬间加载JSON数据。功能实用,调用简单,兼容性好,希望大家能喜欢。
第一步:在页面中调用yao.js文件,例如:
<script type="text/javascript" src="js/yao.js"></script>
第二步:编写调用代码:
(function(){ var newsCarousel = new YAO.newsCarousel({ carouselCnt: YAO.getEl('yt-mod'), carousel: YAO.getEl('yt-carousel'), items: 'li', root: YAO.getEl('y-today'), ajaxable: true, ajaxItemNum: 9 }); newsCarousel.init(); })();