zero50x

Изменение свойств тегов на JS Сергей

Jul 8th, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         <script>
  2.             (function () {
  3.                 var img = document.getElementsByTagName('img');
  4.                 for (var i=img.length; i--;) {
  5.                     img[i].className += 'img-responsive';
  6.                 }
  7.             })();
  8.             <!--устанавливаем свойство 'auto' для высоты картинки из CKeditor -->
  9.             var classHeight = document.getElementsByClassName('img-responsive');
  10.             for (var i = 0; i < classHeight.length; i++) {
  11.                 /*classHeight[i].style.height = 'auto';*/
  12.                 classHeight[i].style.height = 'auto';
  13.                 classHeight[i].style.width = 400 + 'px';
  14.             }
  15.         </script>
Add Comment
Please, Sign In to add comment