jquery - Need help adding caption with arrow over a div on mouseover event -


regarding hover effect, pelase check site http://www.rokivo.com/

i want such effect include headings,buttons , div in mysite.

thanks in advance

<div class="col-xs-12"> <a href="enquiry.html"><h3 class="orange2 pull-right contact-head">enquiry<br/><i class="fa fa-arrow-right black arrow4 pull-left"></i></h3></a> </div> 

i used jquery add css transition class on mouseenter , remove class on mouseleave looks odd. want similar effect in referral url above.

it sounds didn't want have arrow sliding infinitely removed infinite added longer arrow (fa-long-arrow-right) since mentioned "long arrow" in comments.

i added forwards arrow stay @ end position of animation , not go beginning. animation-fill-mode

.contact-head{  	font-size:17px !important;  	padding:15px !important;  	border:2px solid #555 !important;  	border-bottom:5px solid #ffc000 !important;  	min-width:270px;  	max-width:270px;  }      @-webkit-keyframes arrow-jump3 {    0%   { opacity: 0;    -webkit-transform: translatex(25px);          -moz-transform: translatex(25px);          -0-transform: translatex(25px);          transform: translatex(25px);    }    100% { opacity: 1;            -webkit-transform: translatex(160px);          -moz-transform: translatex(160px);          -0-transform: translatex(160px);          transform: translatex(160px);      }   }  .arrow4 {    -webkit-animation: arrow-jump3 1s forwards; /* safari 4+ */    -moz-animation:    arrow-jump3 1s forwards; /* fx 5+ */    -o-animation:      arrow-jump3 1s forwards; /* opera 12+ */    animation:         arrow-jump3 1s forwards; /* ie 10+, fx 29+ */     }  .contact-head i{  	 display:none;  }  .contact-head:hover > i{  margin-top:10px;	  display:block;  }	  .contact-head:hover{  	background:#ffc000 !important;  	color:#000 !important;  	border-bottom:2px solid #555 !important;  }    .contact h3{  	margin:20px 0px 20px 0px;  	font-size:19px;  }  a{    text-decoration:none;  }
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/>  <div class="col-xs-12">	<a href="enquiry.html"><h3 class="orange2 pull-right contact-head">enquiry<br/><i class="fa fa-long-arrow-right black arrow4 pull-left"></i></h3></a> </div>  	<div class="col-xs-12">	<a href="servicecall.html"><h3 class="orange2 pull-right contact-head">register service call<br/><i class="fa fa-long-arrow-right black arrow4 pull-left"></i></h3></a> </div>  	<div class="col-xs-12">	<a href="feedback.html"><h3 class="orange2 pull-right contact-head">customer feedback<br/><i class="fa fa-long-arrow-right black arrow4 pull-left"></i></h3></a> </div>

codepen

hope helps. luck.

ps. codepen (arrow) wasn't working because didn't include font awesome css. got click on cog icon , include externals there.


since asked me @ website tried way saw it. might have tweek little bit needs part should give idea of how accomplish goal. didn't feel there need use keyframes used simple transitions on hover. when hover on parent can target child , have child transition. hope understand.

*,  *:after,  *:before{    box-sizing:border-box;  }    .box{    position: relative;    width: 200px;    height: 300px;    background: #eee;    border-bottom: 5px solid #45ca58;    transition: .5s ease;    margin: 0 auto;     overflow: hidden;  }  .border{    width: 100%;    height: 40px;    display: inline-block;    background: #45ca58;    position: absolute;    bottom: -40px;    transition: .5s ease;  }  /*on hover target border element should move*/  .box:hover > .border{    position: absolute;    bottom: 0px;  }  .arrow{    position: absolute;    bottom: 10px;    left:-20px;    color:white;    transition: .5s ease-in-out;  }  .box:hover > .arrow{    left: 30px;  }
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/>  <div class = "box">    <span class = "border"></span>    <span class="arrow"><i class="fa fa-long-arrow-right"></i></span>  </div>


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -