JeremyHeleine / Photo-Sphere-Viewer

A JavaScript library to display Photo Sphere panoramas.
855 stars 955 forks source link

can't update image in mozilla browser when container first set none #65

Open thofik93 opened 7 years ago

thofik93 commented 7 years ago

in mozilla browser just black screen, image can't load

var viewer = new PhotoSphereViewer({ container: '360container', panorama: '/images/360/default.jpg', autoload: false, navbar: [ 'autorotate', 'zoom', 'markers', 'caption', 'fullscreen' ] });

  // module fullpopup
  (function($, viewer){
    var triggerFullPopup = '[data-trigger="full-popup"]'
    var dismiss = '.full-popup__dismiss'

    $(document).on('click', triggerFullPopup, buildFullPopup)
    $(document).on('click', dismiss, closePopup)

    function buildFullPopup() {
        var $body = $('body')
        var $this = $(this)
        var target = $this.attr('data-target')
        var panoramaImage = $this.attr('data-panorama-image')
        togglepopup()

        function togglepopup() {
            var isActive = $body.hasClass('full-popup-active')

            if(!isActive) {
                $body.addClass('full-popup-active')
                $(target).fadeIn('400', function(){
                    viewer.load()
                        .then(function(){
                                viewer.setPanorama('/images/360/Test_Academy_3.jpg')
                                $('#play-360').on('click', function(){
                                    viewer.toggleFullscreen()
                                    $(this).remove()
                                })
                        });
                });

            }
        }
    }

    function closePopup() {
        var $body = $('body')
        var $this = $(this)
        var $parent = $this.closest('.full-popup')

        $body.removeClass('full-popup-active')
        $parent.fadeOut('400')
    }

  })(jQuery, viewer)
JeremyHeleine commented 7 years ago

Hi,

You are using a fork of Photo Sphere Viewer and your issue seems to come from a feature from this fork. Please contact the developer of this fork.