【发布时间】:2014-10-10 09:36:32
【问题描述】:
当用户选择部分文本然后聚焦段落并暗页面的其他部分时,如何在网页中创建效果(通过 jquery)? 怎样才能创造出这样的效果? 比如可以看this link
此图像在选择文本之前显示网页(图像顶部)以及当通过鼠标光标选择文本的一部分时(图像底部): view image
【问题讨论】:
标签: jquery effect side-effects
当用户选择部分文本然后聚焦段落并暗页面的其他部分时,如何在网页中创建效果(通过 jquery)? 怎样才能创造出这样的效果? 比如可以看this link
此图像在选择文本之前显示网页(图像顶部)以及当通过鼠标光标选择文本的一部分时(图像底部): view image
【问题讨论】:
标签: jquery effect side-effects
您可以使用 CSS 过渡和 JQuery
这是我使用 css 转换和 jquery 的解决方案
a {
color:blue;
/* First we need to help some browsers along for this to work.
Just because a vendor prefix is there, doesn't mean it will
work in a browser made by that vendor either, it's just for
future-proofing purposes I guess. */
-o-transition:color .2s ease-out, background 2s ease-in;
-ms-transition:color .2s ease-out, background 2s ease-in;
-moz-transition:color .2s ease-out, background 2s ease-in;
-webkit-transition:color .2s ease-out, background 2s ease-in;
/* ...and now for the proper property */
transition:color .2s ease-out, background 2s ease-in;
}
【讨论】: