WEb page...

Hmm… I have always wondered, how can I set the window size
on my website?

-Maybe some1# of you here can anwser that, cuz I really want to create
a web that is about blender( a good one)

Resizing the users window on 1:st visit is NOT a good idea, in fact it’s freaking annoying. However, you probably mean open a new window from a link on your site to display say… a *.blend file, is IMHO very good. You can set THIS window to what ever size you need for your file, but be carefull not to exceed the users desktop size. Most users have 800x640 or more so if your file is smaller than that you should do fine.

Here is an example:

(put this javascript code in your document)

<script type="text/javascript" language="javascript">

var mPointer;

function openBlenderFile(path, width, height) {

  var prop = 'menubar=no, toolbar=no, location=no, directories=no, status=no, resizable=no, scrollbars=no, width=' + width + ', height=' + height;
  mPointer = window.open(path, 'blender3DpluginWindow', prop);
  mPointer.focus();
}
</script>

this alone does not do the trick thou, you need to call it via a link somewhere from you page
Like this:

[link](javascript:openBlenderFile('pathtofile/*.blend', 343, 450))

ok, that’s it /me thinks :slight_smile:

EDIT
Crap! I forgot to remove “” from the second script.
/EDIT

I dont understand this other script, is this the right way to do it?:

[link](javascript:openBlenderFile(\'C:\Documents and Settings\3dfox\My Documents\My Webs/open.blend\', 343, 450))

See edit above!

Aha, you are working local, I would do it like this:

[link](javascript:openBlenderFile('file://C:\\Documents and Settings\\3dfox\\My Documents\\My Webs/open.blend', 343, 450))

it may work without the “file://” too!?

but, but, that path will only work on your machine.

Hope that did it!

Let’s have some more fun, shall we? :slight_smile: - “wihtout misstakes this time” :smiley:

I take it your “My Webs” folder is your local base folder.
We can make it work both local and online!

First we need to test if your viewing the page online or not.
Put this code directly under that “var mPointer;” variable:

var onLine = (location.hostname.indexOf("lycos") != -1) ? true: false;
var myPath = "";
if (!onLine) myPath = 'file://C:\\Documents and Settings\\3dfox\\My Documents\\My Webs/';

That code basically test if hostname contain the word “lycos” and it sets the local path(myPath) to those links used to open a new sized window.

Now use this link code instead:

[link](javascript:openBlenderFile(myPath + 'open.blend', 343, 450))