Jquery UI对话框格式化(Jquery UI dialog formatting)

编程入门 行业动态 更新时间:2024-10-27 18:32:45
Jquery UI对话框格式化(Jquery UI dialog formatting)

在下面的对话框中我试图让菜单下拉列表对齐电子邮件输入框的右侧? 我已经尝试了我能想到的一切但菜单却向右或向下。

<div id="dialogNewRecipient" title="Add Recipient"> <div class="row"> <label for="NewFullName">Name:</label> <input id="NewFullName" type="text"> </div> <div class="row"> <div class="form-group"> <div class="container"> <label for="NewEmail">Email:</label> <input id="NewEmail" type="text"> <ul class="nav navbar navbar-right"> <li class="label"></li> <li class="dropdown" id="emailDropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" id="dropdownMenu2" aria-haspopup="true" aria-expanded="false">@@tax.ny.gov<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">@@tax.ny.gov</a></li> <li><a href="#">@@scom.tax.ny.gov</a></li> </ul> </li> </ul> </div> </div> </div> <div class="row"> <div class="form-group center-block"> <button id="SaveRecipient" type="button">Save</button> <button id="CancelRecipient" type="button">Cancel</button> </div> </div> </div>

In the following dialog Im trying to get the menu dropdown to align to the right of the email input box? Ive tried everything I could think of but the menu goes to the right or bottom.

<div id="dialogNewRecipient" title="Add Recipient"> <div class="row"> <label for="NewFullName">Name:</label> <input id="NewFullName" type="text"> </div> <div class="row"> <div class="form-group"> <div class="container"> <label for="NewEmail">Email:</label> <input id="NewEmail" type="text"> <ul class="nav navbar navbar-right"> <li class="label"></li> <li class="dropdown" id="emailDropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" id="dropdownMenu2" aria-haspopup="true" aria-expanded="false">@@tax.ny.gov<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">@@tax.ny.gov</a></li> <li><a href="#">@@scom.tax.ny.gov</a></li> </ul> </li> </ul> </div> </div> </div> <div class="row"> <div class="form-group center-block"> <button id="SaveRecipient" type="button">Save</button> <button id="CancelRecipient" type="button">Cancel</button> </div> </div> </div>

最满意答案

你需要使用包装器获取电子邮件字段及其标签,并使css中的字段包装器和菜单包装器向左浮动

更改您的HTML:

<div id="dialogNewRecipient" title="Add Recipient"> <div class="row"> <label for="NewFullName">Name:</label> <input id="NewFullName" type="text"> </div> <div class="row"> <div class="form-group"> <div class="container"> <div class="form-group"> <label for="NewEmail">Email:</label> <input id="NewEmail" type="text"> </div> <ul id="menu" class="nav navbar"> <li class="label"></li> <li class="dropdown" id="emailDropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" id="dropdownMenu2" aria-haspopup="true" aria-expanded="false">@@tax.ny.gov<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">@@tax.ny.gov</a></li> <li><a href="#">@@scom.tax.ny.gov</a></li> </ul> </li> </ul> </div> </div> </div> <div class="row"> <div class="form-group center-block"> <button id="SaveRecipient" type="button">Save</button> <button id="CancelRecipient" type="button">Cancel</button> </div> </div>

将此添加到您的CSS代码:

.form-group, #menu { display: inline-block; float: left; }

这些编辑将菜单放在电子邮件字段的右侧。

you need to grab email field and its label with a wrapper and make the field wrapper and menu wrapper in css floating left

change your HTML:

<div id="dialogNewRecipient" title="Add Recipient"> <div class="row"> <label for="NewFullName">Name:</label> <input id="NewFullName" type="text"> </div> <div class="row"> <div class="form-group"> <div class="container"> <div class="form-group"> <label for="NewEmail">Email:</label> <input id="NewEmail" type="text"> </div> <ul id="menu" class="nav navbar"> <li class="label"></li> <li class="dropdown" id="emailDropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" id="dropdownMenu2" aria-haspopup="true" aria-expanded="false">@@tax.ny.gov<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">@@tax.ny.gov</a></li> <li><a href="#">@@scom.tax.ny.gov</a></li> </ul> </li> </ul> </div> </div> </div> <div class="row"> <div class="form-group center-block"> <button id="SaveRecipient" type="button">Save</button> <button id="CancelRecipient" type="button">Cancel</button> </div> </div>

add this to your CSS codes:

.form-group, #menu { display: inline-block; float: left; }

these edits will put the menu to the right of the email field.

更多推荐

本文发布于:2023-08-04 22:47:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1423161.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对话框   UI   Jquery   dialog   formatting

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!