如何在滚动手风琴分区上进行操作
How to make action on scrolling accordion div
我有一个手风琴菜单。我想对滚动到手风琴项目内容的末尾进行操作。我想做
$("#Akordeon1Content").scroll(function() {
if($("#Akordeon1Content").scrollTop() === $("#AkordeonContainer").height() - $("#Akordeon1Content").height()) {
alert("dsadas");
}
}
但它不起作用。有人知道怎么做吗?
设置一个新参数:
animate(lastTick, timeLeft, closingId, openingId, callback)
在清除动画中的超时时添加此功能:
callback();
不要忘记将您的函数传递到animate函数中:
animate(new Date().getTime(),TimeToSlide,Akordeon_otw,nID, function( ){[...]});
不要忘记将回调传递到下一个动画:
setTimeout("animate(" + curTick + "," + timeLeft + ",'" + closingId + "','" + openingId + "', " + callback + ")", 33);}
function otworz(index)
{
var nID = "Akordeon" + index + "Content";
var nazwa = nID;
if(Akordeon_otw === nID)
nID = '';
animate(new Date().getTime(),TimeToSlide,Akordeon_otw,nID);
Akordeon_otw = nID;
}
function animate(lastTick, timeLeft, closingId, openingId)
{
var curTick = new Date().getTime();
var elapsedTicks = curTick - lastTick;
var opening = (openingId === '') ? null : document.getElementById(openingId);
var closing = (closingId === '') ? null : document.getElementById(closingId);
if(timeLeft <= elapsedTicks)
{
if(opening !== null)
opening.style.height = ContentHeight + 'px';
if(closing !== null)
{
closing.style.display = 'none';
closing.style.height = '0px';
}
return;
}
timeLeft -= elapsedTicks;
var newClosedHeight = Math.round((timeLeft/TimeToSlide) * ContentHeight);
if(opening !== null)
{
if(opening.style.display !== 'block')
opening.style.display = 'block';
opening.style.height = (ContentHeight - newClosedHeight) + 'px';
}
if(closing !== null)
closing.style.height = newClosedHeight + 'px';
setTimeout("animate(" + curTick + "," + timeLeft + ",'"
+ closingId + "','" + openingId + "')", 33);
}
相关文章:
- 内部分区字体大小获胜'调整浏览器窗口大小时不会随媒体查询而更改
- 如何使jQuery插件函数可调用以供独立使用,而不在集合上操作
- Jquery菜单操作不稳定,定位不正确,存在一般错误
- 设置滑块分区上的滚动
- 如何确定javascript已经完成了某些操作.ios上的
- 单击按钮后如何逐个调用分区,上一个分区将隐藏
- 防止Alt+Shift默认操作或检测多种操作系统语言的Javascript
- 从JavaScript访问struts操作中的属性
- fluxxor向一个flux实例添加一组以上的操作
- Jquery表单验证插件-如果选中复选框,如何在提交时执行某些操作
- 操作放置在画布上的元素之间的连接
- 使用“+="操作人员
- JQuery移动动态分区页面
- Rails操作只调用一次,但我在ajax中每秒钟都调用一次
- Jquery未定义函数正在停止其他操作
- 如何操作iframe之外的元素
- 多维数据集网格未在指定的分区中绘制
- javascript对象操作:根据指定条件选择属性
- 如何在用户到达iframe分区末尾时显示操作按钮
- 如何在滚动手风琴分区上进行操作