Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Adding an icon to a jazz.ui.Button button.

I would like to add a small icon inside of a button that I have created using jazz.ui.Button. Is there built-in functionality to accomplish this, or do I have to use an html anchor tag somewhere?

Thanks!

0 votes



One answer

Permanent link
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
}

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,954

Question asked: Feb 04 '09, 3:32 p.m.

Question was seen: 5,888 times

Last updated: Feb 04 '09, 3:32 p.m.

Confirmation Cancel Confirm