-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught TypeError: Cannot read property 'call' of undefined #54
Comments
This usually happens when it is instantiated more than once. I suggest
putting a debugger or console log right before using fixto and observing.
…On Wed 24. Jan 2018 at 19:31, PJ Laudun ***@***.***> wrote:
Hi, I love your solution and the results have been great, But I keep
having this error when I load my page:
fixto.min.js:3 Uncaught TypeError: Cannot read property 'call' of undefined
at HTMLDivElement. (fixto.min.js:3)
at Function.each (Sitecore.Foundation.Frameworks.js:1769)
at i.fn.init.each (Sitecore.Foundation.Frameworks.js:1536)
at i.fn.init.e.fn.fixTo (fixto.min.js:3)
at HTMLDocument. (Jays-Moment:1063)
at c (Sitecore.Foundation.Frameworks.js:4590)
at Object.fireWith [as resolveWith]
(Sitecore.Foundation.Frameworks.js:4721)
at Function.ready (Sitecore.Foundation.Frameworks.js:4935)
at HTMLDocument.yt (Sitecore.Foundation.Frameworks.js:4958)
When I click on the link to see the issues, it keeps going back to:
`// Let it be a jQuery Plugin
$.fn.fixTo = function (targetSelector, options) {
var $targets = $(targetSelector);
var i = 0;
return this.each(function () {
// Check the data of the element.
var instance = $(this).data('fixto-instance');
// If the element is not bound to an instance, create the instance and save it to elements data.
if (!instance) {
$(this).data('fixto-instance', fixTo(this, $targets[i], options));
}
else {
// If we already have the instance here, expect that targetSelector parameter will be a string
// equal to a public methods name. Run the method on the instance without checking if
// it exists or it is a public method or not. Cause nasty errors when necessary.
var method = targetSelector;
instance[method].call(instance, options);
}
i++;
});
};`
With the main issue being this line:
instance[method].call(instance, options);
Could I get some help on possibly fixing this? I am trying to have a
scrolling click event for my buttons, but I am thinking that this error
might completely scratch out any other JS code in my file.
Thanks again.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#54>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABtwNBpnUEaswNM27jamheEHETeRrI45ks5tN3ccgaJpZM4RrtzG>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I love your solution and the results have been great, But I keep having this error when I load my page:
When I click on the link to see the issues, it keeps going back to:
`// Let it be a jQuery Plugin
$.fn.fixTo = function (targetSelector, options) {
With the main issue being this line:
instance[method].call(instance, options);
Could I get some help on possibly fixing this? I am trying to have a scrolling click event for my buttons, but I am thinking that this error might completely scratch out any other JS code in my file.
Thanks again.
The text was updated successfully, but these errors were encountered: