也就是鼠标点击触发按钮后执行的动作 if ($('.read-section').css('left') == "0px") $('.read-section').animate({left: '-212px'}, 200); //把左边栏的宽度设置为原来的宽度并显示出来, 根据设定的时间慢慢展现 else $('.read-section').animate({left: '0px'}, 200); //把左边栏的宽度设置为原来的宽度并显示出来, 根据设定的时间慢慢展现 }); //--本地缓存代码开始-- let bookInfo = { chapter_id: '344571', end: "完结", chapter_name: '第38话 苏落得知被骗', cover_url:'https://files.pimanhua.com/static/upload/book/cover/1663948800/24B82069FB5C271DFBFB012423D8D828.jpg', book_id: '4634', last_time: "2022-09-24", book_name:'朱颜血', param: '4634' }; localStorage.setItem('manhua_4634', JSON.stringify(bookInfo));//id为键,设置缓存 let history = []; let value = localStorage.getItem('xwx_historys'); //读取参照数组 if (value != undefined && value != null) { history = JSON.parse(value); } if (history.indexOf('manhua_4634') === -1) { history.push('manhua_4634'); //把id为值存入参照数组 } console.log(history) localStorage.setItem('xwx_historys', JSON.stringify(history)); //--本地缓存代码结束-- document.body.oncopy = function () { return false; }; //阻止复制 document.body.onselectstart = function () { return false; }; //阻止选中 document.oncontextmenu = function () { return false; }; //阻止菜单弹出 if (document.images) { for (i = 0; i < document.images.length; i++) { document.images[i].onmousedown = function () { return false; }; } } });