to the current option.
Bootstrap provides button dropdown to make a nice menu, not just a select feature. When I searched for it, I thought Bootstrap could provide a select component similar to the button dropdown style. But I a
The bootstrap-dropdown component is a bad thing, and the overall feeling after I read it.
Design of a menu to be opened below:
First, open the menu, which is the UL element of the second layer. The class name is dropdown-menu. The drop-down menu is usually hidden. We can add an Open Class Name to its parent element to display it. Its Parent element usually
BootstrapDrop -down menu (Dropdown) pluginBootstrap drop-down Menu This chapter explains the drop-down menu, but does not involve the interactive part, this chapter will explain the interaction of the dropdown menu. Using the drop-down menu (Dropdown) plugin, you can add a drop-down menu to any component (such as navigation bar, tab, Capsule navigation menu,
The dropdown component in the bootstrap navigation bar is used very frequently, this article is to introduce the dropdown component extension hover event in Bootstrap, the details are as follows
How to achieve this hover event, in fact, in the dropdown component of the Cl
call plug-in;4, while the data-* mode call plug-in, used to the document injection event implementation, the code is as follows:
$ (document). On (' Click.bs.dropdown.data-api ', Clearmenus). On (function (e) { E.stoppropagation ()}).on (' Click.bs.dropdown.data-api ', toggle, Dropdown.prototype.toggle). On (' Keydown.bs.dropdown.data-api ', toggle, Dropdown.prototype.keydown). On (' Keydown.bs.dropdown.data-api ', '. Dropdown-menu ', Dropdown.pro
-down when the mouse is no longer in the drop-down menu or button/navigation project, activate it. The default value is 500.InstantlyCloseOthers: (optional) A boolean value. If it is true, use of all other drop-down menus is immediately disabled. When you start a new selector match navigation. The default value is true.
After the above js Code is added, the effect cannot be achieved at this time, because we need to add the data-* attribute to the elem
.
var Dropdown = function (Element) {
$ (Element). On (' Click.bs.dropdown ', This.toggle)
}
6, Clearmenu: will only clear data-toggle= "dropdown" Elements7, Dropdown-backdrop: For Mobile No click event Processing8, KeyDown: When the dropdown button to get foc
In the use of bootstrap production background used in response navigation bar, where the dropdown components are more use, more need to click on More, dropdown the default mouse button click to expand, if you use the mouse to put up (hover) on the expansion will save the click Time, This will improve efficiency.
The
Bootstrap Drop-down menu, commonly used in development projects, today to introduce you
Dropdown, Dropdown-menu, Dropdown-header, divider, Dropdown-submenuFor example, see Drop-down menu. html
Source code
. Dropup,
. Dropdown
Bootstrap-select implementation of the dropdown box multi-Select effectListen to the Voice
In learning bootstrap implementation of the Lado effect, feel that the effect is very good, so take to share, here is not detailed description, directly attached to the code to see you
Method/Step
1The effect of the final implementation:
2HTML code:
3J
is based on the level of the space to increase the relationship, so as to achieve the display of hierarchical relations.
But from this interface effect, this kind of processing does not have easyui inside, the display of the dropdown tree is good-looking, perhaps can use the better bootstrap plug-in to carry on the display of this tree content.
4) Assignment processing of SELECT2 control
The method
Before using the Easyui frame to do the dropdown box selection, although you can search, but there are a lot of inconvenience: for example, can not be fuzzy matching, you must follow the first letter to search
Whim, want to change the framework to write backstage, and then use bootstrap build a shelf, and then two styles of conflict, Baidu A, found another good based on the
Bootstrap button group, bootstrap button
1. Basic instanceThe Code is as follows:Button ToolbarThe Code is as follows:DimensionsThe Code is as follows:NestingThe Code is as follows:Vertical arrangementThe Code is as follows:Note: More learning resources in java tutorial network, http://java.662p.com/thread-451
,bootstrap is adaptive, CSS can customize different styles, Style.css have related comments
Easy-select.js
var comdirective = angular.module (' Easyselect ', []); Comdirective.directive ("Easyselect", function () {return {link:function (scope, element, attrs) {var Ngmodel = $
(Element). attr ("Ng-model");
if (!ngmodel | | ngmodel.length = = 0) {Ngmodel = "Defaultselectmodel"; var status = false;
Toggle Boolean var valueMap = "";
var
Http://output.jsbin.com/titaki
The above link in the Firefix browser will be found inside a small container, and the dropdown button style is very unfriendly
Check it out on Google.
1. Small containers can use select:padding:0
2. The dropdown icon can be removed by using Background-image;-moz-appearance:none to remove the
Recently learned to bootstrap Drop-down menu, learned the content of the tutorial after tapping a click button to pop down the menu of small demo, write code found after running click the button did not respond, the Drop-down menu is not out, the comparison of the tutorial feel code right.
My code is as follows:
Try pasting the code in the tutorial, run
Select the dropdown box, and when you select an option, the foreground displays a change, and you know which options are selected.
This is a good solution:
As follows:
Js:
function Selectonchang (obj) {
//Get the selected option label option
alert (obj.selectedindex);
}
The onchange and SelectedIndex are used here.
The onchange event occurs when the contents of the domain change.The onchange event can also be used for e
add a float:left style for. Dropdown.
. dropdown{Float:left;}
menu item Status
The default state (without setting) of the Drop-down menu item has a suspended state (: hover) and focus state (: Focusing): (including the state mentioned below must contain a tag in the Li to have--)
The Drop-down menu item has the current state (. Active) and the disabled state (. Disabled), in addition to th
Query button and reset button for Bootstrap button function
1, the problem background
In general, the query list has query conditions, Query button and reset button, input query conditions, click query
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.