你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
q1402907210 - 你猜猜
赞同来自:
wudi199553
要回复问题请先登录
你猜猜
3 个回复
q1402907210 - 你猜猜
赞同来自:
wudi199553
赞同来自:
wudi199553
赞同来自:
private var _itemHeight:Number;
private var _oldY:Number;
private function onMuseHandler(type:Event,index:int):void
{
trace("type:" + type.type + "ddd--" + _list.scrollBar.value + "---index:" + index);
var curX:Number,curY:Number;
if(type.type== "mousedown")
{
_oldY = Laya.stage.mouseY;
var itemBox:Box = _list.getCell(index);
_itemHeight = itemBox.height;
}else if(type.type == "mouseout")
{
curY = Laya.stage.mouseY;
var chazhiY:Number = Math.abs(curY - _oldY);
var tempIndex:int = Math.ceil(chazhiY/_itemHeight);
trace("----------tempIndex:" + tempIndex + "---_itemHeight:" + _itemHeight + "---chazhiY:" + chazhiY);
var newIndex:int;
if(curY > _oldY)
{
//向下
newIndex = index + tempIndex;
_list.tweenTo(newIndex);
}else
{
//向上
newIndex = index - tempIndex;
_list.tweenTo(newIndex);
}
}
}