ghinda / jotted

Environment for showcasing HTML, CSS and JavaScript, with editable source.
https://ghinda.net/jotted/
MIT License
491 stars 36 forks source link

Set active pane #21

Closed bhoot-biswas closed 7 years ago

bhoot-biswas commented 7 years ago

Hello, Jotted is awesome, it's simple but powerful! It will be great if I can change pane using a click event.

CSS

<style>
    .jotted-nav {
        display: none;
    }
</style>

JS

<script>
    var editor = new Jotted(document.querySelector('#editor'), {
        files: [{
            type: 'html',
            url: 'index.html'
        }]
    })

    $( ".somthing" ).on( "click", function() {
        editor.setActivePane("html");
    });
</script>

Thank you.

ghinda commented 7 years ago

Sure. You can trigger a click on the nav anchor.

Here you go: http://jsbin.com/wuqapu/edit?html,js,output