Skip to content

Commit 707d100

Browse files
committed
adjusting some things
1 parent 1f525f4 commit 707d100

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

script.js

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1+
var row1_films = document.getElementById('films-row1');
2+
var row1_desc = document.getElementById('desc-row1');
3+
4+
//Creating static 1
5+
var static1 = document.createElement('div');
6+
static1.classList = 'film';
7+
var id_film = 'film1';
8+
static1.id = id_film;
9+
static1.setAttribute('onclick', 'toggleDesc("desc-' + id_film + '")');
10+
row1_films.appendChild(static1);
11+
var image_static1 = document.createElement('img');
12+
image_static1.src = 'assets/static1.jpg';
13+
static1.appendChild(image_static1);
14+
15+
var desc1 = document.createElement('div');
16+
desc1.classList = 'desc';
17+
var id_desc1 = 'desc-film1';
18+
desc1.id = id_desc1;
19+
row1_desc.appendChild(desc1);
20+
121
var i = 0;
2-
var j = 0;
22+
var j = 1;
323

424
while(i < 3){
525

@@ -63,8 +83,10 @@ while(i < 3){
6383

6484
function toggleDesc(el) {
6585
var display = document.getElementById(el).style.display;
66-
if(display == "none")
86+
if(display == 'none' || display == ''){
6787
document.getElementById(el).style.display = 'flex';
68-
else
88+
}
89+
else{
6990
document.getElementById(el).style.display = 'none';
91+
}
7092
}

style.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ body{
179179
}
180180

181181
.desc-text{
182-
width: 280px;
183182
color: white;
184183
border: none;
185184
background-color: transparent;
@@ -190,10 +189,12 @@ body{
190189
}
191190

192191
#input-title{
192+
width: 280px;
193193
font-size: 45px;
194194
}
195195

196196
#input-year{
197+
width: 280px;
197198
font-size: 15px;
198199
}
199200

0 commit comments

Comments
 (0)