Reputation: 721
I have written one custom paremeterized jquery function for fadein and fade out. That function works fine in IE but not in firefox. The function is :
jQuery.fn.dcFadeIn = function(newDiv) {
var openDiv = newDiv;
return $(openDiv).fadeIn();
};
<input type="radio" name="doc3" value="independentCall" class="radioButton" id="indMetaCalls1" onClick="jQuery.fn.dcFadeIn(indCallDetailsDoc1);" />
Upvotes: 0
Views: 494
Reputation: 700442
You are refereing to an element as if it is a member of the windows object. Only IE puts elements in the windows object, so that doesn't work in any other browser.
Use the JQuery object to get a reference to the element:
onClick="jQuery.fn.dcFadeIn($('#indCallDetailsDoc1'));"
Upvotes: 4
Reputation: 29985
What is "indCallDetailsDoc1" and why do you call functions using jQuery.fn.dcFadeIn()? You cannot call plugin functions like this.
Please consider reading this page to learn write jQuery plugins: http://docs.jquery.com/Plugins/Authoring
Upvotes: 0
Reputation: 21727
Try Changeing:
onClick="jQuery.fn.dcFadeIn(indCallDetailsDoc1);"
to:
onClick="jQuery.fn.dcFadeIn(this);"
Upvotes: 0
Reputation: 4460
Do you have javascript enabled in FireFox?
If so, can you show the markup for 'indCallDetailsDoc1'?
Also, why don't you use 'newDiv' directly, instead of copying it into 'openDiv' first?
Upvotes: 1