Home  >  Article  >  Web Front-end  >  Layui tab effect implementation code sharing

Layui tab effect implementation code sharing

小云云
小云云Original
2018-05-21 09:05:562708browse

This article mainly introduces the implementation code of layui pop-up layer effect in detail. It has certain reference value. Interested friends can refer to it. I hope it can help everyone.



  
    
    选项卡
    
  
默认风格的Tab

  • 网站设置
  • 用户管理
  • 权限分配
  • 商品管理
  • 订单管理

1. 高度默认自适应,也可以随意固宽。
2. Tab进行了响应式处理,所以无需担心数量多少。

内容2

内容3

内容4

内容5

动态操作Tab

  • 网站设置
  • 用户管理
  • 权限分配
  • 商品管理
  • 订单管理

内容1

内容2

内容3

内容4

内容5

Hash地址定位

  • 网站设置
  • 用户管理
  • 权限分配
  • 商品管理
  • 订单管理

点击该Tab的任一标题,观察地址栏变化,再刷新页面。选项卡将会自动定位到上一次切换的项

内容2

内容3

内容4

内容5

简洁风格的Tab

  • 网站设置
  • 用户管理
  • 权限分配
  • 商品管理
  • 订单管理

内容不一样是要有,因为你可以监听tab事件(阅读下文档就是了)

内容2

内容3

内容4

内容5

卡片风格的Tab

  • 网站设置
  • 用户管理
  • 权限分配
  • 商品管理
  • 订单管理

默认宽度是相对于父元素100%适应的,你也可以固定宽度。

2

3

4

5

6

当Tab数超过一定宽度

  • 网站设置
  • 用户管理
  • 权限分配
  • 商品管理
  • 订单管理

1. 宽度足够,就不会出现右上图标;宽度不够,就会开启展开功能。
2. 如果你的宽度是自适应的,Tab会自动判断是否需要展开,并适用于所有风格。

2

3

4

5

6

带删除功能的Tab

  • 网站设置
  • 用户基本管理
  • 权限分配
  • 商品管理
  • 订单管理

1. 我个人比较喜欢卡片风格的,所以你发现又是以卡片的风格举例 2. 删除功能适用于所有风格

2

3

4

5

6

Rendering:

Related recommendations:

How to make tabs in JS

Jquery plug-in development tab production technology sharing

JS+jQuery example of writing a simple tab

The above is the detailed content of Layui tab effect implementation code sharing. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn