Skip to content
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

Cannot read property 'x' of undefined #62

Open
sajjadazar opened this issue Jul 15, 2019 · 5 comments
Open

Cannot read property 'x' of undefined #62

sajjadazar opened this issue Jul 15, 2019 · 5 comments

Comments

@sajjadazar
Copy link

hello
i'm developing a wordpress theme and when i want to use the jquery.magnify.js, it'll give me this error :
Cannot read property 'x' of undefined...
and i'm using jquery like this :
jQuery(document).ready(function () {
jQuery('img').magnify();
}

so can you help me ?
thanks a lot

@chrilleferna
Copy link

chrilleferna commented Aug 26, 2019

I had the same problem. With that is the error message in Chrome and in Safari the message is TypeError: undefined is not an object (evaluating '$image.data('lastPos').x'). Triggered at line 94

The problem seems to be that I used a slim version of jQuery. When swicthing to the full version things work as they should

@sophanox
Copy link

sophanox commented Feb 27, 2020

Replace lines 95 and 96 in the the magnify.js source with:

nPosX = $image.offset().left; nPosY = $image.offset().top;

@sanjay-makwana-avidbrio
Copy link

sanjay-makwana-avidbrio commented Sep 9, 2021

@sophanox thanks for a solution but there is no issue all working fine

@LibbyJane
Copy link

I was still getting the issue, thanks for the fix @sophanox

@sanjay-makwana-avidbrio

@LibbyJane what error are you getting ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants