'use strict';
const acordeonItemsParams = {
bodyHeight: [],
isOpened: []
}
const acordeonItems = document.querySelectorAll('.acordeon__items .acordeon__item');
for (let i = 0; i < acordeonItems.length; i++) {
acordeonItemsParams
.bodyHeight
.push(
acordeonItems[i]
.querySelector('.acordeon__item-body')
// .style
.offsetHeight
);
}
console.log(acordeonItemsParams.bodyHeight);
const wrap = document.createElement('div');
wrap.setAttribute('class', 'sw-wrap');
const list = document.createElement('div');
list.setAttribute('class', 'sw-list');
wrap.appendChild(list);
////////////////////////////////////////////
var swapi = new XMLHttpRequest();
swapi.open("GET", "http://swapi.co/api/films/", true);
swapi.onload=function(){
var data=JSON.parse(this.response);
data.results.forEach( film => {
console.log(film.title);
const item = document.createElement('div');
item.setAttribute('class', 'sw-item');
const info = document.createElement('div');
info.setAttribute('class', 'sw-item__info');
const description = document.createElement('div');
description.setAttribute('class', 'opening_crawl');
const title = document.createElement('h3');
title.textContent=film.title;
const episode = document.createElement('h3');
episode.textContent=film.episode_id;
const director = document.createElement('div');
director.textContent=film.director;
const release = document.createElement('div');
release.textContent=film.release_date;
list.appendChild(item);
item.appendChild(info);
item.appendChild(description);
info.appendChild(title);
info.appendChild(episode);
info.appendChild(director);
info.appendChild(release);
});
}
swapi.send();
<div id="content"></div>
document.getElementById('content').appendChild(wrap);
var expr1 = algebra.parse("2*х / 6 + 8");
var expr2 = algebra.parse("24");
var eq = new Equation(expr1, expr2);
var xAnswer = eq.solveFor("x"); // находим x
<?php
$connection = mysqli_connect(`localhost`,`root`,`root`,`blog`);
if($connection == false){
echo "Не удалось подключиться к Базе данных";
echo mysqli_connect_error();
exit();
}
$result = mysqli_query($connection, "SELECT * FROM `articles`");
echo mysql_error($link);
while( $title = mysqli_fetch_assoc($result )){
}
?>
$( "#ShipStates option:selected" ).each(function() {
var data_lat = $(this).attr("data-lat");
var data_long = $(this).attr("data-long");
for(var countrycode in dealersArray)
{ country = dealersArray[countrycode];
for(var citycode in country.cities)
{ city = country.cities[citycode]
for (var i = 0; i < city.offices.length; i++)
{ office = city.offices[i]
var latLng = new google.maps.LatLng(data_lat, data_long);
mapBuy.setZoom(11);
mapBuy.panTo(latLng);
return;
}
}
}
})
// Создаем новый <span>
var sp1 = document.createElement("span");
// Получаем ссылку на элемент, перед которым мы хотим вставить sp1
var sp2 = document.getElementById("childElement");
//Получаем ссылку на родителя sp2
var parentDiv = sp2.parentNode;
// Вставляем sp1 перед sp2
parentDiv.insertBefore(sp1, sp2);