-
Notifications
You must be signed in to change notification settings - Fork 459
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
multiple images #1
Comments
@muszek I have been working on something to use multiple images as well. My solution is to put the images into an array and then pull the index of the image and pass its source to the function when the thumbnail/image is clicked. |
I've come up with a work around for multiple images, basically cycle through each a tag, grab it's href for the large image then initialize the plugin like so:
|
Another way which works well is to wrap the main return in a method on an object. // vars moved up to here
var methods = {
init: function(options){
return this.each(function () {
// rest of the code, drop the var though, but keep the variable assigning
methods.url(settings.url);
});
},
url: function(image_url){
// img.onload function
img.src = image_url
}
}; You can then change the image url externally from the plugin $('#my_zoom').zoom('url', 'new/url/to/image.ext') Would need a bit more changing of the img.onload function as it currently will append the new image each time, but the idea behind it all works nicely |
Does this help anyone? I've created a pull request ( #55 ) that stops the appending of a new image if the plugin is called again. This way you can just pass the new url to the zoom plugin when you want to switch the image.
|
It would be nice if we could have multiple images, like @ http://www.magictoolbox.com/magiczoom/integration/#multiple
The text was updated successfully, but these errors were encountered: