医院实战总结

css

  • background
  • background-position
  • 知道了position的用法。
  • background-img不占容器的内容。直接用padding 即可。

.content-close .list,
.content-news .list{
    padding: 15px 20px 13px 35px;
    line-height: 29px;
    background:url(../img/list-yellow.jpg) 17px 20px no-repeat;/*第一个数值是左右第二个是上下*/
}
  •  像input、button不想要有border:
select,input{
    border: none;
    outline: none;
}
  • 如果在一张图片想要只显示一部分内容:
background-position: 0 -23px;

  •  float:left之后,第二的倍数的item要加margin-left.
.block-content .block-text-list .item:nth-child(2n){
    margin-left: 13px;
}

 JQ插件模式开发UI组件:

开发方法:

  1. 通过$.extend()来扩展jQuery
  2. 通过$.fn向jQuery添加新的方法
  3. 通过$.widget()应用jQuery UI的部件工厂方式创建。
$.extend({
    sayHello:function(){
        console.log('hello!');
}
})

$.sayHello();
$.fn.blue=function(){
    this.css('background-color','blue');
}

$('div').blue();
$('body').blue();

 

 

$(function(){
    alert(1);
})

alert(2);

//$(function(){
//
//})
//上面的代码会在页面全部加载完才执行。所以先执行alert(2);再执行alert(1);
  • 在每个a标签后加|
.ui-menu-item-detail-group-list a:after{
    content: ' |';
    color: #ddd;
}
  • 点击前是一个图片点击后是另一个图片 
.ui-menu-item-department:before{
    content: ' ';
    display: block;
    width: 22px;
    height: 21px;
    position: absolute;
    left: 0;
    top: 1px;
    background: url("../img/icon-menu.jpg") -22px 0 no-repeat;
}
.ui-menu-item:hover .ui-menu-item-department:before{
    /*background: url("../img/icon-menu.jpg") 0 0 no-repeat;*/
    /*background-position: 0 0;*/
    background-position-x: 0;
}
.ui-menu-item:nth-child(2) .ui-menu-item-department:before{
    background-position-y: -22px;
}
.ui-menu-item:nth-child(3) .ui-menu-item-department:before{
    background-position-y: -44px;
}

  • 选择符:(' .caption > .item',' .block > .item'  )找的是直接子类              (' .caption   .item',' .block  .item'  )找的是所有子类

实现医院和科室切换:

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值