开发者

Prototype setting styles on an element

Within my prototype class, I have a function called loginSuccess. With in this func开发者_如何学Gotion I have this bit of code $$('#cartov .overlay-login-display').setStyle({display: 'none'});

What I expected this to do was to hide the div. However, I get this exception: Exception : TypeError: $$("#cartov .overlay-login-display").setStyle is not a function

From everything that I have researched, this is the correct syntax. So I am not sure what I am doing wrong. Any help with this is greatly appreciated.


You need to use each()

$$('#cartov .overlay-login-display').each(function(ele) {
  ele.setStyle({display: 'none'})
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜