Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adjust homepage files

  • Loading branch information...
commit d01bc6d67e362efc20e07f1333fdab8fd4566fb8 1 parent cc97bc7
ShiChunhua authored
View
4 demo/core/GridTree/example.htm
@@ -25,8 +25,8 @@
function init(){
var p = new ajax();
- //p.url = "data/gridTree.xml";
- p.url = "../../service/gridTree.asp";
+ p.url = "data/gridTree.xml";
+ //p.url = "../../service/gridTree.asp";
p.onresult = function(){
var data = this.data.selectSingleNode(".//GridTree");
buildGrid(data);
View
4 demo/core/ScrollTab/example.htm
@@ -45,8 +45,8 @@
function getData(){
var p = new ajax();
- //p.url = "data/data.xml";
- p.url = "../../service/scrollTab.asp";
+ p.url = "data/data.xml";
+ //p.url = "../../service/scrollTab.asp";
p.onresult = function(){
var data = this.data.selectSingleNode(".//ScrollTab");
buildTab(data);
View
4 demo/core/SimpleGrid/example.htm
@@ -39,8 +39,8 @@
simpleGrid.canResize = true;
var p = new ajax();
- //p.url = "data/grid.xml";
- p.url = "../../service/simpleGrid.asp";
+ p.url = "data/grid.xml";
+ //p.url = "../../service/simpleGrid.asp";
p.setContent("page",page);
if(null != orderCol && null != orderDirection){
p.setContent("orderCol",orderCol);
View
BIN  demo/core/SimpleTree/SimpleTree.rar
Binary file not shown
View
4 demo/core/SimpleTree/example.htm
@@ -23,8 +23,8 @@
<!--
function init(){
var p = new ajax();
- //p.url = "data/tree.xml";
- p.url = "../../service/simpleTree.asp";
+ p.url = "data/tree.xml";
+ //p.url = "../../service/simpleTree.asp";
p.onresult = function(){
var data = this.text;
buildTree(data);
View
4 demo/core/SliderPicShow/example.htm
@@ -46,8 +46,8 @@
function buildXml(){
var p = new ajax();
- //p.url = "data.xml";
- p.url = "../../service/sliderPicShow.asp";
+ p.url = "data.xml";
+ //p.url = "../../service/sliderPicShow.asp";
p.onresult = function(){
var data = this.data.selectSingleNode(".//SliderPic");
var div = document.getElementById("sliderCon");
View
4 demo/core/VerticalTree/example.htm
@@ -22,8 +22,8 @@
var tree = new VerticalTree();
tree.showWaitingLayer();
var p = new ajax();
- //p.url = "data/tree.xml";
- p.url = "../../service/verticalTree.asp";
+ p.url = "data/tree.xml";
+ //p.url = "../../service/verticalTree.asp";
p.onresult = function(){
var treeData = this.data.selectSingleNode(".//Tree");
tree.data = treeData;
View
7 demo/core/tween/SchAIM-mini.js
@@ -0,0 +1,7 @@
+/**
+* @author Ê·´¿»ª(shichunhua)
+* @fileoverview Dom Effect Class
+* @contact Hi:newdumdum QQ:38898431 Email:sch119@163.com
+* @copyright
+*/
+var SchAIM=(function(){var a={Linear:function(f,e,h,g){return h*f/g+e;},Quad:{easeIn:function(f,e,h,g){return h*(f/=g)*f+e;},easeOut:function(f,e,h,g){return -h*(f/=g)*(f-2)+e;},easeInOut:function(f,e,h,g){if((f/=g/2)<1){return h/2*f*f+e;}return -h/2*((--f)*(f-2)-1)+e;}},Cubic:{easeIn:function(f,e,h,g){return h*(f/=g)*f*f+e;},easeOut:function(f,e,h,g){return h*((f=f/g-1)*f*f+1)+e;},easeInOut:function(f,e,h,g){if((f/=g/2)<1){return h/2*f*f*f+e;}return h/2*((f-=2)*f*f+2)+e;}},Quart:{easeIn:function(f,e,h,g){return h*(f/=g)*f*f*f+e;},easeOut:function(f,e,h,g){return -h*((f=f/g-1)*f*f*f-1)+e;},easeInOut:function(f,e,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+e;}return -h/2*((f-=2)*f*f*f-2)+e;}},Quint:{easeIn:function(f,e,h,g){return h*(f/=g)*f*f*f*f+e;},easeOut:function(f,e,h,g){return h*((f=f/g-1)*f*f*f*f+1)+e;},easeInOut:function(f,e,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+e;}return h/2*((f-=2)*f*f*f*f+2)+e;}},Sine:{easeIn:function(f,e,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+e;},easeOut:function(f,e,h,g){return h*Math.sin(f/g*(Math.PI/2))+e;},easeInOut:function(f,e,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+e;}},Expo:{easeIn:function(f,e,h,g){return(f==0)?e:h*Math.pow(2,10*(f/g-1))+e;},easeOut:function(f,e,h,g){return(f==g)?e+h:h*(-Math.pow(2,-10*f/g)+1)+e;},easeInOut:function(f,e,h,g){if(f==0){return e;}if(f==g){return e+h;}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+e;}return h/2*(-Math.pow(2,-10*--f)+2)+e;}},Circ:{easeIn:function(f,e,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+e;},easeOut:function(f,e,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+e;},easeInOut:function(f,e,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+e;}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+e;}},Elastic:{easeIn:function(g,e,k,j,f,i){if(g==0){return e;}if((g/=j)==1){return e+k;}if(!i){i=j*0.3;}if(!f||f<Math.abs(k)){f=k;var h=i/4;}else{var h=i/(2*Math.PI)*Math.asin(k/f);}return -(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e;},easeOut:function(g,e,k,j,f,i){if(g==0){return e;}if((g/=j)==1){return e+k;}if(!i){i=j*0.3;}if(!f||f<Math.abs(k)){f=k;var h=i/4;}else{var h=i/(2*Math.PI)*Math.asin(k/f);}return(f*Math.pow(2,-10*g)*Math.sin((g*j-h)*(2*Math.PI)/i)+k+e);},easeInOut:function(g,e,k,j,f,i){if(g==0){return e;}if((g/=j/2)==2){return e+k;}if(!i){i=j*(0.3*1.5);}if(!f||f<Math.abs(k)){f=k;var h=i/4;}else{var h=i/(2*Math.PI)*Math.asin(k/f);}if(g<1){return -0.5*(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e;}return f*Math.pow(2,-10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i)*0.5+k+e;}},Back:{easeIn:function(f,e,i,h,g){if(g==undefined){g=1.70158;}return i*(f/=h)*f*((g+1)*f-g)+e;},easeOut:function(f,e,i,h,g){if(g==undefined){g=1.70158;}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+e;},easeInOut:function(f,e,i,h,g){if(g==undefined){g=1.70158;}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+e;}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+e;}},Bounce:{easeIn:function(f,e,h,g){return h-a.Bounce.easeOut(g-f,0,h,g)+e;},easeOut:function(f,e,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+e;}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+e;}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+e;}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+e;}}}},easeInOut:function(f,e,h,g){if(f<g/2){return a.Bounce.easeIn(f*2,0,h,g)*0.5+e;}else{return a.Bounce.easeOut(f*2-g,0,h,g)*0.5+h*0.5+e;}}}};var b=function(e,d,f,c,i,g,h){this._node=e;this._propertyName=d;this._startValue=f;this._endValue=c;this._easing=i||a.Expo.easeInOut;this._duration=g<0.01?0.01:g;this._callback=h;this._pixelDictionary=["width","height","left","top","right","bottom","padding","padding-left","padding-top","padding-bottom","padding-right","margin","margin-left","margin-top","margin-bottom","margin-right","font-size","background-position","line-height","border-width","border-left-width","border-top-width","border-right-width","border-bottom-width","color","background-color","border-color"];this._runInterval=null;this._timeLine=10;this._needPixel=false;this._isIE=/msie/i.test(navigator.userAgent);if(this._checkParams()){this._needPixel=this._getIndex(this._pixelDictionary,this._propertyName)!=-1;this._run();}};b.prototype={_checkParams:function(){var d=this._node!=null&&this._node.getAttribute!=null&&this._propertyName!=null;var c=false;if(this._propertyName.indexOf("color")!=-1){var e=/(^\s*)|(\s*$)/g;c=!!this._startValue&&this._startValue.replace(e,"")!=""&&!!this._endValue&&this._endValue.replace(e,"")!=""&&!isNaN(this._duration);}else{c=!isNaN(this._startValue)&&!isNaN(this._endValue)&&!isNaN(this._duration);}return d&&c;},_getIndex:function(c,e){for(var d=0;d<c.length;d++){if(c[d]==e){return d;}}return -1;},_getValue:function(c){return this._needPixel?c+"px":c;},_run:function(){var c=this,d=0;if(/color|background-color|border-color/i.test(this._propertyName)){this._runColor();return;}this._runInterval=window.setInterval(function(){if(!c._node){c._stop();return;}var g=Math.ceil(c._easing(d,c._startValue,c._endValue-c._startValue,c._duration*1000));if(c._propertyName=="opacity"){g=g/100;}if(c._propertyName=="scrollLeft"||c._propertyName=="scrollTop"){c._node[c._propertyName]=c._getValue(g);}else{var f={};f[c._propertyName]=c._getValue(g);c.setStyles(c._node,f);if(c._isIE&&c._propertyName=="opacity"){c._node.style.filter="Alpha(opacity="+g*100+")";}}if(d>=c._duration*1000){window.clearInterval(c._runInterval);c._runInterval=null;if(c._propertyName=="scrollLeft"||c._propertyName=="scrollTop"){c._node[c._propertyName]=c._getValue(c._endValue);}else{var e={};e[c._propertyName]=c._getValue(c._propertyName=="opacity"?c._endValue/100:c._endValue);c.setStyles(c._node,e);if(c._isIE&&c._propertyName=="opacity"){c._node.style.filter="Alpha(opacity="+c._endValue+")";}}c._callback&&c._callback();}d+=c._timeLine;},this._timeLine);},_runColor:function(){var l=this,f=0,g=this._getColor(this._startValue),k=this._getColor(this._endValue);if(!g||!k){return;}var c=g[0],h=g[1],e=g[2],d=k[0],j=k[1],i=k[2];this._runInterval=setInterval(function(){if(!l._node){l._stop();return;}var o=Math.ceil(l._easing(f,c,d-c,l._duration*1000));var n=Math.ceil(l._easing(f,h,j-h,l._duration*1000));var q=Math.ceil(l._easing(f,e,i-e,l._duration*1000));var p={};p[l._propertyName]="rgb("+o+", "+n+", "+q+")";l.setStyles(l._node,p);if(f>=l._duration*1000){window.clearInterval(l._runInterval);l._runInterval=null;var m={};m[l._propertyName]=l._endValue;l.setStyles(l._node,m);l._callback&&l._callback();}f+=l._timeLine;},this._timeLine);},_getColor:function(k){k=k.replace(/(^\s*)|(\s*$)/g,"");var h=/^\s*rgb\s*\(\s*\d{1,3}\s*\,\s*\d{1,3}\s*\,\s*\d{1,3}\s*\)\s*$/i;var f=/^\s*\#[a-zA-Z0-9]{3}\s*$/;var e=/^\s*\#[a-zA-Z0-9]{6}\s*$/;var d=[];if(h.test(k)){nStr=k.split("(")[1].split(")")[0].split(",");for(var g=0;g<nStr.length;g++){d.push(nStr[g]/1);}return d;}if(e.test(k)){var c=k.replace("#","").match(/(\w|\d){2}/g);for(var g=0;g<c.length;g++){d.push(Number("0x"+c[g]).toString(10)/1);}return d;}if(f.test(k)){var j=k.replace("#","").split("");for(var g=0;g<j.length;g++){d.push(Number("0x"+(j[g]+j[g])).toString(10)/1);}return d;}return null;},_rgbToColor:function(h,f,c){var e=h.toString(16);var d=f.toString(16);var i=f.toString(16);if(e.length<2){e="0"+e;}if(d.length<2){d="0"+d;}if(i.length<2){i="0"+i;}return"#"+e+d+i;},_stop:function(){if(this._runInterval){window.clearInterval(this._runInterval);this._runInterval=null;}this._clear();},_clear:function(){this._node=null;},stop:function(){this._stop();},setStyles:function(e,d){for(var c in d){this.setStyle(e,c,d[c]);}},setStyle:function(e,c,d){if(!e){return;}e.style[this.getCamelCase(c)]=d;},getCamelCase:function(c){if(c.indexOf("-")<0&&c.indexOf("_")<0){return c;}return c.replace(/[-_][^-_]/g,function(d){return d.charAt(1).toUpperCase();});}};return{Easing:a,Tween:b};})();
View
97 demo/core/tween/SchAIM-readme.txt
@@ -0,0 +1,97 @@
+/**
+ * @author ShiCH
+ */
+
+// SchAIM���ʹ�÷���
+var Tween = SchAIM.Tween, Easing = SchAIM.Easing;
+var HTMLElement = document.getElementById('test'),
+CssPrototye = 'width',
+StartValue = '100',
+EndValue = '400',
+EasingMethod = Easing.Bounce.easeInOut,
+Duration = .3,
+Callback = function(){
+ alert('run end');
+};
+
+/**
+ * ʵ��Tween��, �����Tween����Ч��
+ * @param {HTMLElement} HTMLElement
+ * @param {String} CssPrototye ����Ҫ�ı�ĵ���ʽ����, ��ǰ֧�ֵ���������:
+ * [
+ * 'width', 'height', 'left', 'top', 'right', 'bottom',
+ * 'padding', 'padding-left', 'padding-top', 'padding-bottom', 'padding-right',
+ * 'margin', 'margin-left', 'margin-top', 'margin-bottom', 'margin-right',
+ * 'font-size',
+ * 'background-position',
+ * 'background-color',
+ * 'line-height',
+ * 'border-width',
+ * 'border-left-width', 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-color'
+ * 'color',
+ * 'opacity',
+ * '����һЩ�����뵽�IJ��ҿ������Ը�ֵ����ʽ'
+ * ]
+ * ע: ����'opacity'ָ͸���, �����˼���, ȡֵ��ΧΪ:0~1
+ * ��color��ص�������,��'color', 'background-color', 'border-color',
+ * ��ʹ�õ���ɫ����ֵΪrgb��16���Ƶ���ɫֵ(��: 'rgb(222,202,54)��'#DECA36'),
+ * ����֧��Ӣ�ļ�Ƶ���ɫֵ(��:'red', 'pink')
+ *
+ * @param {Number / String} StartValue ����ִ�е���ʼֵ(���ı���ʽ�����а�'color'��ʱ��, EndValueΪString��, ����ΪNumber��)
+ * @param {Number / String} EndValue ����ִ�е�Ŀ��ֵ(���ı���ʽ�����а�'color'��ʱ��, EndValueΪString��, ����ΪNumber��)
+ * @param {Object} EasingMethod Ҫʹ�õĶ����㷨, Ĭ��ΪEasing.Expo.easeInOut
+ * @param {Number} Duration ����Ҫִ�е�ʱ��, ��λ��(s)
+ * @param {Function} Callback ����ִ����ɺ�Ļص��, Ĭ��Ϊnull
+ */
+var t = new Tween(HTMLElement, CssPrototye, StartValue, EndValue, EasingMethod, Duration, Callback);
+
+/**
+ * ��ʵ��Tween�������ʹ�õķ���:
+ * stop() ֹͣ��ǰ����(��ʱ���Tween���е�'_node'�����ÿ�, �Է�ֹIE6���ڴ�й©)
+ *
+ * Easing���ʹ���㷨��:
+ * 1. Easing.Linear
+ *
+ * 2. Easing.Quad.easeIn
+ * 3. Easing.Quad.easeOut
+ * 4. Easing.Quad.easeInOut
+ *
+ * 5. Easing.Cubic.easeIn
+ * 6. Easing.Cubic.easeOut
+ * 7. Easing.Cubic.easeInOut
+ *
+ * 8. Easing.Quart.easeIn
+ * 9. Easing.Quart.easeOut
+ * 10. Easing.Quart.easeInOut
+ *
+ * 11. Easing.Quint.easeIn
+ * 12. Easing.Quint.easeOut
+ * 13. Easing.Quint.easeInOut
+ *
+ * 14. Easing.Sine.easeIn
+ * 15. Easing.Sine.easeOut
+ * 16. Easing.Sine.easeInOut
+ *
+ * 17. Easing.Expo.easeIn
+ * 18. Easing.Expo.easeOut
+ * 19. Easing.Expo.easeInOut
+ *
+ * 20. Easing.Circ.easeIn
+ * 21. Easing.Circ.easeOut
+ * 22. Easing.Circ.easeInOut
+ *
+ * 23. Easing.Elastic.easeIn
+ * 24. Easing.Elastic.easeOut
+ * 25. Easing.Elastic.easeInOut
+ *
+ * 26. Easing.Back.easeIn
+ * 27. Easing.Back.easeOut
+ * 28. Easing.Back.easeInOut
+ *
+ * 29. Easing.Bounce.easeIn
+ * 30. Easing.Bounce.easeOut
+ * 31. Easing.Bounce.easeInOut
+ *
+ * �����㷨��Ӧ�Ķ���Ч�������г���
+ */
+
View
107 demo/core/tween/tween.htm
@@ -4,11 +4,13 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>测试Tween类</title>
- <script type="text/javascript" src="../ace.all.js"></script>
+ <script type="text/javascript" src="http://img.baidu.com/js/tangram-1.3.6.js"></script>
+ <script type="text/javascript" src="SchAIM-mini.js"></script>
<style>
body {
font:400 12px/20px 宋体;
- background-image:url(SCBJ_030001.jpg);
+ /*background-image:url(SCBJ_030001.jpg);*/
+ background-color:#F9F9F9;
overflow:hidden;
}
</style>
@@ -27,28 +29,45 @@
<img src="icon.gif" />
</div>
<div style="position:absolute;left:100px;bottom:10px;">
- <input type="button" value="移动至(700,200)" onclick='moveTo(700, 200)'>
- <input type="button" value="移动至(100,100)" onclick='moveTo(10, 10)'>
+ <input type="button" value="随机移动" onclick='moveTo()'>
<input type="button" value="果冻效果(300)" onclick='jellyEffect()'>
<input type="button" value="掉落效果" onclick='drop()'>
<input type="button" value="透明一下" onclick='opacity()'>
<input type="button" value="Bling Icon" onclick='bling()'>
<input type="button" value="Fly Icon" onclick='iconFly()'>
+ <input type="button" value="背景颜色随机渐变" onclick='iconColor()'>
</div>
</body>
<script>
- var Easing = ace.ui.Easing, Tween = ace.ui.Tween;
- function moveTo(x, y){
- var d = new Date().valueOf();
- var elm = ace.g('tweenBlcok'), pos = ace.dom.getPosition(elm);
- new Tween(elm, 'left', pos.left, x, Easing.Bounce.easeIn, 1);
- new Tween(elm, 'top', pos.top, y, Easing.Bounce.easeIn, 1);
+ var baidu = baidu || T;
+ var Easing = SchAIM.Easing, Tween = SchAIM.Tween;
+ var mainBlcok = document.getElementById('tweenBlcok'), adBlock = document.getElementById('testIconBlock'),
+ mainMoveTween, mainMoveTween2, alphaTween, flyTween, flyTween2;
+ function moveTo(){
+ if(mainMoveTween){
+ mainMoveTween.stop();
+ }
+ if(mainMoveTween2){
+ mainMoveTween2.stop();
+ }
+ var pos = baidu.dom.getPosition(mainBlcok);
+ var w = mainBlcok.clientWidth, h = mainBlcok.clientHeight, toX = Math.ceil(getRandom(0, baidu.page.getWidth() - w)),
+ toY = Math.ceil(getRandom(0, baidu.page.getHeight() - h));
+ mainMoveTween = new Tween(mainBlcok, 'left', pos.left, toX, Easing.Bounce.easeIn, .8);
+ mainMoveTween2 = new Tween(mainBlcok, 'top', pos.top, toY, Easing.Bounce.easeIn, .8);
}
function jellyEffect(){
+ if(mainMoveTween){
+ mainMoveTween.stop();
+ }
+ if(mainMoveTween2){
+ mainMoveTween2.stop();
+ }
var runTime = .4, margin = 80, effect = Easing.Bounce.easeOut;
- var elm = ace.g('tweenBlcok'), pos = ace.dom.getPosition(elm), w = elm.clientWidth, h = elm.clientHeight;
+ var elm = document.getElementById('tweenBlcok'), pos = baidu.dom.getPosition(elm), w = elm.clientWidth, h = elm.clientHeight;
+
new Tween(elm, 'width', w, w - margin, effect, runTime, function(){
new Tween(elm, 'width', w - margin, w, effect, runTime);
});
@@ -56,27 +75,35 @@
new Tween(elm, 'height', h - margin, h, effect, runTime);
});
- new Tween(elm, 'left', pos.left, pos.left + margin/2, effect, runTime, function(){
- new Tween(elm, 'left', pos.left + margin/2, pos.left, effect, runTime);
+ mainMoveTween = new Tween(elm, 'left', pos.left, pos.left + margin/2, effect, runTime, function(){
+ mainMoveTween = new Tween(elm, 'left', pos.left + margin/2, pos.left, effect, runTime);
});
- new Tween(elm, 'top', pos.top, pos.top + margin/2, effect, runTime, function(){
- new Tween(elm, 'top', pos.top + margin/2, pos.top, effect, runTime);
+ mainMoveTween2 = new Tween(elm, 'top', pos.top, pos.top + margin/2, effect, runTime, function(){
+ mainMoveTween2 = new Tween(elm, 'top', pos.top + margin/2, pos.top, effect, runTime);
});
}
function drop(){
- var runTime = 1, margin = 80, effect = Easing.Bounce.easeOut;
- var elm = ace.g('tweenBlcok'), pos = ace.dom.getPosition(elm), h = elm.clientHeight;
- new Tween(elm, 'top', pos.top, ace.page.getHeight() - h - 50, effect, runTime, function(){
- //new Tween(elm, 'top', ace.page.getHeight() - h - 50, pos.top, effect, runTime);
+ var runTime = .4, margin = 80, effect = Easing.Bounce.easeOut;
+ var elm = document.getElementById('tweenBlcok'), pos = baidu.dom.getPosition(elm), h = elm.clientHeight;
+ if(mainMoveTween){
+ mainMoveTween.stop();
+ }
+ if(mainMoveTween2){
+ mainMoveTween2.stop();
+ }
+ mainMoveTween = new Tween(elm, 'top', pos.top, baidu.page.getHeight() - h - 50, effect, runTime, function(){
+ //new Tween(elm, 'top', baidu.page.getHeight() - h - 50, pos.top, effect, runTime);
});
}
function opacity(){
var runTime = .5, margin = 80, effect = Easing.Linear;
- var elm = ace.g('tweenBlcok');
- new Tween(elm, 'opacity', 100, 50, effect, runTime, function(){
- new Tween(elm, 'opacity', 50, 100, effect, runTime);
+ if(alphaTween){
+ alphaTween.stop();
+ }
+ alphaTween = new Tween(mainBlcok, 'opacity', 100, 50, effect, runTime, function(){
+ alphaTween = new Tween(mainBlcok, 'opacity', 50, 100, effect, runTime);
});
}
@@ -85,7 +112,7 @@
if(!blingEnd){
return;
}
- var box = ace.g('testIconBlock'), icon = box.getElementsByTagName('img')[0];
+ var box = document.getElementById('testIconBlock'), icon = box.getElementsByTagName('img')[0];
var w = icon.clientWidth, h = icon.clientHeight;
var effect = Easing.Linear, margin = 50, runTime = .3;
new Tween(icon, 'width', w, w - margin, effect, runTime, function(){
@@ -117,14 +144,20 @@
}
function iconFly(){
- var box = ace.g('testIconBlock'), pos = ace.dom.getPosition(box), w = box.clientWidth, h = box.clientHeight;
+ if(flyTween){
+ flyTween.stop();
+ }
+ if(flyTween2){
+ flyTween2.stop();
+ }
+ var box = document.getElementById('testIconBlock'), pos = baidu.dom.getPosition(box), w = box.clientWidth, h = box.clientHeight;
var runTime = .8, effect = Easing.Expo.easeInOut;
- var toX = Math.ceil(getRandom(0, ace.page.getWidth() - w)),
- toY = Math.ceil(getRandom(0, ace.page.getHeight() - h));
- new Tween(box, 'left', pos.left, toX, effect, runTime, function(){
+ var toX = Math.ceil(getRandom(0, baidu.page.getWidth() - w)),
+ toY = Math.ceil(getRandom(0, baidu.page.getHeight() - h));
+ flyTween = new Tween(box, 'left', pos.left, toX, effect, runTime, function(){
checkFlyOk({x:'ok'});
});
- new Tween(box, 'top', pos.top, toY, effect, runTime, function(){
+ flyTween2 = new Tween(box, 'top', pos.top, toY, effect, runTime, function(){
checkFlyOk({y:'ok'});
});
}
@@ -145,6 +178,24 @@
function getRandom(a, b){
return a + Math.random() * b;
}
+
+
+
+ var bgColor = '#F9F9F9', colorTween;
+ function iconColor(){
+ var block = document.body;//document.getElementById('tweenBlcok');
+ if(colorTween){
+ colorTween.stop();
+ }
+ var newColor = 'rgb(' + Math.ceil(getRandom (0, 255)) + ',' + Math.ceil(getRandom (0, 255)) + ',' + Math.ceil(getRandom (0, 255)) + ')';
+ colorTween = new Tween(block, 'background-color', bgColor, newColor, Easing.Linear, 1, function(){
+ bgColor = newColor;
+
+ setTimeout(function(){
+ iconColor();
+ }, 1000);
+ });
+ }
</script>
</html>
View
43 demo/data/tree.xml
@@ -3,21 +3,34 @@
<Data>
<Tree>
<TreeNode id="1" name="控件列表">
- <!--<TreeNode id="3" name="BoxLayer" src="core/boxLayer/Example.htm"></TreeNode>-->
- <TreeNode id="4" name="Calendar" src="core/Calendar/Example.htm"></TreeNode>
- <TreeNode id="6" name="CommonSelect" src="core/commonSelect/Example.htm"></TreeNode>
- <TreeNode id="7" name="DragLayer" src="core/dragLayer/Example.htm"></TreeNode>
- <TreeNode id="9" name="FlashLine" src="core/Line/Example.htm"></TreeNode>
- <TreeNode id="10" name="FlashMeter" src="core/Meter/Example.htm"></TreeNode>
- <TreeNode id="11" name="ScrollTab" src="core/ScrollTab/Example.htm"></TreeNode>
- <TreeNode id="12" name="SiderBar" src="core/SiderBar/Example.htm"></TreeNode>
- <TreeNode id="13" name="SimpleGrid" src="core/SimpleGrid/Example.htm"></TreeNode>
- <TreeNode id="14" name="SimpleTree" src="core/SimpleTree/Example.htm"></TreeNode>
- <TreeNode id="16" name="VerticalTree" src="core/VerticalTree/Example.htm"></TreeNode>
- <TreeNode id="15" name="SliderPicShow" src="core/SliderPicShow/Example.htm"></TreeNode>
- <TreeNode id="8" name="ImitateFlashMenu" src="core/imitateFlashMenu/Example.htm"></TreeNode>
- <TreeNode id="5" name="Clock" src="core/clock/Example.htm"></TreeNode>
- </TreeNode>
+ <!--<TreeNode id="3" name="BoxLayer" src="core/boxLayer/Example.htm"></TreeNode>-->
+ <TreeNode id="4" name="Calendar" src="core/Calendar/Example.htm"></TreeNode>
+ <TreeNode id="6" name="CommonSelect" src="core/commonSelect/Example.htm"></TreeNode>
+ <TreeNode id="7" name="DragLayer" src="core/dragLayer/Example.htm"></TreeNode>
+ <TreeNode id="19" name="DragLayer2" src="core/dragLayer2/resizePic.html"></TreeNode>
+ <TreeNode id="9" name="FlashLine" src="core/Line/Example.htm"></TreeNode>
+ <TreeNode id="10" name="FlashMeter" src="core/Meter/Example.htm"></TreeNode>
+ <TreeNode id="21" name="FlashCpu" src="core/Cpu/cpu.htm"></TreeNode>
+ <TreeNode id="20" name="FlashCpu2" src="core/cpuNode/cpu.htm"></TreeNode>
+ <TreeNode id="11" name="ScrollTab" src="core/ScrollTab/Example.htm"></TreeNode>
+ <TreeNode id="12" name="SiderBar" src="core/SiderBar/Example.htm"></TreeNode>
+ <TreeNode id="13" name="SimpleGrid" src="core/SimpleGrid/Example.htm"></TreeNode>
+ <TreeNode id="22" name="GridTree" src="core/GridTree/Example.htm"></TreeNode>
+ <TreeNode id="14" name="SimpleTree" src="core/SimpleTree/Example.htm"></TreeNode>
+ <TreeNode id="16" name="VerticalTree" src="core/VerticalTree/Example.htm"></TreeNode>
+ <TreeNode id="15" name="SliderPicShow" src="core/SliderPicShow/Example.htm"></TreeNode>
+ <TreeNode id="8" name="ImitateFlashMenu" src="core/imitateFlashMenu/Example.htm"></TreeNode>
+ <TreeNode id="18" name="ImitateFlashMenu2" src="core/flashMenu2/duoziPen.htm"></TreeNode>
+ <TreeNode id="17" name="TansferPic" src="core/flashNews/Example.htm"></TreeNode>
+ <TreeNode id="5" name="Clock" src="core/clock/Example.htm"></TreeNode>
+ <TreeNode id="23" name="Flip Ex." src="core/flip/flip.htm"></TreeNode>
+ <TreeNode id="24" name="Player" src="core/player/SoundDeal.html"></TreeNode>
+ <TreeNode id="25" name="Sina WebIM" src="core/webim/call.html"></TreeNode>
+ <TreeNode id="28" name="ChromeDrag" src="core/drag_chrome/testDrop.htm"></TreeNode>
+ <TreeNode id="29" name="Tween" src="core/tween/tween.htm"></TreeNode>
+ <TreeNode id="30" name="ScrollPane" src="core/scrollpane/scrollpane_boss.htm"></TreeNode>
+ <TreeNode id="31" name="LED effect" src="core/led/example.htm"></TreeNode>
+ </TreeNode>
</Tree>
</Data>
</Response>
View
4 demo/index.js
@@ -23,8 +23,8 @@
function loadTree(){
var p = new ajax();
- //p.url = "data/tree.xml";
- p.url = "service/index.asp";
+ p.url = "data/tree.xml";
+ //p.url = "service/index.asp";
p.onresult = function(){
var data = this.text;
buildTree(data);
Please sign in to comment.
Something went wrong with that request. Please try again.