Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
in the current beta version of iipMooViewer 2, what is the best way of
switching the displayed image within the same Viewer?
I tried calling initialize() with the new image set in the options, but events
such as the rotation(and other things) are added again too. So for n image
changes the rotate event will be called n times when it is triggered. Also
there probably is no need to initialize the whole thing again anyways.
You seem to have CSS turned off.
Please don't fill out this field.
It depends what you are trying to do. Are you looking to blend between images?
Or do you simply want to update the viewer with a single new image? If so, the
viewer is not really designed to handle this. If your new images are the same
size, it'll work by simply changing the variable iip.images.src to point to
your new image.
I need to update the viewer with a new single image.
What I've done is mucked about in the viewer and implemented a swapImage()
function that clears the canvas, switches images and then calls a new
recreateWindows() function which is pretty much a striped down version of
createwindows() without any new eventhandlers added. recreateWindows also
destroys the navcontainer before it adds a new one. It's not perfect, but it
does the job and it'll do for now :-)
I'll try to include an easier way to switch between images in the full release
of IIPMooViewer 2
Hello Ruven, thank you very much for the beautiful software.
I'm interested in this feature too.
Are there any news or should I stick to the initialize() way? Am I missing any new functionality?
I'm running iipmooviewer 2.0 beta at the moment, I've got it from the august 26th 2011 blog post. I suppose it's the latest release, please correct me if I'm wrong.
Thanks in advance for helping.
In the latest github version, there is now a changeImage() function, which allows you to pass in a new image path and load the image without reloading the page or iframe:
Thanks! I'll give it a try!
I don't understand the problem. For showing a new image, is this not as simple
as reloading the DIV or IFRAME which contains the viewer, changing the image
parameter each time?
That's a simple way of doing it, but not the most efficient scince we're
loading the entire thing again even though everything is already there. Also
as i mentioned originally I had problems with functions that are attatched to
keydown events sticking around on those events.