Форум программистов, компьютерный форум, киберфорум
HTML, CSS
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 5.00/22: Рейтинг темы: голосов - 22, средняя оценка - 5.00
0 / 0 / 0
Регистрация: 26.01.2015
Сообщений: 37

Анимация при наведении на лого

07.02.2015, 00:28. Показов 4247. Ответов 7
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Нужна помощь в написании кода. Сам еще не особо разбираюсь в анимации, поэтому буду очень рад если кто поможет.

Идея в следующем:

Есть навигационное меню, в центре стоит логотип...


При наведении курсора логотип должен становится вот таким


По идее нижняя полоса плавно появляется из под лого


Как это реализовать к сожалению я не знаю, заранее спасибо всем кто отзовется

Комментарий администратора TaatshiЗагружайте изображения и файлы на форум и прикрепляйте к сообщению.
Обновленная Памятка «Как работать в редакторе сообщений»
0
Programming
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
07.02.2015, 00:28
Ответы с готовыми решениями:

оборот букв при наведении всю область лого
буква ( с )она сейчас делает оборот при наведении на нее, а нужно чтобы когда курсор наводишь на все лого, сайт олаs.kiev.юа <div...

Анимация при наведении мыши
С помощью чего можно сделать такую анимацию или может кто-то может скопировать. Анимация собственно в верхней части сайта, работает при...

Анимация объекта при наведении
подскажите пожалуйста, как можно реализовать анимацию flipInY при наведении мышью на какой либо объект? @keyframes flipInY { 0% { ...

7
 Аватар для cellse
70 / 68 / 22
Регистрация: 12.08.2013
Сообщений: 297
07.02.2015, 00:45
Прячьте эти углоки под логотип, при наведении курсора меняйте их положение во время анимации...
Читайте про transition, animation, transform. Ссылок в поиске полно с примерами.
0
0 / 0 / 0
Регистрация: 26.01.2015
Сообщений: 37
07.02.2015, 01:23  [ТС]
Вот что у меня получилось
http://codepen.io/RuslanAGRO/pen/ngJsm

html
HTML5
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
<html>
<head>
  <link href='http://fonts.googleapis.com/css?family=Fjalla+One' rel='stylesheet' type='text/css'>
  <link href='http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' rel='stylesheet' type='text/css'>
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  <script src="http://codepen.io/assets/editor/live/css_live_reload_init.js"></script>
</head>
<body>
  <div class="slider">
    <input type="radio" id="control-1" name="slider-control" checked>
    <input type="radio" id="control-2" name="slider-control">
    <input type="radio" id="control-3" name="slider-control">
    <div class="slide" id="slide-1">
      <label for="control-3" class="fa fa-chevron-left fa-4x previous"></label>
      <label for="control-2" class="fa fa-chevron-right fa-4x next"></label>
      <h1><span></span>It doesn<span></span>t make sense to hire smart<br> people and then tell them what to do<span>;</span><br> we hire smart people so they can tell<br> us what to do<span></span>
        — Steve Jobs</h1>
    </div>
 
    <div class="slide" id="slide-2">
      <label for="control-1" class="fa fa-chevron-left fa-4x previous"></label>
      <label for="control-3" class="fa fa-chevron-right fa-4x next"></label>
    </div>
 
    <div class="slide" id="slide-3">
      <label for="control-2" class="fa fa-chevron-left fa-4x previous"></label>
      <label for="control-1" class="fa fa-chevron-right fa-4x next"></label>
    </div>
  </div>
  <div id="wrapper">
  <!-- HTML 5 NAVIGATION TAG -->
        <nav>
            <ol>
        <!-- Li that contains the logo for mobile -->
                <li id="logo_mobile">
                    <a href="#">menu</a>
                </li>
                <li class="items">
                    <a href="#">home</a>
                </li>
                <li class="items">
                    <a href="#">portfolio</a>
                </li>
        <!-- Li that contains the logo for desktop -->
                <li id="logo_desktop">
                    <a href="#"><img src="http://kautarov.ru/wp-content/uploads/2015/02/logo-active.png" width="50%" height="50%" /></a>
              <img class="arr1" src="http://kautarov.ru/wp-content/uploads/2015/02/logo-line.png" width="10%" height="10%" alt="arrow">
              <img class="arr2" src="http://kautarov.ru/wp-content/uploads/2015/02/logo-line.png" width="10%" height="10%" alt="arrow">
                </li>
                <li class="items">
                    <a href="#">berzloyshop</a>
                </li>
                <li class="items">
                    <a href="#">contacts</a>
                </li>
            </ol>
            <div class="clear"></div>
        </nav>
    </div>
</html>


css
CSS
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
* {
  margin: 0;
  padding: 0;
}
body{
  color: black;
  font-family: Fjalla One;
  font-weight: bold;
  font-size: 18px;
  background: #fff;
    }
 
#wrapper {
    width: 960px;
    margin: 0 auto;
  /* to create a boundary for the absolute position nav, for mobile*/
    position: relative;
    }
    
nav{
    width: 100%;
    }
 
ol {
    list-style-type: none;
    padding-left: 0;
    }
 
li {
    float: left;
  /* responsive width*/
    width: 20%;
    height: 20px;
    background: #fff;
    text-align: center;
    }
    
#logo_mobile{
  /* hides <li> element that contains the mobile logo when the page display the desktop version*/
    display: none;
    }
    
.items {
  /*to verticallt align one liners. it has to be the same amount of pixels than the height of the parent element*/
    line-height: 20px;
   padding:39px 0;
    }
    
a {
    display: block;
    width: 100%;
    color: black;
    text-transform: uppercase;
   text-decoration: none;
    }
 
a:hover {
    color: #e4ba16;
    }   
 
.clear{
    clear: both;
    }
 
h1{
    color: black;
    }
    
p {
    text-align: center;
    color: black;
    }
    
/* MEDIA QUERIES */
@media all and (max-width: 980px) {
    
  /* responsive width*/
    #wrapper {
    width: 100%;
    }
    
}
 
@media all and (max-width: 700px) {
    
  /* to avoid pushing down the content when toggle happens*/
    nav{
        position: absolute;
        }
    
  /* vertical menu*/
    li {
    float: none;
    width: 100%;
    }
    
    #logo_mobile{
      /* shows the logo for mobile */
        display: block;
        background-image:url([url]http://kautarov.ru/wp-content/uploads/2015/02/logo.png);[/url]
        background-repeat: no-repeat;
        background-size:contain;
        line-height: 45px;
    }
    
    #logo_desktop{
      /* hides the desktop logo */
        display: none;
        }
        
    li{
    height: 45px;
    }
    
    .items {
    line-height: 45px;
    display: none;
    }
    
    section{
      /*pushes the content below the nav*/
        padding-top: 60px;
        }
    
}
/*arrows logo*/
div {
  width: 100%;
  height: 382px;
}
.arr1, .arr2 {
  position: absolute;
  left: 432px;
  top: 70px;
  opacity: 0;
}
#logo_desktop:hover .arr2 {
  -webkit-animation-name: flash-arrow2;
  -webkit-animation-duration: 0.5s;
  -webkit-animation-fill-mode: forwards;
  animation-name: flash-arrow2;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
}
 
#logo_desktop:hover .arr1 {
  -webkit-animation-name: flash-arrow1;
  -webkit-animation-duration: 0.2s;
  -webkit-animation-fill-mode: forwards;
  animation-name: flash-arrow1;
  animation-duration: 0.2s;
  animation-fill-mode: forwards;
}
 
@keyframes flash-arrow1 {
  to {
    opacity: 1;
    top: 70px;
  }
}
 
@keyframes flash-arrow2 {
  to {
    opacity: 1;
    top: 70px;
  }
}
 
@-webkit-keyframes flash-arrow1 {
  to {
    opacity: 1;
    top: 105px;
  }
}
 
@-webkit-keyframes flash-arrow2 {
  to {
    opacity: 1;
    top: 124px;
  }
}
/*arrows logo end*/
 
* {
  box-sizing:border-box;
}
 
body {
  text-align:center;
}
 
input[type=radio] {
   position: absolute;
   top: -9999px;
   left: -9999px;
}
 
label { 
  margin: 10px 0;
  cursor: pointer;
}
 
.slider {
  width:100%;
  height:550px;
  overflow:hidden;
  position:absolute;
  margin-top: 98px;
}
.slide {
  width:100%;
  height:550px;
  position:absolute;
  transition: left ease-in-out 1000ms;
}
 
.previous {
  float:left;
  margin-top:250px;
  display:block;
  opacity:0;
  transition: opacity ease-in-out 300ms;
}
 
.slide:hover > .previous {
  opacity:0.2;
}
 
 
.previous:hover{
  opacity:1 !important;
}
 
.next {
  float:right;
  margin-top:250px;
  display:block;
  opacity:0;
  transition: opacity ease-in-out 300ms;
}
 
.slide:hover > .next {
  opacity:0.2;
}
 
.next:hover{
  opacity:1 !important;
}
 
 
#slide-1 {
  background-image: url([url]http://kautarov.ru/wp-content/uploads/2014/12/BG.png);[/url]
   background-position: center;
}
#slide-1 h1{
  color: white;
  font-size: 45px;
  text-transform: uppercase;
  padding-top:150px;
}
#slide-1 span{
  color: #e4ba16;
}
 
#slide-2 {
  background-image: url([url]http://kautarov.ru/wp-content/uploads/2015/02/Slider2.jpg);[/url]
   background-position: top,center;
}
 
#slide-3 {
  background-image: url([url]http://kautarov.ru/wp-content/uploads/2015/02/Slider3.jpg);[/url]
   background-position: bottom, center;
}
 
input[type=radio]#control-1:checked ~ div#slide-1 {
   left:0; 
}
 
input[type=radio]#control-1:checked ~ div#slide-2 {
   left:100%; 
}
 
input[type=radio]#control-1:checked ~ div#slide-3 {
   left:200%; 
}
 
input[type=radio]#control-2:checked ~ div#slide-2 {
   left:0; 
}
 
input[type=radio]#control-2:checked ~ div#slide-3 {
   left:100%; 
}
 
input[type=radio]#control-2:checked ~ div#slide-1 {
   left:-100%; 
}
 
input[type=radio]#control-3:checked ~ div#slide-2 {
   left:-100%; 
}
 
input[type=radio]#control-3:checked ~ div#slide-3 {
   left:0; 
}
 
input[type=radio]#control-3:checked ~ div#slide-1 {
   left:-200%; 
}


js
JavaScript
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
// function for menu toggle
function mobile_menu(){
// fetch the windows with  
$(window).width();
    
  // if statement that act as media query
    if($(window).width() < 700){
        
    /* hides the menu items*/
        $(".items").css('display', 'none');
            
     /* click event - unbinded to avoid get fired several times on resize */    $("#logo_mobile").unbind("click").click(function(){
            
     // toggle menu items
            $(".items").slideToggle();
            });
    
        } else {
            
            // display nav var if it was hidden when resizing to a bigger width
            $(".items").css('display', 'block');
            
      // disables the click functionality for desktop version
            $( "#logo_mobile").unbind( "click" );
            
 
            }
    }
    
// function to track size of the screen
function text_size(){
  // fetches initial window with on load
    $(window).width();
    
  //print initial window width on page
    $("#screen_size").html($(window).width() + " pixels");
    
  // if statement based on window width
        if($(window).width() < 980 && $(window).width() > 701 ){
      
            $("#screen_msg").html("This is a responsive menu for a portrait sized ipad screen");
            
            }
            
        else if ($(window).width() <= 700){
            $("#screen_msg").html("This is an smart phone size toggle menu");
            }
            
        else {
            $("#screen_msg").html("This is a desktop size menu");
            }
        
    
    }
 
 
$(document).ready(function(e) {
    
    
  // call the functions on page load
    mobile_menu();
    text_size();
    
    
    // call the functions during windows resize
     $(window).resize(function(){
        
        mobile_menu();
        text_size();
        
        
        })
        
    
        
    
}); // end document.ready
 
$(document).ready(function(){
  var time = 4000;
  var index = 1;
  var count = $('.slide').length;
  function slide() {
        if (index > count)
            index = 1;
        $("#control-"+index).click();
        index++;
    }
  
  var slider = setInterval(slide,time);
  
  $('.slider').mouseenter(function(){
    clearInterval(slider);
    slider = null;
  });
  
  $('.slider').mouseleave(function(){
    slider = setInterval(slide,time);
  });
 
});
 
//@ sourceURL=pen.js


но как сделать так, что бы полоска появлялась именно тогда когда наводишь на лого?

 Комментарий администратора 
Правила форума пункт 5.19
Запрещено размещать ссылки на коды программ, расположенные на других сайтах. Коды программ должны размещаться на форуме.
Ссылка на песочницу - это бонус.
0
 Аватар для cellse
70 / 68 / 22
Регистрация: 12.08.2013
Сообщений: 297
07.02.2015, 01:27
В общем типа того
Вложения
Тип файла: rar Desktop.rar (137.2 Кб, 3 просмотров)
0
 Аватар для cellse
70 / 68 / 22
Регистрация: 12.08.2013
Сообщений: 297
07.02.2015, 01:28
jroo_agro, В общем типа того
0
0 / 0 / 0
Регистрация: 26.01.2015
Сообщений: 37
07.02.2015, 01:54  [ТС]
Спасибо, это очень помогло, вот только теперь я столкнулся с другой проблемой. Див получается уж очень большой и соответственно зона активации.
http://codepen.io/RuslanAGRO/pen/ngJsm?editors=110

HTML5
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
<html>
<head>
  <link href='http://fonts.googleapis.com/css?family=Fjalla+One' rel='stylesheet' type='text/css'>
  <link href='http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' rel='stylesheet' type='text/css'>
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  <script src="http://codepen.io/assets/editor/live/css_live_reload_init.js"></script>
</head>
<body>
  <div class="slider">
    <input type="radio" id="control-1" name="slider-control" checked>
    <input type="radio" id="control-2" name="slider-control">
    <input type="radio" id="control-3" name="slider-control">
    <div class="slide" id="slide-1">
      <label for="control-3" class="fa fa-chevron-left fa-4x previous"></label>
      <label for="control-2" class="fa fa-chevron-right fa-4x next"></label>
      <h1><span></span>It doesn<span></span>t make sense to hire smart<br> people and then tell them what to do<span>;</span><br> we hire smart people so they can tell<br> us what to do<span></span>
        — Steve Jobs</h1>
    </div>
 
    <div class="slide" id="slide-2">
      <label for="control-1" class="fa fa-chevron-left fa-4x previous"></label>
      <label for="control-3" class="fa fa-chevron-right fa-4x next"></label>
    </div>
 
    <div class="slide" id="slide-3">
      <label for="control-2" class="fa fa-chevron-left fa-4x previous"></label>
      <label for="control-1" class="fa fa-chevron-right fa-4x next"></label>
    </div>
  </div>
  <div id="wrapper">
  <!-- HTML 5 NAVIGATION TAG -->
        <nav>
            <ol>
        <!-- Li that contains the logo for mobile -->
                <li id="logo_mobile">
                    <a href="#">menu</a>
                </li>
                <li class="items">
                    <a href="#">home</a>
                </li>
                <li class="items">
                    <a href="#">portfolio</a>
                </li>
        <!-- Li that contains the logo for desktop -->
                <li id="logo_desktop">
                    <a href="#"><img src="http://kautarov.ru/wp-content/uploads/2015/02/logo-active.png" width="50%" height="50%" /></a>
              <img class="arr1" src="http://kautarov.ru/wp-content/uploads/2015/02/logo-line.png" width="10%" height="10%" alt="arrow">
              <img class="arr2" src="http://kautarov.ru/wp-content/uploads/2015/02/logo-line.png" width="10%" height="10%" alt="arrow">
                </li>
                <li class="items">
                    <a href="#">berzloyshop</a>
                </li>
                <li class="items">
                    <a href="#">contacts</a>
                </li>
            </ol>
            <div class="clear"></div>
        </nav>
    </div>
</html>
CSS
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
* {
  margin: 0;
  padding: 0;
}
body{
  color: black;
  font-family: Fjalla One;
  font-weight: bold;
  font-size: 18px;
  background: #fff;
    }
 
#wrapper {
    width: 960px;
    margin: 0 auto;
  /* to create a boundary for the absolute position nav, for mobile*/
    position: relative;
    }
    
nav{
    width: 100%;
    }
 
ol {
    list-style-type: none;
    padding-left: 0;
    }
 
li {
    float: left;
  /* responsive width*/
    width: 20%;
    height: 20px;
    background: #fff;
    text-align: center;
    }
    
#logo_mobile{
  /* hides <li> element that contains the mobile logo when the page display the desktop version*/
    display: none;
    }
    
.items {
  /*to verticallt align one liners. it has to be the same amount of pixels than the height of the parent element*/
    line-height: 20px;
   padding:39px 0;
    }
    
a {
    display: block;
    width: 100%;
    color: black;
    text-transform: uppercase;
   text-decoration: none;
    }
 
a:hover {
    color: #e4ba16;
    }   
 
.clear{
    clear: both;
    }
 
h1{
    color: black;
    }
    
p {
    text-align: center;
    color: black;
    }
    
/* MEDIA QUERIES */
@media all and (max-width: 980px) {
    
  /* responsive width*/
    #wrapper {
    width: 100%;
    }
    
}
 
@media all and (max-width: 700px) {
    
  /* to avoid pushing down the content when toggle happens*/
    nav{
        position: absolute;
        }
    
  /* vertical menu*/
    li {
    float: none;
    width: 100%;
    }
    
    #logo_mobile{
      /* shows the logo for mobile */
        display: block;
        background-image:url([url]http://kautarov.ru/wp-content/uploads/2015/02/logo.png);[/url]
        background-repeat: no-repeat;
        background-size:contain;
        line-height: 45px;
    }
    
    #logo_desktop{
      /* hides the desktop logo */
        display: none;
        }
        
    li{
    height: 45px;
    }
    
    .items {
    line-height: 45px;
    display: none;
    }
    
    section{
      /*pushes the content below the nav*/
        padding-top: 60px;
        }
    
}
/*arrows logo*/
div {
  width: 100%;
  height: 382px;
}
.arr1, .arr2 {
  position: absolute;
  left: 432px;
  top: 70px;
  opacity: 0;
}
#logo_desktop:hover .arr2 {
  -webkit-animation-name: flash-arrow2;
  -webkit-animation-duration: 0.5s;
  -webkit-animation-fill-mode: forwards;
  animation-name: flash-arrow2;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
}
 
#logo_desktop:hover .arr1 {
  -webkit-animation-name: flash-arrow1;
  -webkit-animation-duration: 0.2s;
  -webkit-animation-fill-mode: forwards;
  animation-name: flash-arrow1;
  animation-duration: 0.2s;
  animation-fill-mode: forwards;
}
 
@keyframes flash-arrow1 {
  to {
    opacity: 1;
    top: 70px;
  }
}
 
@keyframes flash-arrow2 {
  to {
    opacity: 1;
    top: 70px;
  }
}
 
@-webkit-keyframes flash-arrow1 {
  to {
    opacity: 1;
    top: 105px;
  }
}
 
@-webkit-keyframes flash-arrow2 {
  to {
    opacity: 1;
    top: 124px;
  }
}
/*arrows logo end*/
 
* {
  box-sizing:border-box;
}
 
body {
  text-align:center;
}
 
input[type=radio] {
   position: absolute;
   top: -9999px;
   left: -9999px;
}
 
label { 
  margin: 10px 0;
  cursor: pointer;
}
 
.slider {
  width:100%;
  height:550px;
  overflow:hidden;
  position:absolute;
  margin-top: 98px;
}
.slide {
  width:100%;
  height:550px;
  position:absolute;
  transition: left ease-in-out 1000ms;
}
 
.previous {
  float:left;
  margin-top:250px;
  display:block;
  opacity:0;
  transition: opacity ease-in-out 300ms;
}
 
.slide:hover > .previous {
  opacity:0.2;
}
 
 
.previous:hover{
  opacity:1 !important;
}
 
.next {
  float:right;
  margin-top:250px;
  display:block;
  opacity:0;
  transition: opacity ease-in-out 300ms;
}
 
.slide:hover > .next {
  opacity:0.2;
}
 
.next:hover{
  opacity:1 !important;
}
 
 
#slide-1 {
  background-image: url([url]http://kautarov.ru/wp-content/uploads/2014/12/BG.png);[/url]
   background-position: center;
}
#slide-1 h1{
  color: white;
  font-size: 45px;
  text-transform: uppercase;
  padding-top:150px;
}
#slide-1 span{
  color: #e4ba16;
}
 
#slide-2 {
  background-image: url([url]http://kautarov.ru/wp-content/uploads/2015/02/Slider2.jpg);[/url]
   background-position: top,center;
}
 
#slide-3 {
  background-image: url([url]http://kautarov.ru/wp-content/uploads/2015/02/Slider3.jpg);[/url]
   background-position: bottom, center;
}
 
input[type=radio]#control-1:checked ~ div#slide-1 {
   left:0; 
}
 
input[type=radio]#control-1:checked ~ div#slide-2 {
   left:100%; 
}
 
input[type=radio]#control-1:checked ~ div#slide-3 {
   left:200%; 
}
 
input[type=radio]#control-2:checked ~ div#slide-2 {
   left:0; 
}
 
input[type=radio]#control-2:checked ~ div#slide-3 {
   left:100%; 
}
 
input[type=radio]#control-2:checked ~ div#slide-1 {
   left:-100%; 
}
 
input[type=radio]#control-3:checked ~ div#slide-2 {
   left:-100%; 
}
 
input[type=radio]#control-3:checked ~ div#slide-3 {
   left:0; 
}
 
input[type=radio]#control-3:checked ~ div#slide-1 {
   left:-200%; 
}
0
 Аватар для cellse
70 / 68 / 22
Регистрация: 12.08.2013
Сообщений: 297
07.02.2015, 09:11
jroo_agro, http://codepen.io/anon/pen/jEaaMr
Вот готовый вариант. нужно было поменять позицию left у стрелок и при анимации их top.
HTML5
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
<html>
<head>
  <link href='http://fonts.googleapis.com/css?family=Fjalla+One' rel='stylesheet' type='text/css'>
</head>
<body>
    <div class="slider">
     
   </div>
  <div id="wrapper">
  <!-- HTML 5 NAVIGATION TAG -->
        <nav>
            <ol>
        <!-- Li that contains the logo for mobile -->
                <li id="logo_mobile">
                    <a href="#">menu</a>
                </li>
                <li class="items">
                    <a href="#">home</a>
                </li>
                <li class="items">
                    <a href="#">portfolio</a>
                </li>
        <!-- Li that contains the logo for desktop -->
                <li id="logo_desktop">
                    <a href="#"><img src="http://kautarov.ru/wp-content/uploads/2015/02/logo.png" width="50%" height="50%" /></a>
            <div>
              <img class="arr1" src="http://kautarov.ru/wp-content/uploads/2015/02/logo-line.png" width="10%" height="10%" alt="arrow">
              <img class="arr2" src="http://kautarov.ru/wp-content/uploads/2015/02/logo-line.png" width="10%" height="10%" alt="arrow">
            </div>
                </li>
                <li class="items">
                    <a href="#">berzloyshop</a>
                </li>
                <li class="items">
                    <a href="#">contacts</a>
                </li>
            </ol>
            <div class="clear"></div>
        </nav>
    <ul class="blocks">
      <li class="form"><img src="http://kautarov.ru/wp-content/uploads/2015/02/block1.png"/></li>
      <li class="form"><img src="http://kautarov.ru/wp-content/uploads/2015/02/block2.png"/></li>
      <li class="form"><img src="http://kautarov.ru/wp-content/uploads/2015/02/block3.png"/></li>
    </ul>
 </div>
</html>
CSS
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
* {
  margin: 0;
  padding: 0;
}
body{
  color: black;
  font-family: Fjalla One;
  font-weight: bold;
  font-size: 18px;
  background: #fff;
    }
 
 
#wrapper {
    width: 960px;
    margin: 0 auto;
  /* to create a boundary for the absolute position nav, for mobile*/
    position: relative;
    }
    
nav{
    width: 100%;
    }
 
ol {
    list-style-type: none;
    padding-left: 0;
    }
 
li {
    float: left;
  /* responsive width*/
    width: 20%;
    height: 20px;
    background: #fff;
    text-align: center;
    }
    
#logo_mobile{
  /* hides <li> element that contains the mobile logo when the page display the desktop version*/
    display: none;
    }
    
.items {
  /*to verticallt align one liners. it has to be the same amount of pixels than the height of the parent element*/
    line-height: 20px;
   padding:39px 0;
    }
    
a {
    display: block;
    width: 100%;
    color: black;
    text-transform: uppercase;
   text-decoration: none;
    }
 
a:hover {
    color: #e4ba16;
    }   
 
.clear{
    clear: both;
    }
 
h1{
    color: black;
    }
    
p {
    text-align: center;
    color: black;
    }
    
/* MEDIA QUERIES */
@media all and (max-width: 980px) {
    
  /* responsive width*/
    #wrapper {
    width: 100%;
    }
    
}
 
@media all and (max-width: 700px) {
    
  /* to avoid pushing down the content when toggle happens*/
    nav{
        position: absolute;
        }
    
  /* vertical menu*/
    li {
    float: none;
    width: 100%;
    }
    
    #logo_mobile{
      /* shows the logo for mobile */
        display: block;
        background-image:url([url]http://kautarov.ru/wp-content/uploads/2015/02/logo.png);[/url]
        background-repeat: no-repeat;
        background-size:contain;
        line-height: 45px;
    }
    
    #logo_desktop{
      /* hides the desktop logo */
        display: none;
        }
        
    li{
    height: 45px;
    }
    
    .items {
    line-height: 45px;
    display: none;
    }
    
    section{
      /*pushes the content below the nav*/
        padding-top: 60px;
        }
    
}
/*arrows logo*/
div {
  width: 100%;
  height: 382px;
}
.arr1, .arr2 {
  position: absolute;
  left: 382px;
  top: 70px;
  opacity: 0;
}
#logo_desktop:hover .arr2 {
  -webkit-animation-name: flash-arrow2;
  -webkit-animation-duration: 0.5s;
  -webkit-animation-fill-mode: forwards;
  animation-name: flash-arrow2;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
}
 
#logo_desktop:hover .arr1 {
  -webkit-animation-name: flash-arrow1;
  -webkit-animation-duration: 0.2s;
  -webkit-animation-fill-mode: forwards;
  animation-name: flash-arrow1;
  animation-duration: 0.2s;
  animation-fill-mode: forwards;
}
 
@keyframes flash-arrow1 {
  to {
    opacity: 1;
    top: 90px;
  }
}
 
@keyframes flash-arrow2 {
  to {
    opacity: 1;
    top: 110px;
  }
}
 
@-webkit-keyframes flash-arrow1 {
  to {
    opacity: 1;
    top: 105px;
  }
}
 
@-webkit-keyframes flash-arrow2 {
  to {
    opacity: 1;
    top: 124px;
  }
}
/*arrows logo end*/
.slider{
  position: absolute;
  top: 98px;
  width: 100%;
  height: 500px;
  background-image: url("http://kautarov.ru/wp-content/uploads/2014/12/BG.png");
  background-position: center;
}
.form{
  display:inline-block;
  margin-right: 20px;
  margin-top: 160px;
  width:300px;
  height:131px;
  background: gray;
}
JavaScript
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
* {
  margin: 0;
  padding: 0;
}
body{
  color: black;
  font-family: Fjalla One;
  font-weight: bold;
  font-size: 18px;
  background: #fff;
    }
 
 
#wrapper {
    width: 960px;
    margin: 0 auto;
  /* to create a boundary for the absolute position nav, for mobile*/
    position: relative;
    }
    
nav{
    width: 100%;
    }
 
ol {
    list-style-type: none;
    padding-left: 0;
    }
 
li {
    float: left;
  /* responsive width*/
    width: 20%;
    height: 20px;
    background: #fff;
    text-align: center;
    }
    
#logo_mobile{
  /* hides <li> element that contains the mobile logo when the page display the desktop version*/
    display: none;
    }
    
.items {
  /*to verticallt align one liners. it has to be the same amount of pixels than the height of the parent element*/
    line-height: 20px;
   padding:39px 0;
    }
    
a {
    display: block;
    width: 100%;
    color: black;
    text-transform: uppercase;
   text-decoration: none;
    }
 
a:hover {
    color: #e4ba16;
    }   
 
.clear{
    clear: both;
    }
 
h1{
    color: black;
    }
    
p {
    text-align: center;
    color: black;
    }
    
/* MEDIA QUERIES */
@media all and (max-width: 980px) {
    
  /* responsive width*/
    #wrapper {
    width: 100%;
    }
    
}
 
@media all and (max-width: 700px) {
    
  /* to avoid pushing down the content when toggle happens*/
    nav{
        position: absolute;
        }
    
  /* vertical menu*/
    li {
    float: none;
    width: 100%;
    }
    
    #logo_mobile{
      /* shows the logo for mobile */
        display: block;
        background-image:url([url]http://kautarov.ru/wp-content/uploads/2015/02/logo.png);[/url]
        background-repeat: no-repeat;
        background-size:contain;
        line-height: 45px;
    }
    
    #logo_desktop{
      /* hides the desktop logo */
        display: none;
        }
        
    li{
    height: 45px;
    }
    
    .items {
    line-height: 45px;
    display: none;
    }
    
    section{
      /*pushes the content below the nav*/
        padding-top: 60px;
        }
    
}
/*arrows logo*/
div {
  width: 100%;
  height: 382px;
}
.arr1, .arr2 {
  position: absolute;
  left: 382px;
  top: 70px;
  opacity: 0;
}
#logo_desktop:hover .arr2 {
  -webkit-animation-name: flash-arrow2;
  -webkit-animation-duration: 0.5s;
  -webkit-animation-fill-mode: forwards;
  animation-name: flash-arrow2;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
}
 
#logo_desktop:hover .arr1 {
  -webkit-animation-name: flash-arrow1;
  -webkit-animation-duration: 0.2s;
  -webkit-animation-fill-mode: forwards;
  animation-name: flash-arrow1;
  animation-duration: 0.2s;
  animation-fill-mode: forwards;
}
 
@keyframes flash-arrow1 {
  to {
    opacity: 1;
    top: 90px;
  }
}
 
@keyframes flash-arrow2 {
  to {
    opacity: 1;
    top: 110px;
  }
}
 
@-webkit-keyframes flash-arrow1 {
  to {
    opacity: 1;
    top: 105px;
  }
}
 
@-webkit-keyframes flash-arrow2 {
  to {
    opacity: 1;
    top: 124px;
  }
}
/*arrows logo end*/
.slider{
  position: absolute;
  top: 98px;
  width: 100%;
  height: 500px;
  background-image: url("http://kautarov.ru/wp-content/uploads/2014/12/BG.png");
  background-position: center;
}
.form{
  display:inline-block;
  margin-right: 20px;
  margin-top: 160px;
  width:300px;
  height:131px;
  background: gray;
}
 Комментарий администратора 
Правила форума пункт 5.19
Запрещено размещать ссылки на коды программ, расположенные на других сайтах. Коды программ должны размещаться на форуме.
Ссылка на песочницу - это бонус.
0
0 / 0 / 0
Регистрация: 26.01.2015
Сообщений: 37
07.02.2015, 19:08  [ТС]
Не увидел разницу, можно ли сделать ховер к другому объекту, а то див слишком большой?. Стрелки начинают опускаться даже если рядом водить мышку

Добавлено через 12 минут
Все исправил, оказывается лишний див вставил
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
07.02.2015, 19:08
Помогаю со студенческими работами здесь

Анимация при наведении на ссылку
Подскажите пожалуйста, как сделать, что бы при наведении на ссылку, ее задний фон постепенно становился другого цвета, а когда убираем...

Анимация при наведении на изображение
Добрый день. Дизайнер нарисовал интересный вариант эффекта наведения на изображение. Есть у кого-нибудь идеи, как можно такое сделать?...

Анимация блика и смещения изображения при наведении мыши
Здравствуйте, такой вопрос, на этом сайте в портфолио, сделан крутой hover. Мне нужно реализовать такой же эффект, как этого можно...

Анимация при наведении мыши
Товарищи, подскажите код. Задача: при наведении мыши проигрывался следующий кадр, а когда курсор уберешь бал опять первый кадр, при...

Анимация при наведении мыши
Друзья, доброго времени суток. Как в JS можно сделать вот так (как на картинке), что бы при наведении мыши, зади выходили картинки?


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

Или воспользуйтесь поиском по форуму:
8
Ответ Создать тему
Новые блоги и статьи
http://iceja.net/ математические сервисы
iceja 20.01.2026
Обновила свой сайт http:/ / iceja. net/ , приделала Fast Fourier Transform экстраполяцию сигналов. Однако предсказывает далеко не каждый сигнал (см ограничения http:/ / iceja. net/ fourier/ docs ). Также. . .
http://iceja.net/ сервер решения полиномов
iceja 18.01.2026
Выкатила http:/ / iceja. net/ сервер решения полиномов (находит действительные корни полиномов методом Штурма). На сайте документация по API, но скажу прямо VPS слабенький и 200 000 полиномов. . .
Расчёт переходных процессов в цепи постоянного тока
igorrr37 16.01.2026
/ * Дана цепь постоянного тока с R, L, C, k(ключ), U, E, J. Программа составляет систему уравнений по 1 и 2 законам Кирхгофа, решает её и находит переходные токи и напряжения на элементах схемы. . . .
Восстановить юзерскрипты Greasemonkey из бэкапа браузера
damix 15.01.2026
Если восстановить из бэкапа профиль Firefox после переустановки винды, то список юзерскриптов в Greasemonkey будет пустым. Но восстановить их можно так. Для этого понадобится консольная утилита. . .
Сукцессия микоризы: основная теория в виде двух уравнений.
anaschu 11.01.2026
https:/ / rutube. ru/ video/ 7a537f578d808e67a3c6fd818a44a5c4/
WordPad для Windows 11
Jel 10.01.2026
WordPad для Windows 11 — это приложение, которое восстанавливает классический текстовый редактор WordPad в операционной системе Windows 11. После того как Microsoft исключила WordPad из. . .
Classic Notepad for Windows 11
Jel 10.01.2026
Old Classic Notepad for Windows 11 Приложение для Windows 11, позволяющее пользователям вернуть классическую версию текстового редактора «Блокнот» из Windows 10. Программа предоставляет более. . .
Почему дизайн решает?
Neotwalker 09.01.2026
В современном мире, где конкуренция за внимание потребителя достигла пика, дизайн становится мощным инструментом для успеха бренда. Это не просто красивый внешний вид продукта или сайта — это. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru