My favorites | Sign in
Project Home Downloads Issues
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 336: parameter from jscript
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Sep 2009


 
Reported by vlangend...@gmail.com, Sep 25, 2009
Trying to make a function for different popup positions, size and background
how to properly embed the css code on the fly depending on the parameter input?

function popup(breedte,hoogte,topmarge,linkermarge,achtergrondplaatje,autoresize,urllink){
		
		$.nyroModalManual({
								    url: urllink,
								    forceType: 'iframe',
								    width:breedte,
									height:hoogte,
									resizable: autoresize,
										css: { 
												wrapper: {	position: 'absolute',
															 marginTop: topmarge,
															marginLeft: linkermarge
												},
												loading: {
														 position: 'absolute',
														     marginTop: topmarge,
															marginLeft: linkermarge
												}
											 }
									});
}

This is not working for margintop etc do the css code etc.

Anyone hase some tips on this one?

Sep 26, 2009
#2 vlangend...@gmail.com
Fixed it myself :

function 
popup(breedte,hoogte,topmarge,linkermarge,achtergrondplaatje,autoresize,urllink){
		
		//alert(achtergrondplaatje);
		$.fn.nyroModal.settings.css.nyroModalWrapper =
		{position:'absolute',marginTop:topmarge,marginLeft:linkermarge};
		$.fn.nyroModal.settings.css.nyroModalLoading =
		{position:'absolute',marginTop:topmarge,marginLeft:linkermarge};


		
		$.nyroModalManual({
								    url: urllink,
								    forceType: 'iframe',
								    width:breedte,
									height:hoogte,
									bgImage:achtergrondplaatje,
									resizable: autoresize
									});
}

//so basically I made a mistake in adressing the correct css naming!
//nyroModalWrapper instead of former set: wrapper :-) Yihaa!
//depending of your default modal css files ofcourse....
Sep 27, 2009
Project Member #3 nyro...@gmail.com
great, thanks for sharing!
Status: Fixed
Sep 27, 2009
#4 vlangend...@gmail.com
One thing I still have to fix is to convert parameter vars to css vars within javascript...
Somehow this won't work :

function popup(breedte,hoogte,topmarge,linkermarge,achtergrondplaatje,autoresize,urllink){
		

		var tm = topmarge;
		var lm = linkermarge;
		$.nyroModalManual({			css: {
						 					 loading: {
											  position: 'absolute',
											  backgroundColor: '#666666',
											  opacity:0.50,
											  top: tm,
											  left: lm
											},
											wrapper: {
											  position: 'absolute',
											   top: tm,
											  left: lm
											}
										},
								    url: urllink,
								    forceType: 'iframe',
								    width: breedte,
									height: hoogte,
									bgImage: achtergrondplaatje,
									resizable: autoresize
									});
}

When i replce tm and lf with normal hard coded values.... nothing's wrong... but with parameters it is not working ... Anyone??
It will place the loader + wrapper into 0,0 or such so upperleft corner... When I change it into hard code values it's working properly....
To be continued....

Powered by Google Project Hosting