David, this is great fun!

Please check out http://biomodel.uah.es/JSmol/responsive-size-1.htm

Height of JSmol will always match height (I didn't think this was easy or even 
possible, but it's amazingly simple code)
The key for versatility is to always set width and height to 100% in Info. Then 
use an outer container + css and js to control the size.

And then these css units that I discovered recently and once again do the 
magic: "vw" "vh", meaning percent fraction of the window width or height. 
The big difference against classic % is you can use vw for the height! 

So the result here is a set size of 400px for JSmol, as long as it fits within 
the 
screen width. If not, 90% of it. And always square. I believe this will be 
great 
for the phones.


David Leader wrote:
> The problem with the width/height thing is that one can´t do a shrinkwrap 
like one can with an image and do a width:100%, height: auto. 
> My problem is that 280 px is actually just too large for the iPhone, so I 
> have 
to hack that a bit, and in truth it's too small for modern large displays



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

Reply via email to