Angel Herraez wrote:

>Bob Hanson wrote:
>
>[snip]
>  
>
>>....OK, I have that now in 
>>http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-11/new.htm
>>    
>>
>
>
>Amazing and delightful!
>
>Works fine in WinXP:
>       Firefox 1.5
>       Opera 9.0
>       Netscape 7.0
>       Mozilla 1.7.12
>but
>       IE 7 and 5.5:  new window is empty -no applet- 
>
>As for the source of trouble, I try to guess:
>1) Some Microsoft security -protect you from yourself? ;-)
>2) Bob, I had a look at Jmol.js, and think that in 
>       _jmolGetAppletSize()
>you are adding "px" even if size is in percent?
>
>  
>
function _jmolGetAppletSize(size) {
...
oops!

right! I got mixed up in all the negatives. This is better:

function _jmolGetAppletSize(size) {
  var width, height;
  var type = typeof size;
  if (type == "object" && size != null) {
    width = size[0]; height = size[1];
  } else {
    width = height = size;
  }
  if (typeof width == "number") {
        width = (width >= 25 && width <= 2000 ? width + "px"
     : width < 1 && width > 0 ? (width * 100)+"%":"300px")
  }
  if (typeof height == "number") {
        height = (height >= 25 && height <= 2000 ? height + "px"
     : height < 1 && height > 0 ? (height * 100)+"%":"300px")
  }
  return [width, height];
}

Don't you love the way you can completely mess with variable types in 
JavaScript!!!



>IE says "runtime error - object was expected" (cannot find in which 
>point, since all is in one line and MS Script Editor doesn't give 
>more clues -or I don't know how to)
>
>  
>

Hmm. I had trouble with MSIE 5.whatever but it went away when I took out 
the <body onresize...> business.


>Firefox javascript console -although it basically works- says:
>Error:  an end of value was expected for the property, but 'px' was 
>found.  Error while reading the value for the property 'width'.  
>Declaration rejected.
>Source file: 
>http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-
>11/new.htm
>Line: 0
>
>and same for 'height'
>
>Right?
>
>  
>
right. But I doubt that's the problem with MSIE 7. Would be nice if it 
were only that.



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to