2016-11-27 10 views
3

Принял несколько часов, чтобы полностью перестроить стандартный тег <blockquote>, и теперь я застрял на последнем шаге, анимации. Я пробовал все, что есть, но может заставить его работать правильно. Если бы кто-то мог мне помочь, я бы очень признателен.CSS LOVE! Анимированный фон в blockquote на мыши над работами, но на мышь отсутствует

В идеале я хотел бы щебетать птицы двигаться и исчезать в & out:

От ЛЕВЫЙ в CENTER (проявка, двигаясь по направлению к центру - на мыши над) и
От CENTER до RIGHT (выцветать при движении вправо - по выходу мыши)

У меня есть птица, движущаяся слева o наведите курсор мыши на мышь, но я не могу заставить его перемещаться из центра вправо по мыши.

Пожалуйста, обратите внимание <blockquote> настраивается с Псевдо классы & Элементы и выглядит следующим образом.

<blockquote> 
    <a href="#">Text link here</a> 
</blockquote> 

Я использовал 1 класс для связи, только для того, чтобы развернуть зону с кликом. Если вы знаете способ, который не связан с этим старым трюком, пожалуйста, дайте мне знать.

Пожалуйста, проверьте мои работы. Любые предложения или улучшения кода более чем приветствуются.

FIDDLE - https://jsfiddle.net/7kr7en1m

ответ

3

Я использовал this answer, чтобы помочь понять это.

Ключ был анимированным как левым, так и левым. Вот как это работает:

  1. Птица начинает справа от
  2. О парении, птица движется влево от без какой-либо анимации, установив margin-left 0, а затем начинает left недвижимость начинается анимация.
  3. После наведения птица анимирует птицу справа, потому что анимация margin-left была повторно применена.

a { 
 
    text-decoration: none; 
 
} 
 

 
a:link { 
 
    color: #f00; 
 
} 
 

 
a:visited { 
 
    color: #f00; 
 
} 
 

 
a:hover { 
 
    color: rgba(0, 0, 0, 0); 
 
} 
 

 
blockquote { 
 
    position: relative; 
 
    font-weight: 900; 
 
    font-size: 18px; 
 
    line-height: 22px; 
 
    text-align: left; 
 
    padding: 10px 35px 10px; 
 
    margin: 0 15px; 
 
    border: solid 1px rgb(220, 220, 220); 
 
    border-radius: 10px; 
 
    position: relative; 
 
    background-color: white; 
 
    box-shadow: 5px 5px 20px #e9edef; 
 
    width: 20%; 
 
    min-width: 200px; 
 
    float: right; 
 
\t overflow: hidden; 
 
} 
 

 
blockquote:hover { 
 
    
 
} 
 

 
a:after { 
 
    content: ''; 
 
    position: absolute; 
 
    width: 100%; 
 
    top: 0; 
 
    bottom: 0; 
 
    left: 0; 
 
    right: 0; 
 
    left: -90%; 
 
    margin-left: 200%; 
 
    transition: left 300ms linear, margin-left 300ms ease-out; 
 
    color: #009fff; 
 
    cursor: pointer; 
 
    background-image: url('http://image.prntscr.com/image/39b3926093f442c095554fb6a147ef01.png'); 
 
    background-repeat: no-repeat; 
 
    background-position: center; 
 
    background-size: contain; 
 
    /* transition: background-image 0.5s ease; 
 
    -moz-transition: all 0.5s ease; 
 
    -ms-transition: all 0.5s ease; 
 
    -webkit-transition: all 0.5s ease; 
 
    -o-transition: all 0.5s ease; */ 
 
} 
 

 
a:before { 
 
    content: ''; 
 
    transition: background-color 300ms ease; 
 
} 
 

 
a:hover:before { 
 
    position: absolute; 
 
    width: 100%; 
 
    top: 0; 
 
    bottom: 0; 
 
    left: 0; 
 
    right: 0; 
 
    background-position: center; 
 
    background-size: contain; 
 
    background-color: #009fff; 
 
    border: solid 1px #009fff; 
 
} 
 

 
a:hover:after { 
 
    transition: left 300ms ease-out; 
 
    margin-left: 0; 
 
    left: 0; 
 
}
<h3> 
 
What is Lorem Ipsum? 
 
</h3> 
 

 
<blockquote> 
 
    <a href="#" class="qoute-to-tweet">Animated Lorem Ipsum dummy text that is used in this quote is ready to be tweeted with one click</a> 
 
</blockquote> 
 

 
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

 Смежные вопросы

  • Нет связанных вопросов^_^