Hi everyone,

A probably simple question. 

How can I change a JSMol viewer size once it has been initialized?
I want to implement an enlargement button for the viewer so that it transfers 
to a modal view on the page and increases its size from it’s default in page 
constraints.

Here’s the code to move the viewer into the modal (it works), but the size is 
not adaptive and hence remains the same.

moveWebGLToModal = function(){
    webGLInModal = true;

    $("#myModalDiv2").addClass("modal-lg");
    $('.modal-title')[0].textContent = "Structure view";
    $('.modal-body').empty();    
    
    // $("#myModal").attr('max-height:80vh;')
    $("#structureViewer").height($("#structureViewer").height()*1.5);
    $("#structureViewer").appendTo(".modal-body");

    $("#myModal").modal("show");

    $('#myModal').on('hide.bs.modal', function (e) {
        graphInModal = false;
        $("#structureViewer").height($("#structureViewer").height()/1.5);
        $("#structureViewer").prependTo("#view2Container");     
        $("#myModalDiv2").removeClass("modal-lg");
    })
} 


I tried setting 

jsmolApplet0._height = 1000;

as well bit with no results.

Thank you for any tips,
Thomas





----------------------------------

Thomas Hrabe (Ph.D.)
Sanford Burnham Prebys 
Medical Discovery Institute
10901 North Torrey Pines Road
92037, La Jolla, CA, USA
+1 858 646 3100 ext 4070






------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to