Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/405.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何根据最高跨距调整相邻跨距的跨距高度_Javascript_Html_Jquery_Css - Fatal编程技术网

Javascript 如何根据最高跨距调整相邻跨距的跨距高度

Javascript 如何根据最高跨距调整相邻跨距的跨距高度,javascript,html,jquery,css,Javascript,Html,Jquery,Css,如何将每一个紫罗兰色的跨度调整为同一行中的跨度,以便在一个中有更多的集装箱时,同一行上的集装箱也会垂直伸展 height=auto可以工作,但不能解决同一行中的跨度问题 我选择了,也许我应该用和 下面是HTML CSS和JS的代码片段 const weekdays=[“周一”、“周二”、“周三”、“周四”、“周五”、“周六”、“周日”]; 让planningsection=document.createElement(“div”); planningsection.className=“规划”

如何将每一个紫罗兰色的跨度调整为同一行中的跨度,以便在一个
中有更多的集装箱时,同一行上的集装箱也会垂直伸展

height=auto可以工作,但不能解决同一行中的跨度问题

我选择了
,也许我应该用

下面是HTML CSS和JS的代码片段

const weekdays=[“周一”、“周二”、“周三”、“周四”、“周五”、“周六”、“周日”];
让planningsection=document.createElement(“div”);
planningsection.className=“规划”;
设天数=document.createElement(“div”);
days.className=“焦耳”;
计划部分。附件(天);
元("规划组")[0];
工作日。地图(e=>{
//克伦斯潘酒店
let day=document.createElement(“span”);
day.className=“jour_one”;
让dayText=document.createTextNode(e);
//关于内页和内页
day.appendChild(dayText);
天。儿童(天);
})
让section=document.createElement(“section”);
section.className=“callender\u one”;
规划部分。追加子项(部分);
用于(规划=0;规划<7;规划++){
让colonne=document.createElement(“div”);
colonne.className=“horaire_one”;
colonne.id=(“col”+规划);
对于(i=0;i<26;i++){
设span=document.createElement(“span”);
span.className=“dispo_one_rpv”;
//关于科隆法院案件的联合国鉴定人
span.id=(colonne.id+i);
//让plageText=document.createTextNode(“Dispo/id:+span.id”);
让plageText=document.createTextNode(“”);
span.appendChild(plageText);
科隆·阿佩奇尔德(span);
第二节儿童(科隆);
}
}
let box=$(“#col110”)[0];
newText=document.createTextNode(“您好,这是一个显示当前正在发生的事情的文本”);
框。追加子项(新文本)
#主要部分{
显示器:flex;
弯曲方向:行;
}
.普拉格·帕夫{
边框:实心1px灰色;
宽度:150px;
线高:2.5;
高度:50px;
字号:中等;
文本对齐:居中;
}
霍雷尔先生{
边框:实心1px灰色;
宽度:150px;
线高:2.5;
高度:44px;
文本对齐:居中;
}
#计划一{
宽度:100%;
/*溢出-x:滚动*/
}
.dispo_one_rpv{
/*线高:2.9*/
高度:50px;
字体大小:10px;
边框:实心1px#bb12e8;
文本对齐:居中;
}
卡伦德先生{
宽度:100%;
显示器:flex;
弯曲方向:行;
}
霍雷尔先生{
显示器:flex;
弯曲方向:立柱;
宽度:14.32%;
}
.焦耳{
显示器:flex;
}
jour_one先生{
宽度:14.32%;
线高:2.5;
文本对齐:居中;
边框:实心1px灰色;
高度:44px;
}

文件
霍雷斯
08:00 - 08:30
08:30 - 09:00
09:00 - 09:30
09:30 - 10:00
10:00 - 10:30
10:30 - 11:00
11:00 - 11:30
11:30 - 12:00
12:00 - 12:30
12:30 - 13:00
13:00 - 13:30
13:30 - 14:00
14:00 - 14:30
14:30 - 15:00
15:00 - 15:30
15:30 - 16:00
16:00 - 16:30
16:30 - 17:00
17:00 - 17:30
17:30 - 18:00
18:00 - 18:30
18:30 - 19:00
19:00 - 19:30
19:30 - 20:00
20:00 - 20:30
20:30 - 21:00

说明:

对于CSS,只需将
height
属性替换为
minheight
,以获得
中相同的值


对于JavaScript,请注意,我添加了两个函数
calc_max()
set_heights()
。每当在
元素中追加textNode时,更新
ind
变量,如下所示:

ind=$(box).index()+1;
并调用函数
calc_max()
。它将自动计算具有最大高度的图元,并将整行中所有图元的高度设置为计算值

const weekdays=[“周一”、“周二”、“周三”、“周四”、“周五”、“周六”、“周日”];
让planningsection=document.createElement(“div”);
planningsection.className=“规划”;
设天数=document.createElement(“div”);
days.className=“焦耳”;
计划部分。附件(天);
元("规划组")[0];
工作日。地图(e=>{
let day=document.createElement(“span”);
day.className=“jour_one”;
让dayText=document.createTextNode(e);
day.appendChild(dayText);
天。儿童(天);
})
让section=document.createElement(“section”);
section.className=“callender\u one”;
规划部分。追加子项(部分);
用于(规划=0;规划<7;规划++){
让colonne=document.createElement(“div”);
colonne.className=“horaire_one”;
colonne.id=(“col”+规划);
对于(i=0;i<26;i++){
设span=document.createElement(“span”);
span.className=“dispo_one_rpv”;
span.id=(colonne.id+i);
让plageText=document.createTextNode(“”);
span.appendChild(plageText);
科隆·阿佩奇尔德(span);
第二节儿童(科隆);
}
}
let box=$(“#col110”)[0];
newText=document.createTextNode(“您好,这是一个显示当前正在发生的事情的文本”);
框。追加子项(新文本);
var ind=$(box.index()+1;
函数calc_max(){
设max_height=$('#horaire div:eq('+ind+')).height();
$('.horaire_一个span:n个子('+ind+'))。每个(函数(){
如果($(此).height()>最大高度){
最大高度=$(此).height();
}
});
设置高度(最大高度);
}
calc_max();
功能设置高度(高度){
元("horaire div:eq("ind+").高度(height);;
$('.horaire_一个跨度:第n个孩子('+ind+'))。身高(身高);
}
#主要部分{
显示器:flex;
柔性di