Changing javascript function
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   3Pinter_nietnodig
Posted On:   Thursday, July 28, 2005 01:57 AM

Okay, I have this popup window which I use to open some of shockwavefiles (.swf). Most of them have the dimensions 400x400 but some of them are larger. So I want to extend the current function by adding two variables in the function. function popUp(URL) { day = new Date(); id = day.getTime(); urltotaal = "flash/" + URL; eval("page" + id + " = window.open(urltotaal, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=400,left = 440,top = 312');"); } ]]>]]> That is my current script. What I want is something like this function popUp(URL, dim1, dim2) { day = new Date(); id = day.getTime(); urltotaal = "flash/" + URL;    More>>

Okay,



I have this popup window which I use to open some of shockwavefiles (.swf). Most of them have the dimensions 400x400 but some of them are larger. So I want to extend the current function by adding two variables in the function.


			



That is my current script. What I want is something like this


			



And use it like this:
			
a href="javascript:popUp('flashfirststeps.html', '400', '800')">openit



But it doesn't work... :(


Does anybody have a clue or even better help me out?


Tnx,.


3Pinter    <<Less

Re: Changing javascript function

Posted By:   WarnerJan_Veldhuis  
Posted On:   Thursday, July 28, 2005 03:01 AM

make sure you take the dim1 and dim2 out of the string:
window.open(urltotaal, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + dim1 + ",height=" + dim2 + ",left = 440,top = 312');");
About | Sitemap | Contact