Re: [Jmol-users] Fwd: JSMol change viewer size

2016-10-20 Thread Robert Hanson
javascript:Jmol.script(jmolApplet0,'set window 610 450')

Adjust to suit.


Ah, I think this might be undocumented, but it is on the jsmol.htm page
"large" and "small" buttons.
Evidence that I have not caught up with the documentation for some time:

JmolVersion="14.5.4_2016.04.19"

new feature: set window width height
new feature: set window [width height]
new feature: set window "xxx.png"




On Thu, Oct 20, 2016 at 1:44 PM, Angel Herráez  wrote:

> Hi Thomas
>
> Probably the easiest way:
>
> 1.- Define you Info variable with
> width:"100%",
> height:"100%"
>
> 2.- Wrap your source JSmol, as well as your target JSmol, in a DIV and set
> their size via CSS.
>
> JSmol will always fit the wrapper div, which you can easily resize via css
> and
> Javascript
>
>
> ---
> El software de antivirus Avast ha analizado este correo electrónico en
> busca de virus.
> https://www.avast.com/antivirus
>
>
> 
> --
> 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
>



-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
--
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


Re: [Jmol-users] Fwd: JSMol change viewer size

2016-10-20 Thread Angel Herráez
Hi Thomas

Probably the easiest way:

1.- Define you Info variable with
width:"100%",
height:"100%"

2.- Wrap your source JSmol, as well as your target JSmol, in a DIV and set 
their size via CSS.

JSmol will always fit the wrapper div, which you can easily resize via css and 
Javascript


---
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus


--
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


[Jmol-users] Fwd: JSMol change viewer size

2016-10-20 Thread Thomas Hrabe
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