Skip to content

Commit 636d15d

Browse files
authored
指定 html 类型
1 parent 44c592b commit 636d15d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tutorials/lesson04.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#显示隐藏处理
2-
#vvisible manipulating
1+
# 显示隐藏处理
2+
# vvisible manipulating
33
今天的主角是ms-visible,它的效果类拟于jQuery的toggle,如果它后面跟着的表达式为真值时则显示它所在的元素,为假值时则隐藏。不过显示不是 display:none这么简单,众所周知,display拥有inline, inline-block, block, list-item, table, table-cell等十来个值,比如用户之前是让此LI元素表示inline-block,实现水平菜单效果,你直接display:block就会撑破布局。因此元素之前是用什么样式显示,需要保存下来,当表达式转换为真值时再还原。
44
we are talking about ms-visible today,it works very samilarly to the jQuery toggle(),if ms-visible is set a true Expression,the element will display,otherwise it will disapper.This attr does not only toggle your element between display:none and display:block, we all know that dispaly attr has many oppional values:inline, inline-block, block, list-item, table, table-cell ETC, you can't simply toggle your element between display:none and display:block otherwise your element may not display correctly.The original display value must be saved for restoring your element the original style when ms-visible:true.
5-
```
5+
```html
66
<!DOCTYPE html>
77
<html>
88
<head>
@@ -73,7 +73,7 @@ this example use ms-for loop directive and ms-click event diretive,the grammar i
7373

7474
再看它能否处理内联样式的干扰:
7575
let‘s see if it can precede over a inline style:
76-
```
76+
```html
7777
<!DOCTYPE html>
7878
<html>
7979
<head>
@@ -108,7 +108,7 @@ let‘s see if it can precede over a inline style:
108108
![](lesson04_1.gif)
109109
我们再来一个有用的例子,做一个切换卡。
110110
a useful example,tab switcher
111-
```
111+
```html
112112
<!DOCTYPE html>
113113
<html>
114114
<head>

0 commit comments

Comments
 (0)