Adding an icon to a jazz.ui.Button button.
![](http://jazz.net/_images/myphoto/e9e3b3e8b30bbcc6253434d7185e615d.jpg)
One answer
![](http://jazz.net/_images/myphoto/e9e3b3e8b30bbcc6253434d7185e615d.jpg)
The constructor for Button takes an imageClass param. Pass it, and also set a className on your button (to narrow the scope of your CSS).
Example:
var button = new jazz.ui.Button({imageClass: "someClass"});
dojo.addClass(button.domNode, "MyButton");
Then in CSS:
.Mybutton .someClass {
background-image:url(someImage.gif);
width:80px; //tweak this width depending on your image
}
Example:
var button = new jazz.ui.Button({imageClass: "someClass"});
dojo.addClass(button.domNode, "MyButton");
Then in CSS:
.Mybutton .someClass {
background-image:url(someImage.gif);
width:80px; //tweak this width depending on your image
}