鍩轰簬.active绫诲悕鐨勭偣鍑绘樉绀烘洿澶氫氦浜掓晥鏋滃疄渚嬮〉闈?/h1>
鍥炲埌鐩稿叧鏂囩珷 »
浠g爜锛?/h3>
CSS浠g爜锛?/h5>
.box {
max-height: 80px;
transition: max-height .25s;
position: relative;
overflow: hidden;
}
.more {
position: absolute;
width: 100%;
padding-top: 20px;
bottom: 0; left: 0;
background: linear-gradient(to bottom, hsla(0,0%,100%,0), hsla(0,0%,100%,.9) 50%, hsla(0,0%,100%,1));
}
.box.active {
max-height: 200px;
}
.active > .more {
display: none;
}
HTML浠g爜锛?/h5>
<div id="box" class="box">
鏂囧瓧鍐呭...
<a href="javascript:" id="more" class="more">鏇村鈫?lt;/a>
</div>
JS浠g爜锛?/h5>
var box = document.getElementById('box'),
more = document.getElementById('more');
if (box && more) {
more.onclick = function () {
box.className += ' active';
};
}
鏁堟灉锛?/h3>
flv.js-B绔橦TML5鎾斁鍣ㄥ唴鏍稿紑婧?/h4>
椤圭洰鍦板潃锛歨ttps://github.com/Bilibili/flv.js
涓€涓函JS鐨勪笉渚濊禆Flash鐨凥TML5 Flash瑙嗛 (FLV)鎾斁鍣紒
鏈」鐩彈hls.js鍚彂锛岄渶瑕佷緷璧朚edia Source Extensions鎵嶈兘鐢熸晥銆?/p>
鏇村鈫?/a>
浠g爜锛?/h3>
CSS浠g爜锛?/h5>
.box {
max-height: 80px;
transition: max-height .25s;
position: relative;
overflow: hidden;
}
.more {
position: absolute;
width: 100%;
padding-top: 20px;
bottom: 0; left: 0;
background: linear-gradient(to bottom, hsla(0,0%,100%,0), hsla(0,0%,100%,.9) 50%, hsla(0,0%,100%,1));
}
.box.active {
max-height: 200px;
}
.active > .more {
display: none;
}
HTML浠g爜锛?/h5>
<div id="box" class="box">
鏂囧瓧鍐呭...
<a href="javascript:" id="more" class="more">鏇村鈫?lt;/a>
</div>
JS浠g爜锛?/h5>
var box = document.getElementById('box'),
more = document.getElementById('more');
if (box && more) {
more.onclick = function () {
box.className += ' active';
};
}
CSS浠g爜锛?/h5>
.box {
max-height: 80px;
transition: max-height .25s;
position: relative;
overflow: hidden;
}
.more {
position: absolute;
width: 100%;
padding-top: 20px;
bottom: 0; left: 0;
background: linear-gradient(to bottom, hsla(0,0%,100%,0), hsla(0,0%,100%,.9) 50%, hsla(0,0%,100%,1));
}
.box.active {
max-height: 200px;
}
.active > .more {
display: none;
}
HTML浠g爜锛?/h5>
<div id="box" class="box">
鏂囧瓧鍐呭...
<a href="javascript:" id="more" class="more">鏇村鈫?lt;/a>
</div>
JS浠g爜锛?/h5>
var box = document.getElementById('box'),
more = document.getElementById('more');
if (box && more) {
more.onclick = function () {
box.className += ' active';
};
}
<div id="box" class="box"> 鏂囧瓧鍐呭... <a href="javascript:" id="more" class="more">鏇村鈫?lt;/a> </div>
JS浠g爜锛?/h5>
var box = document.getElementById('box'),
more = document.getElementById('more');
if (box && more) {
more.onclick = function () {
box.className += ' active';
};
}
鏁堟灉锛?/h3>
flv.js-B绔橦TML5鎾斁鍣ㄥ唴鏍稿紑婧?/h4>
椤圭洰鍦板潃锛歨ttps://github.com/Bilibili/flv.js
涓€涓函JS鐨勪笉渚濊禆Flash鐨凥TML5 Flash瑙嗛 (FLV)鎾斁鍣紒
鏈」鐩彈hls.js鍚彂锛岄渶瑕佷緷璧朚edia Source Extensions鎵嶈兘鐢熸晥銆?/p>
鏇村鈫?/a>
flv.js-B绔橦TML5鎾斁鍣ㄥ唴鏍稿紑婧?/h4>
椤圭洰鍦板潃锛歨ttps://github.com/Bilibili/flv.js
涓€涓函JS鐨勪笉渚濊禆Flash鐨凥TML5 Flash瑙嗛 (FLV)鎾斁鍣紒
鏈」鐩彈hls.js鍚彂锛岄渶瑕佷緷璧朚edia Source Extensions鎵嶈兘鐢熸晥銆?/p> 鏇村鈫?/a>