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

An error in the function set titleSrc #203

Closed
makito opened this issue Sep 5, 2013 · 6 comments
Closed

An error in the function set titleSrc #203

makito opened this issue Sep 5, 2013 · 6 comments

Comments

@makito
Copy link

makito commented Sep 5, 2013

From the function you can refer to the element title links via item.el.attr ('title'), but if I link dynamically loadable, and then apply them to the plugin, when you call the popups an error occurs, as item.el is undefined.
Moreover, if there were links on the page on which the plugin has been activated, and they regularly raised popap, after hanging the plug on the loaded dynamically links, and those links are beginning to produce an error.

@dimsemenov
Copy link
Owner

I'm not sure if I understand the issue, please don't use Google Translate if you wish to get help.

@makito
Copy link
Author

makito commented Sep 6, 2013

Sorry, I'll try.
If you dynamically load new data on the page and activate the plugin on them, the function titleSrc when accessing item.el returns undefined.
If the page at that time there were elements of the plugin, they also begin to generate an error.

@dimsemenov
Copy link
Owner

Weird, there shouldn't be any difference, code that gets title is pretty straightforward https://github.com/dimsemenov/Magnific-Popup/blob/master/src/js/image.js#L2 , please link to page with issue or provide isolated example on CodePen.

@makito
Copy link
Author

makito commented Sep 23, 2013

Ok. I made ​​an example on CodePen. http://codepen.io/anon/pen/EaLzx

@dimsemenov
Copy link
Owner

Thank you. The argument that you pass to popup is already its instance, so you should make it different for each set of images. I've edited your example, see - http://codepen.io/anon/pen/fkcDG

@makito
Copy link
Author

makito commented Sep 23, 2013

A non-trivial realization of a simple problem :) Thank you.
Perhaps the plugin should solve this problem on their own?

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

2 participants