gitbook-plugin-lock
Advanced tools
Comparing version 0.0.43 to 0.0.44
@@ -6,17 +6,16 @@ require(['gitbook', 'jQuery'], function(gitbook, $) { | ||
const cla = document.getElementsByClassName("book-search-results"); | ||
const cla = document.getElementById("book-search-results"); | ||
console.log(cla,"看看cla是啥") | ||
// if (cla.length > 0) { | ||
// 文章的实际高度 | ||
const article = cla[0], height = article.scrollHeight; | ||
console.log(article,"看看",height) | ||
// 文章隐藏后的高度 | ||
const halfHeight = height * 0.5; | ||
console.log("看看---->",halfHeight) | ||
// 文章的实际高度 | ||
const article = cla, height = article.scrollHeight; | ||
console.log(article,"看看",height) | ||
// 文章隐藏后的高度 | ||
const halfHeight = height * 0.5; | ||
console.log("看看---->",halfHeight) | ||
cla[0].style.height= halfHeight + 'px'; | ||
cla[0].style.overflow = 'hidden' | ||
// } | ||
cla.style.height= halfHeight + 'px'; | ||
cla.style.overflow = 'hidden' | ||
const html = '<div id="read-more-wrap" style="position: absolute; bottom: 0; z-index: 9999; width: 100%; margin-top: -100px; font-family: PingFangSC-Regular, sans-serif;">' + | ||
@@ -47,3 +46,3 @@ '<div id="read-more-mask" style="position: relative; height: 200px; background: -webkit-gradient(linear, 0 0%, 0 100%, from(rgba(255, 255, 255, 0)), to(rgb(255, 255, 255)));"></div>' + | ||
child.innerHTML = html | ||
cla[0].appendChild(child) | ||
cla.appendChild(child) | ||
bc = function () { | ||
@@ -53,4 +52,4 @@ // alert(22223333 + document.getElementById('btw-modal-input').value) | ||
if (document.getElementById('btw-modal-input').value === 1024) { | ||
cla[0].style.height= height + 'px'; | ||
cla[0].style.overflow= 'visible'; | ||
cla.style.height= height + 'px'; | ||
cla.style.overflow= 'visible'; | ||
const rm = document.getElementById("read-more-wrap") | ||
@@ -57,0 +56,0 @@ rm.style.display = 'none' |
{ | ||
"name": "gitbook-plugin-lock", | ||
"version": "0.0.43", | ||
"version": "0.0.44", | ||
"description": "Gitbook 页面加锁", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
7163
95