Closed Thread Icon

Preserved Topic: Ooh, gittin' big for ma britches. (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=17760" title="Pages that link to Preserved Topic: Ooh, gittin&amp;#039; big for ma britches. (Page 1 of 1)" rel="nofollow" >Preserved Topic: Ooh, gittin&#039; big for ma britches. <span class="small">(Page 1 of 1)</span>\

 
Wes
Paranoid (IV) Mad Scientist

From: Inside THE BOX
Insane since: May 2000

posted posted 06-13-2000 02:23

Just had to do a little bragging aloud. For you seasoned programmers, this is nothin'.

On my free texture page, I was using JavaScript to launch a new window, showing an example of the given texture as a tiled background:

<SCRIPT LANGUAGE="JavaScript">
<!--

function CreateTiled()
{
TiledWindow = window.open("tiled.shtml?<!--#echo var='which' -->","Single","toolbar=no,width=500,height=400,directories=no,status=yes,scrollbars=no,resizable=yes,menubar=no");
setTimeout('TiledWindow.focus()',500);
}

// -->
</SCRIPT>

Pretty simple. The only problem is if you resized the window to get a larger view, then clicked another texture, the window would go back to its original size of 500x400. Annoying. So after hacking away at this with my extremely limited knowledge and a Netscape JavaScript resource for what seems to be forever, I came up with:

<SCRIPT LANGUAGE="JavaScript">
<!--

var TiledWindow = ("")

function CreateTiled()
{
if (TiledWindow.open)
{
TiledWindow.location.href="tiled.shtml?<!--#echo var='which' -->";
setTimeout('TiledWindow.focus()',500);
}
else
{
TiledWindow = window.open("tiled.shtml?<!--#echo var='which' -->","Tiled","toolbar=no,width=500,height=400,directories=no,status=yes,scrollbars=no,resizable=yes,menubar=no");
}
}

// -->
</SCRIPT>

This way if the window is already open, it just reloads the document and brings the window to the top! Woohoo!

Yes, I know, pretty basic stuff, but I'm proud of myself. Incidentally, anyone see anything I could have done easier? I have a feeling I did something the long way.


Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 06-13-2000 03:50

Actually, that's pretty well done. You could try taking out the '= ("")' after 'var TiledWindow', I think, although it's not necessary to do so. There may be a couple other things that I'm not seeing, but it's pretty good code. Nice job!

DocOzone
Maniac (V) Lord Mad Scientist
Sovereign of all the lands Ozone and just beyond that little green line over there...

From: Stockholm, Sweden
Insane since: Mar 1994

posted posted 06-13-2000 09:16

Yah, I like that, looks like the kind of hack I would do! I always love dropping SSI include code into my javascript, it gives you some *killer* controls that you would usually only get from of the more powerful (and expensive!) server packages. Nice nice work! You might want to allow the viewers to jump right to the preview from the collected thumbnail page, though, I hated jumping back and forth to the preview page to select the next texture.

Your pal, -doc-<P>

Wes
Paranoid (IV) Mad Scientist

From: Inside THE BOX
Insane since: May 2000

posted posted 06-13-2000 19:29

DL-44 said the same thing, and I think you're right. I'll try to eliminate that extra page tonight. Or maybe today. Doesn't seem to be too much to do at work today.

BTW, I thought I should be able to eliminate the '= ("")' after "var TiledWindow" too, but it didn't work when I did that for some reason.

Thanks, guys.

« BackwardsOnwards »

Show Forum Drop Down Menu