| Issue 336: | parameter from jscript | |
| 2 people starred this issue and may be notified of changes. | Back to list |
|
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 27, 2009
great, thanks for sharing!
Status:
Fixed
Sep 27, 2009
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....
|
||||||||
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....