admin管理员组文章数量:1333451
Within my prototype class, I have a function called loginSuccess. With in this function 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.
Within my prototype class, I have a function called loginSuccess. With in this function 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.
Share Improve this question edited Jun 13, 2011 at 23:37 David Tang 93.7k32 gold badges168 silver badges149 bronze badges asked Jun 13, 2011 at 17:31 rottmanjrottmanj 5311 gold badge9 silver badges21 bronze badges1 Answer
Reset to default 9You need to use each()
$$('#cartov .overlay-login-display').each(function(ele) {
ele.setStyle({display: 'none'})
});
本文标签: javascriptPrototype setting styles on an elementStack Overflow
版权声明:本文标题:javascript - Prototype setting styles on an element - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742353503a2458956.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论