erich.wanker Posted February 12, 2016 Posted February 12, 2016 i create a array of tuniPanels with meine_marker[x]:=TUniPanel.Create(self); i give the unipanels different css classes with UniSession.AddJS(meine_marker[x].JSName + '.addCls(''marker_1'');'); is it possible to give the unipanel different backgrounds?? i tryed out in css-file: background-image: url(bullet.png); .. but doesnt work... is it possible with "UniSession.AddJS(meine_marker[x].JSName +"... and somting else? ThanX for help Quote
cristianotestai Posted February 12, 2016 Posted February 12, 2016 i create a array of tuniPanels with meine_marker[x]:=TUniPanel.Create(self); i give the unipanels different css classes with UniSession.AddJS(meine_marker[x].JSName + '.addCls(''marker_1'');'); is it possible to give the unipanel different backgrounds?? i tryed out in css-file: background-image: url(bullet.png); .. but doesnt work... is it possible with "UniSession.AddJS(meine_marker[x].JSName +"... and somting else? ThanX for help Hi, I have not tried, but try something like: UniSession.AddJS(meine_marker[x].JSName + '.addCls(''marker_1'');'); //add css class UniSession.AddJS(meine_marker[x].JSName + '.setStyle(''background-image", url("/yourpath/image.png"));'); //set css atributte Quote
Sherzod Posted February 12, 2016 Posted February 12, 2016 Hi, Try: CSS: .tulips { background: url("files/tulips.jpg") } UniPanel1 ... function afterrender(sender, eOpts) { sender.body.addCls("tulips") } Or: UniSession.AddJS(UniPanel1.JSName + '.body.addCls(''tulips'')'); Best regards. Quote
newsanti Posted September 23, 2023 Posted September 23, 2023 On 2/13/2016 at 12:53 AM, Sherzod said: Hi, Try: CSS: .tulips { background: url("files/tulips.jpg") } UniPanel1 ... function afterrender(sender, eOpts) { sender.body.addCls("tulips") } Or: UniSession.AddJS(UniPanel1.JSName + '.body.addCls(''tulips'')'); Best regards. How to change filename (jpg) at run-time? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.