如何在网址更改时为div提供ontouch效果

时间:2015-06-30 06:39:45

标签: jquery angularjs css3 css-transitions css-animations

我正在制作一个phonegap应用程序,我需要在触摸开始时给出触摸结束效果。

我的问题:我使用了触摸效果墨滴(https://github.com/akhilarjun/InkDrops)但是在我的情况下这是行不通的,因为点击到div会立即更改URL(在chrome上测试),因为角度控制器会发生变化,因此效果不会发生。

我想要一些新的效果以及对上述问题的补救措施的建议。

这是我想实现的div

HTML:

 <div style="box-shadow: 0px 0px 8px 1px #ccc;margin: 0 12px;">
           <div class="opporMain  inkMe" style="margin:0px" >
                <div class="opporHeader" >

                    <div class="opporHeading">This is the Header</div>
                </div>
                <div class="lineDiv"></div>
                <div class="opporContent"  >
                    <div class="contentContainer">
                        <div class="contentStatus">
                            Hi this is the content
                        </div>
                    </div>
                <div class="clearContent"></div>
                    <div class="contentUpdateTime"><img class="timeIcon" src="images/drawable-mdpi/time-icon-mdpi.png" alt="clock">&nbsp;Time  ago</div>
                    <div class="clearContent"></div> 
                    <div class="contentUpdateBy">updated by <font color="black">here goes the name</font></div>     

                    </div>
     </div>
</div>
<div class="lineDiv"></div>

CSS:

.commentIcon{
   content:url(images/drawable-xxhdpi/comment.png);
   height:16px;
   width:16px;
   }

.timeIcon
{
    content:url(images/drawable-xxhdpi/time-icon-xxhdpi.png);
   height:12px;
   width:12px;
}
.opporMain {

margin-left:12px;
    margin-right:12px;
}
.opporHeader {
    clear:both;
    /*position:relative;*/
    display:inline-block;
    display:block;
    background-color:#ffffff;
    overflow:hidden;
    word-break :break-all;
    min-height:40px;

}
.circleIcon {
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    margin-top:6px;
    display:block;
    -wsebkit-border-radius: 14px;
    -moz-border-radius: 14px;
    border-radius: 14px;
    background-color:#ffb400;
    margin-left: 8px;
    text-align: center;
    font-family: Roboto-Light;
    font-size:18px; 
    color:White;
    vertical-align: middle;
    line-height: 28px;
}
.opporHeading {
    display: inline-block;
    font-family: Roboto-bold;
   /* font-weight: 700;*/
    font-size: 16px;    
    column-rule: #000;231f20;
    margin-top: 8px;
    margin-bottom: 8px;
    padding-left: 45px;
    padding-right: 4px;
}
.lineDiv {
    border-bottom: 1px solid #eee;
}
.opporContent {

    background-color:#ffffff;
    overflow:hidden;

    padding-bottom:12px;    

}
.opporComment
{
    height:40px;
    background-color:#ffffff;
    overflow:auto;
    margin-left:12px;
    margin-right:12px;
    cursor: pointer;

}
.contentContainer
{
    /*display:inline-block;*/
}
.contentStatus
{


    float:left;
    font-family:Roboto-R;
    font-weight:400;
    font-size:14px;
    color:#4554a5;
    margin-top:10px;   
    margin-left:8px;

}
.clearContent
{
    clear:both;    
}
.contentUpdateTime
{

    float:right;
    font-family:Roboto-Light;
    font-weight:100;
    font-size:12px;    
    color:#b1b3b6;
    margin-top:20px;
    margin-right:10px;

}
.contentUpdateBy
{
    float:right;
    font-family:Roboto-Light;
    font-size:14px;    
    font-weight:300;
    color:#b1b3b6;
    margin-top:4px;
    margin-right:10px;

}    
.opporCommentContent
{
    display: inline-block;
    float:left;
    font-family: Roboto-Medium;
    font-weight: 500;
    font-size:14px;
    margin-top:10px;
    margin-left:6px;
    color:#4f4f51;
}
.commentIcon
{
    display: inline-block;
    float:left;
    margin-top:14px;
    margin-left:8px;
}
.opporCommentDetails
{
    float:right;
    margin-top:10px;
    margin-right:10px;
    font-family: Roboto-Light;
    font-size:14px;
    color:#b1b3b6;
}

http://jsfiddle.net/tvaibhav/vjxe9ozq/

1 个答案:

答案 0 :(得分:0)

尝试使用Angular-Ripple

<强> Demo Link

这可以根据需要创建涟漪效果

https://github.com/nelsoncash/angular-ripple/tree/master