在JS中创建动态变量和函数
||
我是JS的新手,但对AS2(Flash)熟悉。在Flash中,我可以将变量放入动画片段(对象)中,并尝试通过下拉菜单执行类似的操作:
http://tamalecreative.com.au/korban/scripts/dropdown.js
特别:
function dropOpen() {
dropClose(this)
this.overTrue = true;
console.log(this.overTrue);
myNum = 0;
this.liLength = ($(this).find(\'ul\').children().length)+1;
for (i=0;i<=this.liLength;i++) {
this.animateTimer = window.setTimeout(animateIn, (80 * i), this);
}
};
我的问题是使用\'this.overTrue \'布尔变量。它似乎可以在除IE之外的所有内容中使用。我收到错误消息“ \ overTrue \”不存在。自从我从未声明过哪种方法对我来说有意义。我有办法在\'this \'内声明var \'overTrue \'吗?还是我要以完全错误的方式来解决这个问题?
提前致谢
没有找到相关结果
已邀请:
1 个回复
艰管垮淮
在每个“理智”的浏览器中,
签名如下:
但是在IE中,签名略有不同:
Bravo IE。你使我再惊讶一次