Jump to content

possible? .. give TUniPanel a background-image per CSS?


Recommended Posts

Posted

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

 

Posted

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

Posted

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.

  • 7 years later...
Posted
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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...