将鼠标悬停在一个元素上(....触发悬停在不同的元素上)

时间:2015-08-05 18:02:26

标签: javascript jquery css hover

<div id="bos_hero" class="clearfix">
    <a href="#" target="_blank"><span></span></a>
    <a href="#" target="_blank" class="rules" style="color:#fff !important;font-family: arial;"><b><u>Official</u></b></a>
    <div class="greybar">Have you seen my baseball?</div>.
    </span>
</div>

我有上述内容:&#39; bos_hero&#39;基本上把整个区域包裹成一个按钮。但是等级=&#34; rules&#34;也是嵌套在其中的超链接。 bos_hero.rules具有悬停效果(基本上只是1-2px; 增加了我希望触发&#39; .rules&#39;悬停事件在bos_hero完成后离开。

以下是我目前的做法;但是根本没有任何想法 - 任何想法?

$('#bos_hero').hover(function() {
   $('a.rules:link').css('font-size','11.5px');
);

2 个答案:

答案 0 :(得分:3)

您只能使用css执行此操作:

pattern = r"""
                        ##  --------- COMMENT ---------
       /\*              ##  Start of /* ... */ comment
       [^*]*\*+         ##  Non-* followed by 1-or-more *'s
       (                ##
         [^/*][^*]*\*+  ##
       )*               ##  0-or-more things which don't start with /
                        ##    but do end with '*'
       /                ##  End of /* ... */ comment
     |                  ##  -OR-  various things which aren't comments:
       (                ## 
                        ##  ------ " ... " STRING ------
         "              ##  Start of " ... " string
         (              ##
           \\.          ##  Escaped char
         |              ##  -OR-
           [^"\\]       ##  Non "\ characters
         )*             ##
         "              ##  End of " ... " string
       |                ##  -OR-
                        ##
                        ##  ------ ' ... ' STRING ------
         '              ##  Start of ' ... ' string
         (              ##
           \\.          ##  Escaped char
         |              ##  -OR-
           [^'\\]       ##  Non '\ characters
         )*             ##
         '              ##  End of ' ... ' string
       |                ##  -OR-
                        ##
                        ##  ------ ANYTHING ELSE -------
         .              ##  Anything other char
         [^/"'\\]*      ##  Chars which doesn't start a comment, string
       )                ##    or escape
    """

答案 1 :(得分:0)

只需要几个快速的东西,可以帮助你深究它..

  1. 关闭.hover()函数。浏览器中的开发人员工具会为您标记它,它需要第3行的“}”括号:“);”变成“});”

  2. 使用带破折号的.css()参数时,请使用引号(“),而不是撇号(')

    $('#bos_hero').hover(function() {
       $('a.rules:link').css("font-size",'11.5px');
    });
    
相关问题