Hi,
You need to extend your elements like so:
if ($(this).hasClassName('current'))...
More about this here: http://prototypejs.org/learn/extensions
Best,
Tobie
anathema wrote:
> I have a function that fails in IE6 & 7 but works in Firefox Safari
> (Mac) and Firefox for PC.
> Of course is non-sense and offers no help. It is 'Object doesn't
> support this property or method'. I installed Debugbar on IE7 and it
> reports 'syntax error'?
>
> Here is the function. The third line (if statement) produces the
> error. The function excepts the variables col2 and col3 which are
> url's. The old content fades out, new content is grabbed from the url
> and faded in. The link is not followed. However, in IE the link is
> followed to the actually url instead of performing the ajax update.
>
> I can provide a link if necessary, i just there might be something
> blaring here that i am missing. my JS skills are not the best.
>
>
>
> function getContent(col2, col3) {
>
> element.onclick = function(){
>
> if (this.hasClassName('current')) {
>
> return false;
>
> }
>
> else {
>
> new Effect.Opacity('content', { duration: 2,
> to: 0, afterFinish:
> function() {
>
> new Ajax.Updater('content', col3, {
>
> method:'get',
>
> onComplete:function(){
>
> getColHeight();
> new
> Effect.Opacity('content', { duration: 2, to: 1 });
>
>
>
> }
>
> });
>
>
> }});
>
> new Effect.Opacity('container', { duration: 2,
> to: 0, afterFinish:
> function() {
>
> new Ajax.Updater('container', col2, {
>
> method:'get',
>
> onComplete:function(){
>
> getColHeight();
> new
> Effect.Opacity('container', { duration: 2, to: 1 });
>
>
> }
>
> });
>
>
>
> }});
>
>
>
> removeClassCurrent();
> this.toggleClassName('current');
> return false;
> };
> }
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---