Closed Thread Icon

Preserved Topic: How can I optimize this windowPop script? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=17684" title="Pages that link to Preserved Topic: How can I optimize this windowPop script? (Page 1 of 1)" rel="nofollow" >Preserved Topic: How can I optimize this windowPop script? <span class="small">(Page 1 of 1)</span>\

 
Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 07-13-2000 17:53

Greets!

Here is the script:
<script LANGUAGE="JavaScript">
function windowPop(url,name,features)
{
window.open(url,name,features);
}
</script>

And I call is using:
<a class="screenshot" href="javascript:windowPop('/runningwolf2.com/yamaha-r1.htm','screenshot','top=200,left=175,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=270,height= 230')" onClick="this.blur()" onmouseover="window.status='Click here for a screenshot';return true">Screenshot</a>

Of course, with 30 of these links, this makes for a ton of extra code. Can I move the parameters to the <script> section, so that I only need to pass the URL in the <A> tag? This would cut down on lot of code, but I'm javascript challenged.

Go slow, and use single syllable words!

Pat Richard
Web weenie
http://www.gurusnetwork.com
ICQ 23113317

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 07-13-2000 19:56

Easy,

<script LANGUAGE="JavaScript">
function windowPop(url,name,features)
{
window.open(url,'screenshot','top=200,left=175,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=270,height= 230');}
</script>

Make that your script, now instead of passing the name and features into your function it just gets the URL


the link could be this
<a class="screenshot" href="javascript:void" onClick="windowPop('/runningwolf2.com/yamaha-r1.htm');this.blur()" onmouseover="window.status='Click here for a screenshot';return true">Screenshot</a>



Walking the Earth like Kane

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 07-13-2000 20:17

Cool! Thanks bd!

Pat Richard
Web weenie
http://www.gurusnetwork.com
ICQ 23113317

« BackwardsOnwards »

Show Forum Drop Down Menu