Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.onload = function(){
- blok = document.getElementById('content_text');
- parent = blok.parentNode;
- blok_height = blok.style.height ? blok.style.height : blok.offsetHeight;
- if(blok_height > 60){
- blok.style.maxHeight = '80px';
- link = parent.getElementsByClassName('read-next')[0];
- link.style.display = 'inline';
- link.onclick = function(){
- if(blok.style.maxHeight){
- blok.style.maxHeight = '';
- shadow.style.display ='none';
- link.innerHTML = 'Скрыть';
- } else {
- blok.style.maxHeight = '80px';
- link.innerHTML = 'Читать далее...';
- shadow.style.display ='block';
- }
- return false;
- }
- }
- }
- [].forEach.call(
- document.querySelectorAll('.block'),
- function (el) {
- ...
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement