Javascript-форум (https://javascript.ru/forum/)
-   jQuery (https://javascript.ru/forum/jquery/)
-   -   Восстановление значения после ховер (https://javascript.ru/forum/jquery/52000-vosstanovlenie-znacheniya-posle-khover.html)

Dark_Knight 29.11.2014 17:59

Восстановление значения после ховер
 
Как после того как я убрал курсор с элемента восстановить старое значение opacity?

krutoy 29.11.2014 23:18

Так оно и так должно восстанавливаться
<html>
<head>
<meta charset="windows-1251" />
<style>
.first{
 background: blue;
 color: white;
 position: absolute;
 top: 10px;
 width: 200px;
 height: 200px
}
.second{
 opacity: 1;
 background: red;
 color: white;
 position: absolute;
 top: 10px;
 width: 200px;
 height: 200px
}
a:hover{opacity: 0.1}
</style>
</head>
<body>

<a id="first" class="first">FIRST</a>
<a id="second" class="second"></a>


<script>

</script>
</body>
</html>

Dark_Knight 30.11.2014 12:48

Анимации то нет, а он нужна.

tsigel 01.12.2014 06:30

<html>
<head>
<meta charset="windows-1251" />
<style>
.first{
 background: blue;
 color: white;
 position: absolute;
 top: 10px;
 width: 200px;
 height: 200px;
-webkit-transition: all 1s;
     -moz-transition: all 1s;
     -o-transition: all 1s;
     transition: all 1s;
}
.second{
 opacity: 1;
 background: red;
 color: white;
 position: absolute;
 top: 10px;
 width: 200px;
 height: 200px;
-webkit-transition: all 1s;
-moz-transition: all 1s;
-o-transition: all 1s;
transition: all 1s;
}
a:hover{opacity: 0.1}
</style>
</head>
<body>

<a id="first" class="first">FIRST</a>
<a id="second" class="second"></a>


<script>

</script>
</body>
</html>


Часовой пояс GMT +3, время: 08:55.