1.在Buttton所在的html页面定义button要使用的icon的css样式,如
</style>
<style>
.dijitArrowIcon {
background-image: url('../css/images/arrowIconEnabled.png');
background-repeat: no-repeat;
width: 18px;
height: 18px;
text-align: center;
}
.dijitRightPink { background-position:; }
.dijitRightOrange { background-position: -18px; }
</style>
2. 在页面定义button
<button id="testBtn">Test</button>
3. 在js文件中创建该button
var testBtn = new Button({
iconClass: "dijitArrowIcon dijitRightOrange"
}, "testBtn");