Embeding Seadragon player in a hidden DIV breaks the DeepZoom image.
Hi,
My Seadragon deepzoom has stopped working since I've put the DIV container into another DIV. I don't get any errors but the player remains black.
<mydiv class="overlay">
<mydiv>
</mydiv>
</mydiv>
I believe the issue is related to the fact that the "overlay" DIV is initially hidden (display:none).
Then when the user click on a button, the DIV is shown but the seadragon player remains black.
If I set the "overlay" DIV to visible right from the beginning, then the deepzoom image is loaded just fine.
Can someone help ? Do I need to change something or is this a bug in the player?
Thanks
My Seadragon deepzoom has stopped working since I've put the DIV container into another DIV. I don't get any errors but the player remains black.
<mydiv class="overlay">
<mydiv>
</mydiv>
</mydiv>
I believe the issue is related to the fact that the "overlay" DIV is initially hidden (display:none).
Then when the user click on a button, the DIV is shown but the seadragon player remains black.
If I set the "overlay" DIV to visible right from the beginning, then the deepzoom image is loaded just fine.
Can someone help ? Do I need to change something or is this a bug in the player?
Thanks
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
-
Inappropriate?Does the 'home' button in the Seadragon viewer function after the viewer div is visible?
-
Inappropriate?Hey graphicsxp,
This is a known issue on our side.
What happens is that we need to know the viewer's size from frame to frame (in order to do viewport math), so when the viewport becomes 0 width or 0 height, it's undefined mathematically how to transition from that when the viewport gains size again.
We could in theory work around it inside our Seadragon Ajax code by maybe faking a minimum 1px width/height, or maybe instead pretending the viewport size didn't change from the previous frame, but we never added such a safeguard. Your situation is totally reasonable though, so we'll try to fix this in a future version.
I'm interested in your answer to Nathanael's question. Regardless of whether pressing home works or not, calling viewer.viewport.goHome(true) very well might. That "true" parameter says "go home immediately, don't worry about transitioning", which means it might not be affected by the undefined state from earlier.
To add on, it might be smarter depending on your app to save the viewport bounds when you hide a viewer, via var bounds = viewer.viewport.getBounds(), than call viewer.viewport.fitBounds(bounds, true) when you decide to show it again. That way, the viewport won't be reset to home if the user had zoomed in a bunch. This is just polish though.
If these workarounds don't work, let me know and I'll suggest a hackier workaround. Apologies for the trouble! -
Inappropriate?Hi guys,
Thanks for helping !
Once my DIV is displayed, if I click on home nothing happens. However, if I click a second time on home, then the image gets displayed. So I need to click twice...
If I add viewer.viewport.goHome(true) to my code, then I only need to click once on home in order to see the image. Unfortunately adding this bit of code twice does not show the image as we could have expected at first.....
Aseem, thanks for the suggestion, I might try that once I've fixed this problem. One at a time :)
What is your 'hackier' workaround since this one didn't work ? -
Inappropriate?So sorry for the delay. Just been insanely busy.
Another idea before delving into the truly hacky CSS stuff: try calling viewer.viewport.update() right after viewer.viewport.goHome(true). And maybe after that, add another goHome(true) call.
Sorry again for the delay -- hope this still helps! -
Inappropriate?Hi Aseem,
No problem :) Well, I ended up changing my UI approach and I'm not using a popup div anymore (this has nothing to do with the fact that I had issues with the player in this scenario), Obviously it works like a charm without the popup :)
Hopefully the issue will be resolved by the day I need to take this approach again !
thanks a lot.
-
Inappropriate?Cool, I'm glad -- at least I wasn't blocking your progress. Btw, if you have something to share, we'd love to see it! Good luck regardless. =)
-
Inappropriate?i have a cool art sharing website coming up soon, i'll post here when it's up and running then :)
Loading Profile...




EMPLOYEE