【问题标题】:How to create the effect on web page for selecting part of text by jquery如何在网页上创建通过jquery选择部分文本的效果
【发布时间】:2014-10-10 09:36:32
【问题描述】:

当用户选择部分文本然后聚焦段落并暗页面的其他部分时,如何在网页中创建效果(通过 jquery)? 怎样才能创造出这样的效果? 比如可以看this link

此图像在选择文本之前显示网页(图像顶部)以及当通过鼠标光标选择文本的一部分时(图像底部): view image

【问题讨论】:

    标签: jquery effect side-effects


    【解决方案1】:

    您可以使用 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;
    }
    

    编辑DEMO LINK

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-03-16
      • 1970-01-01
      • 2022-01-06
      • 1970-01-01
      • 2011-12-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多