-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have been able to set the foreground image using image property in button component as follows:
<button image="source file name.png" />
But, I can't able to set the background image for the button.
Any help will be appreciated.
Thank you.
The may not be the most elegant way to do this but it works for me:
<zk>
<style>
.z-button .z-button-tl, .z-button .z-button-tr, .z-button .z-button-bl, .z-button .z-button-br,
.z-button .z-button-tm, .z-button .z-button-bm, .z-button .z-button-cl, .z-button .z-button-cr {
background-image:none; background-color:#008bb6;
}
.z-button .z-button-cm {
background-image:none; background-color:#ff0000;
}
</style>
<window id="win" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" contentStyle="overflow: auto">
<button label = "Button Label"image="/images/calendar.png"/>
</window>
</zk>
Of course, you'll have to adjust the image path...
Hope that helps,
Todd
Thank you samchuang & twiegand.
@twiegand
We can able to set the foreground image as you depicted but I had asked for the way to set the background image.
I had achieved it by replacing btn-ctr.gif inside zul.jar with our custom image.
Thank you.
Asked: 2010-04-08 10:01:04 +0800
Seen: 2,029 times
Last updated: Apr 15 '10