• Is there a way to add a static button / marker on the virtual tour. One that stays in one place when rotating the photo? Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Plamen Yanev

    (@pyanev)

    Add something else you notice. In the “Civic” widget, apart from the HOME button not working, the “Start in the hide interface mode” option also has no effect.
    Regards

    Plugin Author Avirtum

    (@avirtum)

    Yes, it’s possible. We can use the js custom section and write some code. See example below.

    var instance = this,
    $ = jQuery;
    
    var $wrap = $('<div>').addClass('ipnrm-custom-wrap');
    
    for(var i=0;i<instance.config.scenes.length;i++) {
        var scene = instance.config.scenes[i];
        var $btn = $('<div>').addClass('ipnrm-custom-btn').text(scene.title).attr({'data-scene-id':scene.id});
        $wrap.append($btn);
    }
    instance.$container.append($wrap);
    
    //===============================================================
    // handlers
    //===============================================================
    $('body').on('click', '.ipnrm-custom-btn', function(e) {
        var pano = $('.ipanorama').ipanorama('instance');
        var sceneId = $(this).data('scene-id');
        pano.setScene({id:sceneId});
    });
    
    // set the button state to 'active'
    instance.dom.$canvas.on('ipanorama:scene-after-load', function(e) {
        var scene = e.originalEvent.data.scene;
        if(!scene) return;
        
        $wrap.find('.ipnrm-custom-btn.active').removeClass('active');
        $wrap.find('.ipnrm-custom-btn[data-scene-id="' + scene.cfg.id + '"]').addClass('active');
    });
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Static button’ is closed to new replies.