代码写多了,有些使用过的方法和技巧会一时半会想不起来,平日记录下来,方便自己和有需要的人日后查阅。

<html>
<head>
<style type="text/css">
div.searchButton
{
width: 68px;
height: 24px;
border: 1px solid #a8a8a8;
font-family: 微软雅黑;
color: #585959;
font-size: 12px;
line-height: 24px;
text-align: center;
cursor: pointer;
float: left;
}
div.menuButton
{
width: 18px;
height: 24px;
border: 1px solid #a8a8a8;
text-align: center;
line-height: 24px;
cursor: pointer;
color: #d0d0d0;
float: left;
margin-left: 1px;
font-size: 12px;
}
div.menuButton:hover
{
color: #000000;
}
div.menuButton.openMenuPanel
{
color: Orange;
}
div.menuPanel
{
width: 140px;
height: 80px;
border: 1px solid #a8a8a8;
background-color: #ffffff;
clear: both;
}
div.menuPanel div
{
width: 140px;
height: 39px;
font-family: 微软雅黑;
color: #585959;
font-size: 18px;
line-height: 40px;
text-align: center;
border-bottom: 1px solid #a8a8a8;
cursor: pointer;
}
div.menuPanel div:hover
{
background-color: #f1f1f1;
}
div.menuPanel div:last-child
{
border-bottom: none;
height: 40px;
}
</style>
<!-- 此处请引用jQuery和jQuery-ui库 -->
<script type="text/javascript">
$(function () {
$('.menuButton').click(function () {
$(this).addClass('openMenuPanel');
$('.menuPanel').show();
$(document).one('click', function () {
$('.menuPanel').hide();
$('.menuButton').removeClass('openMenuPanel');
});
return false;
}).next().position({
my: 'left top',
at: 'left bottom',
of: '.searchButton'
}).hide(); $('.menuPanel').children('div').click(function () {
$('.searchButton').html($.trim($(this).html()));
});
});
</script>
</head>
<body>
<div class="searchButton">
选项-1
</div>
<div class="menuButton">

</div>
<div class="menuPanel">
<div>
选项-1
</div>
<div>
选项-2
</div>
</div>
</body>
</html>

jQuery 分割按钮(Split Button)的更多相关文章

  1. 第二百零八节,jQuery EasyUI,SplitButton(分割按钮菜单)组件

    jQuery EasyUI,SplitButton(分割按钮)组件 学习要点: 1.加载方式 2.属性列表 3.方法列表 本节课重点了解 EasyUI 中 SplitButton(分割按钮)组件的使用 ...

  2. easyui源码翻译1.32--SplitButton(分割按钮)

    前言 扩展自$.fn.linkbutton.defaults.用于$.fn.splitbutton.defaults重写默认值对象.下载该插件翻译源码 类似菜单按钮,分割按钮也与linkbutton和 ...

  3. JQuery 分割字符串

    JQuery 分割字符串 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...

  4. MFC控件(7):Split Button

    VS2008中可以看到MFC有一个叫Split Button的控件,要想看它的效果,瞧下QQ那聊天窗口的"发送", "消息记录"这两个按钮就知道了.实际上就是还 ...

  5. (三)Jquery Mobile按钮详细讲解

    Jquery Mobile按钮详细讲解 一.JM按钮说明 按钮如下图所示           1.HTML5中的button      效果:      2. JM中的普通button        ...

  6. jquery倒计时按钮常用于验证码倒计时

    <!doctype html><html><head> <meta charset="utf-8"> <title>jq ...

  7. 菜单和按钮-EasyUI Menu 菜单、EasyUI Linkbutton 链接按钮、EasyUI Menubutton 菜单按钮、EasyUI Splitbutton 分割按钮

    EasyUI Menu 菜单 通过 $.fn.menu.defaults 重写默认的 defaults. 菜单(Menu)通常用于上下文菜单.它是创建其他菜单组件(比如:menubutton.spli ...

  8. 主攻ASP.NET MVC4.0之重生:Jquery Mobile 按钮+对话框使用

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  9. Bootstrap 历练实例 - 按钮(Button)插件复选框

    复选框(Checkbox) 您可以创建复选框按钮 组,并通过向 btn-group 添加 data 属性 data-toggle="buttons" 来添加复选框按钮组的切换. & ...

随机推荐

  1. poj 1195Mobile phones

    http://poj.org/problem?id=1195 #include <cstdio> #include <cstring> #include <algorit ...

  2. HDU 1083 Courses(最大匹配模版题)

    题目大意: 一共有N个学生跟P门课程,一个学生可以任意选一 门或多门课,问是否达成:    1.每个学生选的都是不同的课(即不能有两个学生选同一门课)   2.每门课都有一个代表(即P门课都被成功选过 ...

  3. Android新浪微博客户端(五)——主界面的TabHost和WeiboUtil

    原文出自:方杰|http://fangjie.info/?p=183转载请注明出处 最终效果演示:http://fangjie.info/?page_id=54 该项目代码已经放到github:htt ...

  4. 启动android默认浏览器

    一.启动android默认浏览器 Intent intent = new Intent();         intent.setAction("android.intent.action. ...

  5. Android 布局 ViewGroup

    布局 res/layout 命名规则(全部小写) activity_ fragment_ item_ 基础组件 com.android.widget包下 父类View view:屏幕上一块矩阵区域 能 ...

  6. TinyXml高速入门(一)

    作者:朱金灿 来源:http://blog.csdn.net/clever101 对于xml文件,眼下我的工作仅仅是集中在配置文件和作为简单的信息文件来用,因此我不太喜欢使用msxml这样的重量级的x ...

  7. Android 用ping的方法判断当前网络是否可用

    判断网络的情况中,有个比较麻烦的情况就是连上了某个网络,但是那个网络无法上网 ,,, = = 想到了用ping指令来判断,经测试,可行~ ~ ~ private static final boolea ...

  8. 各个函数消耗的时间profiling和内存泄漏valgrind

    来源:http://06110120wxc.blog.163.com/blog/static/37788161201333112445844/ ARM(hisi)上面的profiling和valgri ...

  9. IO-序列化 Serializable Parcelable Object

    简介 1.什么是序列化和反序列化 对象的寿命通常随着生成该对象的程序的终止而终止,有时候,可能需要将对象的状态保存下来,在需要时再将对象恢复.我们把对象的这种,能记录自己的状态以便将来再生的能力,叫作 ...

  10. OD: Heap Overflow (XP SP2 - 2003) & DWORD SHOOT via Chunk Resize

    微软在堆中也增加了一些安全校验操作,使得原本是不容易的堆溢出变得困难重重: * PEB Random:在 Windows XP SP2 之后,微软不再使用固定的 PEB 基址 0x7FFDF000,而 ...