Форум программистов, компьютерный форум, киберфорум
JavaScript для начинающих
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.83/6: Рейтинг темы: голосов - 6, средняя оценка - 4.83
-9 / 0 / 0
Регистрация: 16.08.2018
Сообщений: 52

У меня не получается изменить стиль див блока

16.01.2020, 01:20. Показов 1195. Ответов 2
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
PHP/HTML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JavaScript</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
*{
    margin: 0;
    padding: 0;
}
/* body{
    display: none;
} */
/*NavBar*/
header{
    height: 75px;
    box-shadow: 0px 3px 22px black;
}
.btn{
    list-style-type: none;
    display: inline-block;
    font-size: 22px;
    font-family: cursive;
    padding: 23px 15px;
    cursor: pointer;
    margin-right: -2px;
}
.music{
    list-style-type: none;
    display: inline-block;
    font-size: 22px;
    font-family: cursive;
    padding: 23px 15px;
    cursor: pointer;
    margin-right: -2px;
}
.navbar .music:hover{
    background-color: rgba(0,0,0,0.1);
    box-shadow: 0px -2px 2px black;
}
.active, .btn:hover {
    background-color: rgba(0,0,0,0.1);
    box-shadow: 0px -2px 2px black;
}
.reg-log{
    display: inline-block;
    float: right;
    margin-right: 15px;
}
.navbar .Log_in,.navbar .Registration,.navbar p{
    font-size: 20px;
    padding: 23px 2px;
}
.navbar p{
    font-size: 20px;
    display: inline-block;
}
.right{
    float: right;
}
.Registration{
    margin-right: 10px;
}
/*Music Menu*/
.modal{
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}
.modal-content{
    background-color: #fefefe;
    margin: 77px auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}
/*Audio*/
.Player{
    list-style-type: none;
    display: inline-block;
    font-size: 22px;
    font-family: cursive;
    padding-left: 15px; 
    width: 485px;
}
.myAudioPlayer{
    width: 100%;
    height: 30px;
    background-color: grey;
    margin-top: 5px;
    border-radius: 20px;
}
.audioControllers{
    display: inline-block;
    left: 
}
#pause{
    display: none;
    cursor: pointer;
}
#play{
    cursor: pointer;
}
.back{
    margin-left: 20px;
}
.controller{
    cursor: pointer;
}
.audio{
    width: 88%;
    text-align: center;
    margin: auto 0;
}
.audio li audio{
    width: 90%;
    height: 20px;
}
.audio li{
    list-style-type: none;
}
/*Borders*/
.border{
    display: inline-block;
    float: left;
    width: 15%;
    height: 300px;
    margin-top: 30px;
}
.myName{
    padding: 2px;
    border: 2px solid black;
    border-radius: 12px;
}
/*For phone*/
.responsive{
    display: none;
}
.Profile,.News,.Messages,.Music,.LogIn,.Reg{
    display: inline-block;
    float: left;
    width: 70%;
    height: 300px;
    margin-top: 30px;
}
.News,.Messages,.Music,.LogIn,.Reg{
    display: none;
}
.smallMusicMenu{
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}
.smallMusicMenu-content{
    background-color: #fefefe;
    margin: 77px auto;
    padding: 10px;
    border: 1px solid #888;
    width: 80%;
}
.smallMenu{
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}
.smallMenu-content{
    margin: 77px 68%;
    padding: 20px;
    width: 25%;
}
.small-menu{
    cursor: pointer;
    list-style-type: none;
    border: 2px solid #888;
    padding: 5px;
    border-radius: 20px;
    margin-bottom: 5px;
    background-color: rgba(0,0,0,0.5);
}
/*Profile*/
#Pr{
    background-color: unset;
}
.Profile{
    border-right: 1px solid black;
    border-left: 1px solid black;
    width: 69%;
    float: left;
    display: flex;
}
.profile-content{
    padding: 20px;
}
.profileImg{
    width: 200px;
    height: 200px;
    display: inline-block;
    border: 2px solid black;
    border-radius: 10px;
    float: left;
}
.profileImg img{
    width: 200px;
    height: 200px;
    border-radius: 6px;
}
.profileName{
    height: 50px;
    display: inline-block;
    float: left;
    padding: 25px;
}
.profileSettingsButton{
    display: inline-block;
    width: 140px;
    height: 30px;
    background-color: grey;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
}
.profileSettingsButton p {
    display: inline-block;
    margin-top: 4px;
    font-size: 20px;
    font-family: fantasy;
}
/*Settings*/
.settingMenu{
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: rgba(0,0,0,0.8);
    top: 0;
    left: 0;
    overflow: auto;
}
.settingWindow{
    width: 80%;
    background-color: #fefefe;
    border: 1px solid #888;
    margin: 20px auto;
    padding: 15px;
}
@media(max-width: 1200px){
    header .Player{
        display: none;
    }
}
@media(max-width: 709px){
    .navbar,.reg-log{
        display: none;
    }
    .MenuDiv{
    display: flex;
    width: 99%;
    }
    .responsive{
        width: 6%;
        display: inline-block;
    }
    .responsive li{
    display: inline-block;
    cursor: pointer;
    }
    .smallLogo{
        float: right;
    }
    .musicMenu{
        width: 80%;
        height: 25px;
    }
}
@media(min-width: 710px){
    .audio{
        display: none;
    }
}</style>
</head>
<body id="body">
    <header id="header">
        <div class="MenuDiv">
            <ul class="navbar" id="myDIV">
                <li class="btn active" id="home_click" onclick="Profile()">
                    <i class="fa fa-home" aria-hidden="true"></i>Profile
                </li>
                <li class="btn" onclick="News()">
                    <i class="fa fa-list-alt" aria-hidden="true"></i>News
                </li>
                <li class="btn" id="mess" onclick="Message()">
                    <i class="fa fa-envelope" aria-hidden="true"></i>Messages
                </li>
                <li class="music" id="myBtn">
                    <i class="fa fa-music" aria-hidden="true"></i>Music
                </li>
                <!-- Player -->
                <li class="Player">
                    <div class="myAudioPlayer">
                        <!-- Back -->
                        <div class="audioControllers back">
                            <i class="controller fa fa-step-backward" aria-hidden="true"></i>
                        </div>
                        <!-- Play/Pause -->
                        <div class="audioControllers play">
                            <i id="play" class="fa fa-play" aria-hidden="true"></i>
                            <i id="pause" class="fa fa-pause" aria-hidden="true"></i>
                        </div>
                        <!-- Forward -->
                        <div class="audioControllers forward">
                            <i class="controller fa fa-step-forward" aria-hidden="true"></i>
                        </div>
                    </div>
                </li>
                <div class="right">
                    <li class="btn Log_in" onclick="LogIn()">Log in</li>
                    <p >/</p>
                    <li class="btn Registration " onclick="Registration()">Registration</li>
                </div>
            </ul>
            <!-- Small Menu -->
            <!-- Music Button -->
            <ul class="btn responsive" id="smallMusicBtn">
                <li>
                    <i class="fa fa-headphones smallMusic" aria-hidden="true"></i>
                </li>
            </ul>
            <ul class="audio" id="audioMenu">
                <li>
                    <audio controls class="audio">
                        <source src="" type="audio/mpeg">
                    </audio>
                </li>
            </ul>
            <!-- Menu Button -->
            <ul class="btn responsive" id="smallBtn">
                <li class="smallLogo">
                    <i class="fa fa-bars" aria-hidden="true"></i>
                </li>
            </ul>
        </div>
    </header>
    <section id="section">
        <div class="border"></div>
        
        <div class="Profile" id="Prof">
            
            <div class="profile-content">
                <div class="profileImg">
                    <img src="Hakob.jpg" alt="">
                </div>
                <div class="profileName">
                    <span>Name</span><h1 class="myName">Hakob Avagyan</h1>
                </div>
                <div id="buttonSettings" class="profileSettingsButton"><p>SETTINGS</p></div>
            </div>
            
        </div>
        <div class="News" id="News">
            2
        </div>
        <div class="Messages" id="Mes">
            3
        </div>
        <div class="LogIn" id="Log">
            4
        </div>
        <div class="Reg" id="Reg">
            5
        </div>
        <div class="border"></div>
    </section>
    <footer id="footer">
        
    </footer>
    <!-- Setting Menu -->
    <div style="display:none;" class="settingMenu" id="settingMenu">
        <div class="settingWindow">ddd</div>
    </div>
    <!-- Music -->
    <div class="modal" id="myModal">
        <div class="modal-content">
            <audio controls class="musicMenu">
                <source src="Music/jony.mp3" type="audio/mpeg">
            </audio>
            <audio controls class="musicMenu">
                <source src="Music/agon.mp3" type="audio/mpeg">
            </audio>
        </div>
    </div>
    <!-- Small Menu -->
    <div  class="smallMenu" id="smallMenu">
        <div class="smallMenu-content">
            <ul>
                <li class="small-menu" onclick="Profile()" id="Pr">Profile</li>
                <li class="small-menu" id="Ne" onclick="News()">News</li>
                <li class="small-menu" id="Me" onclick="Message()">Messages</li>
                <li class="small-menu" id="Lo" onclick="LogIn()">Log in</li>
                <li class="small-menu" id="Re" onclick="Registration()">Registration</li>
            </ul>   
        </div>
    </div>
    <script> 
var header = document.getElementById("myDIV");
var btns = header.getElementsByClassName("btn");
var modal = document.getElementById('myModal');
var btn = document.getElementById("myBtn");
var smallBtn = document.getElementById('smallBtn');
var smallMenu = document.getElementById('smallMenu');
var header = document.getElementById('header');
var audioMenu = document.getElementById('audioMenu');
var smallMusicBtn = document.getElementById('smallMusicBtn');
var play = document.getElementById('play');
var pause = document.getElementById('pause');
var setting = document.getElementById('buttonSettings');
var settingMenu = document.getElementById('settingMenu');
 
 
for (var i = 0; i < btns.length; i++) {
  btns[i].addEventListener("click", function() {
  var current = document.getElementsByClassName("active");
  current[0].className = current[0].className.replace(" active", "");
  this.className += " active";
  });
}
 
function Profile() {
  document.getElementById("News").style="display:none";
  document.getElementById("Mes").style="display:none";
  document.getElementById("Log").style="display:none";
  document.getElementById("Reg").style="display:none";
  document.getElementById("Prof").style="display:block";
  document.getElementById("Pr").style="background-color:unset";
  document.getElementById("Ne").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Me").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Lo").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Re").style="background-color: rgba(0,0,0,0.5)";
}
function News() {
  document.getElementById("Prof").style="display:none";
  document.getElementById("Mes").style="display:none";
  document.getElementById("Log").style="display:none";
  document.getElementById("Reg").style="display:none";
  document.getElementById("News").style="display:block";
  document.getElementById("Pr").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Ne").style="background-color:unset";
  document.getElementById("Me").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Lo").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Re").style="background-color: rgba(0,0,0,0.5)";
}
function Message() {
  document.getElementById("News").style="display:none";
  document.getElementById("Prof").style="display:none";
  document.getElementById("Log").style="display:none";
  document.getElementById("Reg").style="display:none";
  document.getElementById("Mes").style="display:block";
  document.getElementById("Pr").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Ne").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Me").style="background-color:unset";
  document.getElementById("Lo").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Re").style="background-color: rgba(0,0,0,0.5)";
}
function LogIn() {
  document.getElementById("News").style="display:none";
  document.getElementById("Prof").style="display:none";
  document.getElementById("Mes").style="display:none";
  document.getElementById("Reg").style="display:none";
  document.getElementById("Log").style="display:block";
  document.getElementById("Pr").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Ne").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Me").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Lo").style="background-color:unset";
  document.getElementById("Re").style="background-color: rgba(0,0,0,0.5)";
}
function Registration() {
  document.getElementById("News").style="display:none";
  document.getElementById("Mes").style="display:none";
  document.getElementById("Log").style="display:none";
  document.getElementById("Prof").style="display:none";
  document.getElementById("Reg").style="display:block";
  document.getElementById("Pr").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Ne").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Me").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Lo").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Re").style="background-color:unset";
}
btn.onclick = function(){
    modal.style.display = "block";
    btn.style = "background-color: rgba(0,0,0,0.1);box-shadow: 0px -2px 2px black;"
}
smallBtn.onclick = function(){
    if (smallMenu.style.display=="" || smallMenu.style.display=="none") {
        smallMenu.style.display="block";
    }
    else{
        smallMenu.style.display="none";
    }
}
 
 
 
smallMusicBtn.onclick = function(){
    if (smallMusicBtn.style.display=="" || smallMusicBtn.style.display=="none") {
        modal.style.display="block";
    }
    else{
        modal.style.display="none";
    }
}
play.onclick = function(){
    if (pause.style.display == "" || pause.style.display == "none") {
        play.style.display = "none";
        pause.style.display = "block";
    }
}
pause.onclick = function(){
    if(play.style.display == "none"){
        play.style.display = "block";
        pause.style.display = "none";
    }
}
 
setting.onclick = function(){
    if (settingMenu.style.display == "none") {
        settingMenu.style.display = "block;"
    }
}
 
window.onclick = function(event) {
    if (event.target == modal) {
        modal.style.display = "none";
        btn.style = "";
    }
    if (event.target == smallMenu){
        smallMenu.style.display = "none";
    }
    if(event.target == smallMusicMenu){
        smallMusicMenu.style.display="none";
    }
    if (event.target == epb) {
        epb.style.display == "none";
    }
}
window.onresize = function(){
if( window.innerWidth >= 710 ){
      smallMenu.style.display = "none";
      audioMenu.style.display = "none";
}
else{
    audioMenu.style.display = "block";
}
}
    </script>
</body>
</html>
Добавлено через 1 минуту
При нажатии на кнопку Settings Должен появится Див Блок но не появляется
0
Лучшие ответы (1)
cpp_developer
Эксперт
20123 / 5690 / 1417
Регистрация: 09.04.2010
Сообщений: 22,546
Блог
16.01.2020, 01:20
Ответы с готовыми решениями:

У меня не получается изменить стиль див блока
&lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt; &lt;meta charset=&quot;UTF-8&quot;&gt; &lt;title&gt;ZZZ&lt;/title&gt; &lt;style&gt; /*Окно которое должно...

Как изменить стиль блока?
С прошедшими всех!! подскажите чайнику пж, есть движок в котором для изменения классов css создается отдельный файл и в нем указывается ...

Изменить стиль блока подгружаемый через iframe
На сайт установлен фрейм фотошопа онлайн. Там есть блок на треть страницы с рекламой, хочу его убрать. Можно ли с помощью скрипта...

2
-9 / 0 / 0
Регистрация: 16.08.2018
Сообщений: 52
16.01.2020, 01:43  [ТС]
PHP/HTML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JavaScript</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
*{
    margin: 0;
    padding: 0;
}
/* body{
    display: none;
} */
/*NavBar*/
header{
    height: 75px;
    box-shadow: 0px 3px 22px black;
}
.btn{
    list-style-type: none;
    display: inline-block;
    font-size: 22px;
    font-family: cursive;
    padding: 23px 15px;
    cursor: pointer;
    margin-right: -2px;
}
.music{
    list-style-type: none;
    display: inline-block;
    font-size: 22px;
    font-family: cursive;
    padding: 23px 15px;
    cursor: pointer;
    margin-right: -2px;
}
.navbar .music:hover{
    background-color: rgba(0,0,0,0.1);
    box-shadow: 0px -2px 2px black;
}
.active, .btn:hover {
    background-color: rgba(0,0,0,0.1);
    box-shadow: 0px -2px 2px black;
}
.reg-log{
    display: inline-block;
    float: right;
    margin-right: 15px;
}
.navbar .Log_in,.navbar .Registration,.navbar p{
    font-size: 20px;
    padding: 23px 2px;
}
.navbar p{
    font-size: 20px;
    display: inline-block;
}
.right{
    float: right;
}
.Registration{
    margin-right: 10px;
}
/*Music Menu*/
.modal{
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}
.modal-content{
    background-color: #fefefe;
    margin: 77px auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}
/*Audio*/
.Player{
    list-style-type: none;
    display: inline-block;
    font-size: 22px;
    font-family: cursive;
    padding-left: 15px; 
    width: 485px;
}
.myAudioPlayer{
    width: 100%;
    height: 30px;
    background-color: grey;
    margin-top: 5px;
    border-radius: 20px;
}
.audioControllers{
    display: inline-block;
    left: 
}
#pause{
    display: none;
    cursor: pointer;
}
#play{
    cursor: pointer;
}
.back{
    margin-left: 20px;
}
.controller{
    cursor: pointer;
}
.audio{
    width: 88%;
    text-align: center;
    margin: auto 0;
}
.audio li audio{
    width: 90%;
    height: 20px;
}
.audio li{
    list-style-type: none;
}
/*Borders*/
.border{
    display: inline-block;
    float: left;
    width: 15%;
    height: 300px;
    margin-top: 30px;
}
.myName{
    padding: 2px;
    border: 2px solid black;
    border-radius: 12px;
}
/*For phone*/
.responsive{
    display: none;
}
.Profile,.News,.Messages,.Music,.LogIn,.Reg{
    display: inline-block;
    float: left;
    width: 70%;
    height: 300px;
    margin-top: 30px;
}
.News,.Messages,.Music,.LogIn,.Reg{
    display: none;
}
.smallMusicMenu{
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}
.smallMusicMenu-content{
    background-color: #fefefe;
    margin: 77px auto;
    padding: 10px;
    border: 1px solid #888;
    width: 80%;
}
.smallMenu{
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}
.smallMenu-content{
    margin: 77px 68%;
    padding: 20px;
    width: 25%;
}
.small-menu{
    cursor: pointer;
    list-style-type: none;
    border: 2px solid #888;
    padding: 5px;
    border-radius: 20px;
    margin-bottom: 5px;
    background-color: rgba(0,0,0,0.5);
}
/*Profile*/
#Pr{
    background-color: unset;
}
.Profile{
    border-right: 1px solid black;
    border-left: 1px solid black;
    width: 69%;
    float: left;
    display: flex;
}
.profile-content{
    padding: 20px;
}
.profileImg{
    width: 200px;
    height: 200px;
    display: inline-block;
    border: 2px solid black;
    border-radius: 10px;
    float: left;
}
.profileImg img{
    width: 200px;
    height: 200px;
    border-radius: 6px;
}
.profileName{
    height: 50px;
    display: inline-block;
    float: left;
    padding: 25px;
}
.profileSettingsButton{
    display: inline-block;
    width: 140px;
    height: 30px;
    background-color: grey;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
}
.profileSettingsButton p {
    display: inline-block;
    margin-top: 4px;
    font-size: 20px;
    font-family: fantasy;
}
/*Settings*/
.settingMenu{
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: rgba(0,0,0,0.8);
    top: 0;
    left: 0;
    overflow: auto;
}
.settingWindow{
    width: 80%;
    background-color: #fefefe;
    border: 1px solid #888;
    margin: 20px auto;
    padding: 15px;
}
@media(max-width: 1200px){
    header .Player{
        display: none;
    }
}
@media(max-width: 709px){
    .navbar,.reg-log{
        display: none;
    }
    .MenuDiv{
    display: flex;
    width: 99%;
    }
    .responsive{
        width: 6%;
        display: inline-block;
    }
    .responsive li{
    display: inline-block;
    cursor: pointer;
    }
    .smallLogo{
        float: right;
    }
    .musicMenu{
        width: 80%;
        height: 25px;
    }
}
@media(min-width: 710px){
    .audio{
        display: none;
    }
}</style>
</head>
<body id="body">
    <header id="header">
        <div class="MenuDiv">
            <ul class="navbar" id="myDIV">
                <li class="btn active" id="home_click" onclick="Profile()">
                    <i class="fa fa-home" aria-hidden="true"></i>Profile
                </li>
                <li class="btn" onclick="News()">
                    <i class="fa fa-list-alt" aria-hidden="true"></i>News
                </li>
                <li class="btn" id="mess" onclick="Message()">
                    <i class="fa fa-envelope" aria-hidden="true"></i>Messages
                </li>
                <li class="music" id="myBtn">
                    <i class="fa fa-music" aria-hidden="true"></i>Music
                </li>
                <!-- Player -->
                <li class="Player">
                    <div class="myAudioPlayer">
                        <!-- Back -->
                        <div class="audioControllers back">
                            <i class="controller fa fa-step-backward" aria-hidden="true"></i>
                        </div>
                        <!-- Play/Pause -->
                        <div class="audioControllers play">
                            <i id="play" class="fa fa-play" aria-hidden="true"></i>
                            <i id="pause" class="fa fa-pause" aria-hidden="true"></i>
                        </div>
                        <!-- Forward -->
                        <div class="audioControllers forward">
                            <i class="controller fa fa-step-forward" aria-hidden="true"></i>
                        </div>
                    </div>
                </li>
                <div class="right">
                    <li class="btn Log_in" onclick="LogIn()">Log in</li>
                    <p >/</p>
                    <li class="btn Registration " onclick="Registration()">Registration</li>
                </div>
            </ul>
            <!-- Small Menu -->
            <!-- Music Button -->
            <ul class="btn responsive" id="smallMusicBtn">
                <li>
                    <i class="fa fa-headphones smallMusic" aria-hidden="true"></i>
                </li>
            </ul>
            <ul class="audio" id="audioMenu">
                <li>
                    <audio controls class="audio">
                        <source src="" type="audio/mpeg">
                    </audio>
                </li>
            </ul>
            <!-- Menu Button -->
            <ul class="btn responsive" id="smallBtn">
                <li class="smallLogo">
                    <i class="fa fa-bars" aria-hidden="true"></i>
                </li>
            </ul>
        </div>
    </header>
    <section id="section">
        <div class="border"></div>
        
        <div class="Profile" id="Prof">
            
            <div class="profile-content">
                <div class="profileImg">
                    <img src="Hakob.jpg" alt="">
                </div>
                <div class="profileName">
                    <span>Name</span><h1 class="myName">Hakob Avagyan</h1>
                </div>
                <div id="buttonSettings" class="profileSettingsButton"><p>SETTINGS</p></div>
            </div>
            
        </div>
        <div class="News" id="News">
            2
        </div>
        <div class="Messages" id="Mes">
            3
        </div>
        <div class="LogIn" id="Log">
            4
        </div>
        <div class="Reg" id="Reg">
            5
        </div>
        <div class="border"></div>
    </section>
    <footer id="footer">
        
    </footer>
    <!-- Setting Menu -->
    <div style="display:none;" class="settingMenu" id="settingMenu">
        <div class="settingWindow">ddd</div>
    </div>
    <!-- Music -->
    <div class="modal" id="myModal">
        <div class="modal-content">
            <audio controls class="musicMenu">
                <source src="Music/jony.mp3" type="audio/mpeg">
            </audio>
            <audio controls class="musicMenu">
                <source src="Music/agon.mp3" type="audio/mpeg">
            </audio>
        </div>
    </div>
    <!-- Small Menu -->
    <div  class="smallMenu" id="smallMenu">
        <div class="smallMenu-content">
            <ul>
                <li class="small-menu" onclick="Profile()" id="Pr">Profile</li>
                <li class="small-menu" id="Ne" onclick="News()">News</li>
                <li class="small-menu" id="Me" onclick="Message()">Messages</li>
                <li class="small-menu" id="Lo" onclick="LogIn()">Log in</li>
                <li class="small-menu" id="Re" onclick="Registration()">Registration</li>
            </ul>   
        </div>
    </div>
    <script> 
var header = document.getElementById("myDIV");
var btns = header.getElementsByClassName("btn");
var modal = document.getElementById('myModal');
var btn = document.getElementById("myBtn");
var smallBtn = document.getElementById('smallBtn');
var smallMenu = document.getElementById('smallMenu');
var header = document.getElementById('header');
var audioMenu = document.getElementById('audioMenu');
var smallMusicBtn = document.getElementById('smallMusicBtn');
var play = document.getElementById('play');
var pause = document.getElementById('pause');
var setting = document.getElementById('buttonSettings');
var settingMenu = document.getElementById('settingMenu');
 
 
for (var i = 0; i < btns.length; i++) {
  btns[i].addEventListener("click", function() {
  var current = document.getElementsByClassName("active");
  current[0].className = current[0].className.replace(" active", "");
  this.className += " active";
  });
}
 
function Profile() {
  document.getElementById("News").style="display:none";
  document.getElementById("Mes").style="display:none";
  document.getElementById("Log").style="display:none";
  document.getElementById("Reg").style="display:none";
  document.getElementById("Prof").style="display:block";
  document.getElementById("Pr").style="background-color:unset";
  document.getElementById("Ne").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Me").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Lo").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Re").style="background-color: rgba(0,0,0,0.5)";
}
function News() {
  document.getElementById("Prof").style="display:none";
  document.getElementById("Mes").style="display:none";
  document.getElementById("Log").style="display:none";
  document.getElementById("Reg").style="display:none";
  document.getElementById("News").style="display:block";
  document.getElementById("Pr").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Ne").style="background-color:unset";
  document.getElementById("Me").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Lo").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Re").style="background-color: rgba(0,0,0,0.5)";
}
function Message() {
  document.getElementById("News").style="display:none";
  document.getElementById("Prof").style="display:none";
  document.getElementById("Log").style="display:none";
  document.getElementById("Reg").style="display:none";
  document.getElementById("Mes").style="display:block";
  document.getElementById("Pr").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Ne").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Me").style="background-color:unset";
  document.getElementById("Lo").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Re").style="background-color: rgba(0,0,0,0.5)";
}
function LogIn() {
  document.getElementById("News").style="display:none";
  document.getElementById("Prof").style="display:none";
  document.getElementById("Mes").style="display:none";
  document.getElementById("Reg").style="display:none";
  document.getElementById("Log").style="display:block";
  document.getElementById("Pr").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Ne").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Me").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Lo").style="background-color:unset";
  document.getElementById("Re").style="background-color: rgba(0,0,0,0.5)";
}
function Registration() {
  document.getElementById("News").style="display:none";
  document.getElementById("Mes").style="display:none";
  document.getElementById("Log").style="display:none";
  document.getElementById("Prof").style="display:none";
  document.getElementById("Reg").style="display:block";
  document.getElementById("Pr").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Ne").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Me").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Lo").style="background-color: rgba(0,0,0,0.5)";
  document.getElementById("Re").style="background-color:unset";
}
btn.onclick = function(){
    modal.style.display = "block";
    btn.style = "background-color: rgba(0,0,0,0.1);box-shadow: 0px -2px 2px black;"
}
smallBtn.onclick = function(){
    if (smallMenu.style.display=="" || smallMenu.style.display=="none") {
        smallMenu.style.display="block";
    }
    else{
        smallMenu.style.display="none";
    }
}
 
 
 
smallMusicBtn.onclick = function(){
    if (smallMusicBtn.style.display=="" || smallMusicBtn.style.display=="none") {
        modal.style.display="block";
    }
    else{
        modal.style.display="none";
    }
}
play.onclick = function(){
    if (pause.style.display == "" || pause.style.display == "none") {
        play.style.display = "none";
        pause.style.display = "block";
    }
}
pause.onclick = function(){
    if(play.style.display == "none"){
        play.style.display = "block";
        pause.style.display = "none";
    }
}
 
setting.onclick = function(){
    if (settingMenu.style.display == "none") {
        settingMenu.style.display = "block;"
    }
}
 
window.onclick = function(event) {
    if (event.target == modal) {
        modal.style.display = "none";
        btn.style = "";
    }
    if (event.target == smallMenu){
        smallMenu.style.display = "none";
    }
    if(event.target == smallMusicMenu){
        smallMusicMenu.style.display="none";
    }
    if (event.target == epb) {
        epb.style.display == "none";
    }
}
window.onresize = function(){
if( window.innerWidth >= 710 ){
      smallMenu.style.display = "none";
      audioMenu.style.display = "none";
}
else{
    audioMenu.style.display = "block";
}
}
    </script>
</body>
</html>
Добавлено через 1 минуту
У меня не получается при нажатии на кнопку Settings показать скрытый див блок
0
Эксперт JS
6496 / 3907 / 2006
Регистрация: 14.06.2018
Сообщений: 6,781
16.01.2020, 06:31
Лучший ответ Сообщение было отмечено Hakob666 как решение

Решение

Цитата Сообщение от Hakob666 Посмотреть сообщение
У меня не получается при нажатии на кнопку Settings показать скрытый див блок
JavaScript
1
        settingMenu.style.display = "block;"
Точку с запятой вынесите из строки в конец инструкции.
1
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
raxper
Эксперт
30234 / 6612 / 1498
Регистрация: 28.12.2010
Сообщений: 21,154
Блог
16.01.2020, 06:31
Помогаю со студенческими работами здесь

Изменить стиль внутреннего блока при наведении мышки
Есть код div.container{ border: 2px solid green; width: 200px; height: 100px; position: relative; margin: 0px; padding:...

Не получается изменить стиль меню
Добрый день, вопрос вроде бы простой, но всю голову уже сломал. Есть сайт: http://anewtime.su. Вверху горизонтальное меню на прозрачном...

Как изменить стиль формы и вообще всех объектов на свой стиль?
Собственно вопрос в том как изменить стиль формы и вообще всех объектов на свой стиль?

Выпадение блока див
Добрый вечер, никак не могу решить проблему в подвале вот здесь http://musor-uborka.ru/landing/ при увеличении масштаба, а так же на...

Три блока див в хедере
В хедере разместил три блока 1_левый 2_средний и 3_правый. правый и левый я понял как установить, чтобы они сохраняли свое положение при...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
3
Ответ Создать тему
Новые блоги и статьи
SDL3 для Web (WebAssembly): Реализация движения на Box2D v3 - трение и коллизии с повёрнутыми стенами
8Observer8 20.02.2026
Содержание блога Box2D позволяет легко создать главного героя, который не проходит сквозь стены и перемещается с заданным трением о препятствия, которые можно располагать под углом, как верхнее. . .
Конвертировать закладки radiotray-ng в m3u-плейлист
damix 19.02.2026
Это можно сделать скриптом для PowerShell. Использование . \СonvertRadiotrayToM3U. ps1 <path_to_bookmarks. json> Рядом с файлом bookmarks. json появится файл bookmarks. m3u с результатом. # Check if. . .
Семь CDC на одном интерфейсе: 5 U[S]ARTов, 1 CAN и 1 SSI
Eddy_Em 18.02.2026
Постепенно допиливаю свою "многоинтерфейсную плату". Выглядит вот так: https:/ / www. cyberforum. ru/ blog_attachment. php?attachmentid=11617&stc=1&d=1771445347 Основана на STM32F303RBT6. На борту пять. . .
Камера Toupcam IUA500KMA
Eddy_Em 12.02.2026
Т. к. у всяких "хикроботов" слишком уж мелкий пиксель, для подсмотра в ESPriF они вообще плохо годятся: уже 14 величину можно рассмотреть еле-еле лишь на экспозициях под 3 секунды (а то и больше),. . .
И ясному Солнцу
zbw 12.02.2026
И ясному Солнцу, и светлой Луне. В мире покоя нет и люди не могут жить в тишине. А жить им немного лет.
«Знание-Сила»
zbw 12.02.2026
«Знание-Сила» «Время-Деньги» «Деньги -Пуля»
SDL3 для Web (WebAssembly): Подключение Box2D v3, физика и отрисовка коллайдеров
8Observer8 12.02.2026
Содержание блога Box2D - это библиотека для 2D физики для анимаций и игр. С её помощью можно определять были ли коллизии между конкретными объектами и вызывать обработчики событий столкновения. . . .
SDL3 для Web (WebAssembly): Загрузка PNG с прозрачным фоном с помощью SDL_LoadPNG (без SDL3_image)
8Observer8 11.02.2026
Содержание блога Библиотека SDL3 содержит встроенные инструменты для базовой работы с изображениями - без использования библиотеки SDL3_image. Пошагово создадим проект для загрузки изображения. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru