当前位置: 代码迷 >> Web前端 >> 转jquery highlight 高亮展示插件
  详细解决方案

转jquery highlight 高亮展示插件

热度:189   发布时间:2012-09-21 15:47:26.0
转jquery highlight 高亮显示插件

调用?

做站内搜索的 ,js 实现的 一般都会用到,感觉还不错.

var?someKeyWords?=?"......";??

  • ????$("#div_Text").highlight(someKeyWords);??
  • Available Options

    The following list describes what options you have for the second argument of the method "highlight" (option object):

    hClass
    Specifies the CSS class used to highlight key words.
    Data Type: String
    Default Value: null

    ?

    hColor
    Specifies the color used to highlight key words. If you setted the?hClass?option, this option will be ignored.
    Data Type: String
    Default Value: "#C03"

    ?

    separator
    The symbol used to separate multiple keywords.
    Data Type: String
    Default Value: " "

    ?

    wrapper
    Specifies the HTML tag used to wrap the keywords.
    Data Type: String
    Default Value: "em"

    ?

    useDefaultStyle
    When not set hClass option, specify whether to use the default style to highlight the keywords (eg: use the?hColor?option).
    Data Type: Boolean
    Default Value: true

    ?

    needUnhighlight
    Specifies whether need the function of cancel the highlighted keywords or highlight keywords several times within the same container tag.
    Data Type: Boolean
    Default Value: false

      相关解决方案