Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

100
Visualizações
Add Loader until stl image load PHP

I am using Stl Viewer Javascript Plugin to display 3D image in my Website. The size of STL image is around 50MB. So, it is taking much time to load. So is it feasible to add loader image until the stl image load.

I am using this plugin, https://www.viewstl.com/plugin/

Please check my code below,

<body style="margin:0px;">
        <div id="stl_cont" style="width:600px;height:600px;margin:0; background:#ebebeb; overflow: hidden;"></div>

        <script src="stl_viewer.min.js"></script>       
        <script>
            var stl_viewer=new StlViewer
            (
                document.getElementById("stl_cont"),
                {
                    models:
                    [
                        {filename:"/test/Sienna.stl"}
                    ]
                }
            );
        </script>
        
    </body>

Please check the screenshot of the front-end, enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I tried the code i pasted below and it is working fine on my local machine, please check and let me know if it's working for you also.

P.S please replace image element's source with an appropriate gif url to get it working

<body style="margin: 0px">
    <div
      id="stl_cont"
      style="
        width: 600px;
        height: 600px;
        margin: 0;
        background: #ebebeb;
        overflow: hidden;
      "
    >
      <div
        class="loading"
        style="
          width: 600px;
          height: 600px;
          display: flex;
          align-items: center;
          justify-content: center;
        "
      >
        <img src="./assets/images/icons8-dots-loading.gif" alt="" />
      </div>
    </div>

    <script src="stl_viewer.min.js"></script>
    <script>
      var stl_viewer = new StlViewer(document.getElementById("stl_cont"),
        {
          models: [
            { filename: "/test/Sienna.stl" }
          ],
          all_loaded_callback: function () {
            document.querySelector(".loading").remove();
          },
        }
      );
    </script>
  </body>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda