Java Script / неполадки

Статус
В этой теме нельзя размещать новые ответы.

Black_Bird

Участник
Автор темы
59
4
Что в коде не так?
Html:
Код:
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
    <link rel="stylesheet" type="text/css" href="style.css">
    <meta name="viewport" content="width=device-wight">
    <title>SoftWest Corporation</title>
    <style>
}
    </style>
</head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".about").click(function(){
    $(".SoftWest").fadeOut(1000);
    $(".Comp").fadeOut(1000);
});
  $(".golovna").click(function(){
    $(".SoftWest").eq(0).fadeIn(1000);
    $(".Comp").eq(0).fadeIn(1000);
});
  });
</script>
<body leftmargin="0" topmargin="0" bottommargin="0" rightmargin="0">
    <div class="logo">
        <img src="logo.png">
<div class="background">
    <img src="back.png">
<div class="golovna" id="gl">
<a><u>Головна</u></a>
  <div class="about" id="ab">
  <a><u>Про розробників</u></a>
    <div class="project">
        <a><u>Проекти</u></a>
        <div class="SoftWest" id="soft1">
            <h1>Soft West</h1>
       <div class="Comp" id="comp1">
        <h5>Компанія Веб розробки</h5>
        </div>
       </div>
        </div>
</div>
    </div>
  </div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Css:
Код:
.wrap
{
    width: 100%;
max-width: 1100px;
margin: 0 auto;
}
.logo img
{
width: 13%;
height: 8%;
position: absolute;
top: -1%;
left: 1%;  
}
.background img
{
   
width: 101%;
height: 93%;
position: absolute;
top: 7%;
left: -1%;
}
.golovna a
{
    font-family: 'Times New Roman';
font-size: 2.5vw;
color: black;
position: absolute;
top: 1%;
left: 25%;
}
.golovna a:hover
{
     transition: 0.5s;
color: grey;
font-size: 3vw;
position: absolute;
top: 0%;
left: 24%;
}
.about a
{
    font-family: 'Times New Roman';
font-size: 2.5vw;
color: black;
position: absolute;
top: 1%;
left: 48%;
}
.about a:hover
{
color: grey;
font-size: 3vw;
position: absolute;
top: 0%;
left: 47%; 
}
.project a
{
    font-family: 'Times New Roman';
font-size: 2.5vw;
color: black;
position: absolute;
top: 1%;
left: 80%;
}
.project a:hover
{
      transition: 0.5s;
color: grey;
font-size: 3vw;
position: absolute;
top: 0%;
left: 79%; 
}
.SoftWest h1
{
   
    font-weight: normal;
    animation-name: start;
    animation-duration: 0.7s;
    animation-timing-function: ease-in;
    font-family: 'Archive';
    color: white;
    
font-size: 13vw;
position: absolute;
left: 15%;
}
.Comp h5
{
        animation-name: startcomp;
    animation-duration: 0.7s;
    animation-timing-function: linear;
    font-weight: 100;
font-family: 'square721 BT';
font-size: 5vw;
color: white;
font-weight: lighter;
position: absolute;
left: 25%;
top: 20%;
}
@keyframes startcomp{
0%{
    animation-delay:  1s;
transform: translateY(-1000%);
}
100%{
transform: translateY(0%);
}
}
@keyframes start
{
0%
{
transform: translateY(-100%);
}
100%
{
transform: translateY(0%);
}
}


Ps: при нажатии кнопки about надпись исчезает и снова появляется
 

Black_Bird

Участник
Автор темы
59
4
У тебя не с JS неполадки , а со всем ***** . Хотел бы узнать ,чем ты занимаешься ? А именно: "Ты учишь JS?" ; "Знаешь ли ты html и css на должном уровне ?"
Хмм.. а для чего сделан этот форум? И для чего сам раздел?
 

Alfinity

Известный
94
52
1) Тэг <meta charset> и оба тэга <script> за пределами head
2) В <head> тэг <style> со скобкой, зачем?
3) 4 лишних </div>
4) leftmargin="0" topmargin="0" bottommargin="0" rightmargin="0" заменить на style="margin: 0"
5) <meta name="viewport" content="width=device-wight">: device-wight заменить на device-width
6)
Код:
$(".about").click(function(){
    $(".SoftWest").fadeOut(1000);
    $(".Comp").fadeOut(1000); // .Comp наследник .SoftWest, следовательно эту строчку можно убрать
});
$(".golovna").click(function(){
     $(".SoftWest").eq(0).fadeIn(1000); // Смысл от eq?
     $(".Comp").eq(0).fadeIn(1000); // Тоже самое, можно убрать
});
 
  • Нравится
Реакции: Black_Bird
Статус
В этой теме нельзя размещать новые ответы.