mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.27k stars 723 forks source link

Can I disable the loading bar #511

Closed peterycyeh closed 6 years ago

peterycyeh commented 6 years ago

I have multi panorama in a div which has id="panorama" And I set the view will be changed when I clicked a button as following function. However, it will show the loading bar every time when I click the button. Does it possible to disable the loading bar, or any other trick to hide it. (load each view at initially and show the selected view which is loaded when button clicked.) Thank you for your help, and the wonderful plugin.

setPanorama(index) {
    this.viewer = pannellum.viewer('panorama', {
    type: 'equirectangular',
    panorama: this.levels[index].image,
    autoLoad: true,
    })
}
mpetroff commented 6 years ago

If you use multiresolution images, the loading bar is not displayed. That's currently the only way to disable the loading bar.

While it's not currently the case, there's no need for a loading bar when blob: URLs are used, so not showing a loading bar when they're used would be a good feature to add. With this featured added, images could be pre-loaded with external code, blob: URLs could be created for each, and then these URLs could be used with Pannellum.

strarsis commented 6 years ago

You could try to just hide it using CSS:

#load_box {
  display: none;
}

But these styles must apply to the pannellum viewer inside the iframe – or you have to initialize pannellum on a DIV instead (and don't embed it using an iframe).

peterycyeh commented 6 years ago

Thank you for both of your reply. It gets me some inspiration to hide the loading bar. I just change some css style in the class which name is 'pnlm-load-box'. And it works fine to me now. Thank you so much!

periman2 commented 5 years ago

If anyone still interested what worked for me was the following css :

.pnlm-load-box {
   z-index:-999;
   opacity: 0;
}