• Resolved reza4234

    (@reza4234)


    hi
    How do I create a button to share a panorama on social media and display a suggested panorama in the civic widget?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Avirtum

    (@avirtum)

    You can use the custom css & js section, see example below. It’s just an example.

    The custom css section

    .my-buttons {
        position:absolute;
        top:0;
        right:0;
    }
    .my-button {
        margin:10px;
        padding:10px;
        color:#fff;
        background:#000;
        font-family:sans-serif;
        font-size:12px;
        cursor:pointer;
    }

    The custom js section

    var instance = this,
    $ = jQuery;
    
    function onButtonClick(e) {
        var sceneId = $(this).data('scene-id'),
        plugin = $('.ipanorama').ipanorama('instance');
        
        sceneId && plugin && plugin.setScene({id:sceneId});
    }
    
    var $buttons = $('<div>').addClass('my-buttons');
    $button =$('<div>').addClass('my-button').attr({'data-scene-id':'scene01'}).text('Go Home');
    $button.on('click', onButtonClick);
    $buttons.append($button);
    
    instance.$container.append($buttons);
Viewing 1 replies (of 1 total)
  • The topic ‘Create a button in the civic widget’ is closed to new replies.