自定义一个dojo的ComboBox [英] Customize a dojo's ComboBox

查看:116
本文介绍了自定义一个dojo的ComboBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 dijit.form.ComboBox 或 dijit.form.FilteringSelect

,并且当鼠标移入和移出时,图片可以切换。

and the picture can switch when mouse move in and move out.

如何更改ComboBox的弹出式bg颜色。

And how to change popup's bg-color of the ComboBox.

喜欢这个网站

(我需要复制像原来的网站,但这个网站使用自定义小部件,那么我不知道如何获得源。)

(I need to copy like the original from that site. But this site use a custom widget then I don't know how to get the source.)

如果有人知道如何自定义,请教我。感谢。

If anyone know how to customize like that please teach me. Thanks.

推荐答案

使用主题来更改Dojo窗口小部件的外观和感觉。
http://dojotoolkit.org/reference-guide/1.7/dijit /themes.html

Changing the look and feel of Dojo widgets is done using themes. http://dojotoolkit.org/reference-guide/1.7/dijit/themes.html

您可以看到默认发送的主题为
http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/themes/themeTester.html
注意:此页面是基于每晚构建,因此已损坏)

You can see the themes that ship by default at http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/themes/themeTester.html (NOTE: This page is based on a nightly build, so soemtimes it is broken)

使用CSS应用主题。

我将创建您的自己的CSS样式表。
将主题名称添加到主体节点。

Themes are applied using CSS.
I'd create your own css style sheet. Add the theme name to the body node.

<body class="tundra myTheme">

您正在查找的特定css是

The particular css you are looking for is

.myTheme .dijitComboBox .dijitDownArrowButton {} /* The grey box */
.myTheme .dijitComboBox .dijitDownArrowButton .dijitArrowButtonInner { /* The arrow */
   background: url(images/spriteArrows.png) no-repeat scroll 0 center;
} 

/* Hover */
.myTheme .dijitComboBox .dijitDownArrowButtonHover {} /* The grey box */
.myTheme .dijitComboBox .dijitDownArrowButtonHover .dijitArrowButtonInner {} /* The arrow  */

/* Active (mouse down) */
.myTheme .dijitComboBox .dijitDownArrowButtonActive {} /* The grey box */
.myTheme .dijitComboBox .dijitDownArrowButtonActive .dijitArrowButtonInner {} /* The arrow */

在浏览器中使用开发工具帮助您确定要覆盖的css类。

Using the developer tools with your browser will help you determine the css classes that you are looking to override.

这篇关于自定义一个dojo的ComboBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆