diff --git a/2-ui/1-document/07-modifying-document/5-why-aaa/task.md b/2-ui/1-document/07-modifying-document/5-why-aaa/task.md index f46a01af..aedf8697 100644 --- a/2-ui/1-document/07-modifying-document/5-why-aaa/task.md +++ b/2-ui/1-document/07-modifying-document/5-why-aaa/task.md @@ -2,7 +2,7 @@ importance: 1 --- -# Why "ааа" remains? +# Why "aaa" remains? Run the example. Why `table.remove()` does not delete the text `"aaa"`? diff --git a/2-ui/1-document/07-modifying-document/7-create-object-tree/innerhtml.view/index.html b/2-ui/1-document/07-modifying-document/7-create-object-tree/innerhtml.view/index.html index 417f0652..9ba40a6d 100644 --- a/2-ui/1-document/07-modifying-document/7-create-object-tree/innerhtml.view/index.html +++ b/2-ui/1-document/07-modifying-document/7-create-object-tree/innerhtml.view/index.html @@ -27,7 +27,7 @@ container.innerHTML = createTreeText(obj); } - function createTreeText(obj) { // отдельная рекурсивная функция + function createTreeText(obj) { // standalone recursive function let li = ''; for (let key in obj) { li += '
  • ' + key + createTreeText(obj[key]) + '
  • '; @@ -38,7 +38,6 @@ return ul || ''; } - let container = document.getElementById('container'); createTree(container, data); diff --git a/2-ui/1-document/07-modifying-document/8-tree-count/solution.view/index.html b/2-ui/1-document/07-modifying-document/8-tree-count/solution.view/index.html index 54d683ee..ec44bfda 100644 --- a/2-ui/1-document/07-modifying-document/8-tree-count/solution.view/index.html +++ b/2-ui/1-document/07-modifying-document/8-tree-count/solution.view/index.html @@ -43,12 +43,12 @@ let lis = document.getElementsByTagName('li'); for (let li of lis) { - // получить количество детей - let childCount = li.getElementsByTagName('li').length; - if (!childCount) continue; + // get the count of all
  • below this
  • + let descendantsCount = li.getElementsByTagName('li').length; + if (!descendantsCount) continue; - // добавить кол-во детей к текстовому узлу - li.firstChild.data += ' [' + childCount + ']'; + // add directly to the text node (append to the text) + li.firstChild.data += ' [' + descendantsCount + ']'; } diff --git a/2-ui/1-document/08-styles-and-classes/getiecomputedstyle.view/getiecomputedstyle.js b/2-ui/1-document/08-styles-and-classes/getiecomputedstyle.view/getiecomputedstyle.js deleted file mode 100644 index 12a7e04c..00000000 --- a/2-ui/1-document/08-styles-and-classes/getiecomputedstyle.view/getiecomputedstyle.js +++ /dev/null @@ -1,18 +0,0 @@ -function getIEComputedStyle(elem, prop) { - var value = elem.currentStyle[prop] || 0; - - // we use 'left' property as a place holder so backup values - var leftCopy = elem.style.left; - var runtimeLeftCopy = elem.runtimeStyle.left; - - // assign to runtimeStyle and get pixel value - elem.runtimeStyle.left = elem.currentStyle.left; - elem.style.left = (prop === "fontSize") ? "1em" : value; - value = elem.style.pixelLeft + "px"; - - // restore values for left - elem.style.left = leftCopy; - elem.runtimeStyle.left = runtimeLeftCopy; - - return value; -} \ No newline at end of file diff --git a/2-ui/1-document/08-styles-and-classes/getiecomputedstyle.view/index.html b/2-ui/1-document/08-styles-and-classes/getiecomputedstyle.view/index.html deleted file mode 100644 index a757f39f..00000000 --- a/2-ui/1-document/08-styles-and-classes/getiecomputedstyle.view/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - -
    Тестовый элемент с margin 1%
    - - - - - \ No newline at end of file diff --git a/2-ui/1-document/09-size-and-scroll/article.md b/2-ui/1-document/09-size-and-scroll/article.md index d75c0cba..f302f538 100644 --- a/2-ui/1-document/09-size-and-scroll/article.md +++ b/2-ui/1-document/09-size-and-scroll/article.md @@ -152,7 +152,7 @@ They include the content width together with paddings, but without the scrollbar ![](metric-client-width-height.png) -On the picture above let's first consider `clientHeight`: it's easier to evaluate. There's no horizontal scrollbar, so its exactly the sum of what's inside the borders: CSS-высота `200px` plus top and bottom paddings (`2*20px`) total `240px`. +On the picture above let's first consider `clientHeight`: it's easier to evaluate. There's no horizontal scrollbar, so its exactly the sum of what's inside the borders: CSS-height `200px` plus top and bottom paddings (`2*20px`) total `240px`. Now `clientWidth` -- here the content width is not `300px`, but `284px`, because `16px` are occupied by the scrollbbar. So the sum is `284px` plus left and right paddings, total `324px`. diff --git a/2-ui/1-document/10-size-and-scroll-window/article.md b/2-ui/1-document/10-size-and-scroll-window/article.md index 0834f4b9..a3ca5095 100644 --- a/2-ui/1-document/10-size-and-scroll-window/article.md +++ b/2-ui/1-document/10-size-and-scroll-window/article.md @@ -90,7 +90,7 @@ We can do the same for the page: It should work. -But there's a simpler, more universal solution: special methods [window.scrollBy(x,y)](mdn:api/Window/scrollBy) и [window.scrollTo(pageX,pageY)](mdn:api/Window/scrollTo). +But there's a simpler, more universal solution: special methods [window.scrollBy(x,y)](mdn:api/Window/scrollBy) and [window.scrollTo(pageX,pageY)](mdn:api/Window/scrollTo). - The method `scrollBy(x,y)` scrolls the page relative to its current position. For instance, `scrollBy(0,10)` scrolls the page `10px` down. diff --git a/2-ui/2-events/1-introduction-browser-events/01-hide-other/source.view/index.html b/2-ui/2-events/1-introduction-browser-events/01-hide-other/source.view/index.html index 1c50e998..17c5be6d 100755 --- a/2-ui/2-events/1-introduction-browser-events/01-hide-other/source.view/index.html +++ b/2-ui/2-events/1-introduction-browser-events/01-hide-other/source.view/index.html @@ -7,13 +7,13 @@ - + -
    Текст
    +
    Text
    - - \ No newline at end of file + + diff --git a/2-ui/2-events/1-introduction-browser-events/06-hide-message/solution.md b/2-ui/2-events/1-introduction-browser-events/06-hide-message/solution.md index ae9d13c2..022a0d97 100644 --- a/2-ui/2-events/1-introduction-browser-events/06-hide-message/solution.md +++ b/2-ui/2-events/1-introduction-browser-events/06-hide-message/solution.md @@ -1,10 +1,13 @@ -1. Изменим HTML/CSS, чтобы кнопка была в нужном месте сообщения. Кнопка -- это тег `'); +``` - Если использовать `float:right`, то кнопка никогда не перекроет текст. Это, пожалуй хорошо. - - С другой стороны, потенциальным преимуществом способа с `position` по сравнению с `float` в данном случае является возможность поместить элемент кнопки в HTML *после текста*, а не до него. -2. Для того, чтобы получить кнопку из контейнера, используем `querySelectorAll`. На каждую кнопку повесим обработчик, который будет убирать родителя. Найти родителя можно через `parentNode`. +Then the ` diff --git a/2-ui/2-events/1-introduction-browser-events/07-carousel/source.view/index.html b/2-ui/2-events/1-introduction-browser-events/07-carousel/source.view/index.html index 8f414238..e9a9bc8d 100755 --- a/2-ui/2-events/1-introduction-browser-events/07-carousel/source.view/index.html +++ b/2-ui/2-events/1-introduction-browser-events/07-carousel/source.view/index.html @@ -7,28 +7,28 @@ - +