标签: hover

CSS LI悬停 - 浏览器兼容吗?

NOOB问题......

是否LI:HOVER{background:url(image.jpg) 0 0 no-repeat;}适用于所有浏览器?

css hover html-lists

6
推荐指数
2
解决办法
1万
查看次数

jquery:在hover()函数中传递变量?

我可以在hover()中传递变量吗?

如下面的脚本,我不想两次声明相同的变量var target = xxx,我不想让这个变量成为全局target = xxxbcos我有其他函数使用这个变量名称 - 目标.

   $('.image-profile').hover(function () {

        var target = $('.button-change-image-profile',this);
        target.show();

    },function () {

        //var target = $('.button-change-image-profile',this);
        target.hide();

    });
Run Code Online (Sandbox Code Playgroud)

So I tried to pass the var like this },function (target) {, of course it is wrong, but any other method to pass this var?

thanks.

variables jquery scope global-variables hover

6
推荐指数
2
解决办法
1万
查看次数

jquery盘旋并留到鼠标外出

我正在尝试创建一个"购物车"链接,购物车在悬停时打开.我可以让车在悬停时打开并在离开时关闭.然而,一旦盘旋,我就无法让车块保持打开状态.如果你将鼠标悬停在悬停上,我希望车挡在悬停时打开并保持打开状态.如果您将鼠标悬停在本页右上角的"购物车"链接上,您会看到我的意思.

http://dl.dropbox.com/u/4380589/Rococlothing/index.html

我使用的jQuery是:

jQuery('#cart-links .links .first a').mouseover(function(){
  jQuery('.block-cart').slideDown(400);
}).mouseout(function(){
  jQuery('.block-cart').slideUp(400);
});

jQuery(".block-cart").mouseover(function(){
 jQuery(this).show();
}).mouseout(function(){
 jQuery(this).fadeOut("slow");
});
Run Code Online (Sandbox Code Playgroud)

javascript jquery hover

6
推荐指数
1
解决办法
5616
查看次数

IE不尊重:悬停在元素上

在以下网站上工作:http://cetcolor.com

带有"Read About It"按钮的标头图形具有一个定位链接,悬停时滚动显示橙色按钮图形并且是可点击链接.

但是,在IE浏览器中,它无法正常工作.

这是受影响的HTML:

<div id="header">
    <a href="/" title="CET Color"><img src="images/logo.gif" width="147" height="86" alt="CET Color" class="logo"></a>
    <span class="strapline">Affordable Large-format UV Printing Solutions</span>
    <a href="/pressroom_article8" class="read_about_it"></a>    
</div>
Run Code Online (Sandbox Code Playgroud)

这是引用的CSS:

#header .read_about_it {
    position: absolute;
    top: 239px;
    left: 803px;
    z-index: 100;
    width: 114px;
    height: 17px;
}
#header .read_about_it:hover {
    background-image: url(/images/masthead_index_read_about_i.jpg);
    background-repeat: no-repeat;
    cursor: pointer;
    z-index: 101;
}
Run Code Online (Sandbox Code Playgroud)

有没有人知道为什么悬停不能在IE浏览器中工作?

css internet-explorer hover

6
推荐指数
1
解决办法
1万
查看次数

链接悬停导致background-size:cover; 改变Chrome

使用CSS3,我将背景图像设置为封面.首次在Chrome中加载页面并将鼠标悬停在链接上时,文本周围的背景略有变化(但非常明显).我正在使用悬停的过渡,但背景移位也会在移除过渡时发生.

我的猜测是背景在悬停期间调整大小,但我不确定如何防止这种情况发生.一旦转移,您可以毫无问题地翻转其他链接.刷新页面后,问题仍然存在.

网站在这里:http://tylerbritt.com/

样式就是这样:

body{
    text-align: center;
    margin: 0 auto;
    color: white;
    font: bold 80pt 'Economica', sans-serif;

    background: url(bg2.jpg) no-repeat  center center scroll;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover; 
}

a {
    color: white;
    text-decoration: none;
    -webkit-transition: text-shadow 0.3s ease-out;
    -moz-transition: text-shadow 0.3s ease-out;
    -o-transition: text-shadow 0.3s ease-out;
    -ms-transition: text-shadow 0.3s ease-out;
    transition: text-shadow 0.3s ease-out;
}

  a:hover { 
        text-shadow: 0 0 6px #1c00f6;
    }
Run Code Online (Sandbox Code Playgroud)

我的问题非常类似于:当悬停时不透明度发生变化时谷歌浏览器中的背景转换 ; jfriend00的建议很有帮助,但我的问题不同,因为它纯粹是一个文本链接,而不是一个img.

我使用的是Chrome版本19.0.1084.52.Safari不存在问题.任何建议将不胜感激.

background google-chrome hover css3 css-transitions

6
推荐指数
1
解决办法
1870
查看次数

重叠div:悬停

我有悬停和悬停时高度增长的div我希望它们与所有其他div重叠,而不是像我的例子那样推动它们.

#container{
width: 300px;
}

#container a div{
float:left;
width: 100px;
height: 60px;
-webkit-transition: all 0.25s ease;
}

#container .color1{
background: #444;
}

#container .color2{
background: #555;
}

#container .color3{
background: #666;
}

#container .color4{
background: #777;
}

#container .color5{
background: #888;
}

#container a div:hover{
height: 80px;
-webkit-transition: all 0.25s ease;
}
Run Code Online (Sandbox Code Playgroud)

http://jsfiddle.net/MrSlacker/5wa3X/

html css overlap hover

6
推荐指数
1
解决办法
3217
查看次数

Selenium/Python - 悬停并单击元素

我在Python上遇到了Selenium脚本的问题.在我正在与之交互的javascript Web应用程序中,我需要单击的元素在我将鼠标悬停在其上之前不存在.我已经查看并找到了关于如何悬停的各种答案,但序列需要包括在悬停事件期间单击新元素.这是我目前正在使用的代码.一旦add1存在,当发生悬停时,元素将从add添加到add1; 我应该能够单击/ send.keys来执行所述元素.

...
driver = webdriver.Firefox()
from selenium.webdriver.common.action_chains import ActionChains
...
add = driver.find_element_by_css_selector('input.add')
Hover = ActionChains(driver).move_to_element(add)
Hover.perform()
SearchButton = driver.find_element_by_css_selector('input.add1')
SearchButton.click()
Run Code Online (Sandbox Code Playgroud)

我是Python的新手,也是一般的编程,但我无法弄清楚如何正确排序.

任何帮助将不胜感激.

python firefox hover selenium-webdriver

6
推荐指数
1
解决办法
2万
查看次数

在悬停时更改动画速度

我正在构建一个行星系统,可以将其悬停在轨道上并且动画速度会发生变化.
我尝试使用onMouseOver和.hoverjquery,但我无法弄清楚它为什么不起作用.

#universum-planet1 {
  position: absolute;
  height: 250px;
  width: 250px;
  top: 40%;
  left: 50%;
  margin-left: -125px;
  margin-top: -65px;
  z-index: 1;
  border: 1px solid #989898;
  -webkit-border-radius: 225px;
  -moz-border-radius: 225px;
  border-radius: 225px;
  -webkit-animation: spin 15s linear infinite;
  -moz-animation: spin 15s linear infinite;
  animation: spin 15s linear infinite;
  -moz-transform-origin: center center;
  -webkit-transform-origin: center center;
  transform-origin: center center;
}
#planet1 {
  position: absolute;
  top: 5%;
  left: 5%;
  height: 50px;
  width: 50px;
  z-index: 2;
  -webkit-animation: spin 30s linear infinite;
  -moz-animation: spin …
Run Code Online (Sandbox Code Playgroud)

css hover css3 css-animations

6
推荐指数
1
解决办法
3354
查看次数

单击后,悬停状态卡在按钮上

我有一个有两种状态的表单:编辑和可见.当您单击图标编辑表单时,底部的两个按钮(如提交一样)似乎保存或取消.单击它们时,表单会更新(或取消),按钮会消失.问题是,当我重新打开表单进行编辑(并且按钮再次可见)时,单击的最后一个仍然在Chrome中应用了悬停状态.

       <div>
          <div class="col-xs-5">
            <button class="btn btn-primary pull-right" ng-click="save(true)">Save</button>
          </div>

          <div class="col-xs-5 cancel-btn">
            <button class="btn btn-primary pull-left" ng-click="cancel()">Cancel</button>
          </div>
        </div>
Run Code Online (Sandbox Code Playgroud)

为简单起见,这里只是取消功能......

   $scope.cancel = function() {
      //set a flag for angular to hide/show editing mode in HTML
      $scope.editMode = false;
   };
Run Code Online (Sandbox Code Playgroud)

javascript hover css3 angularjs twitter-bootstrap-3

6
推荐指数
1
解决办法
2711
查看次数

当鼠标悬停在链接上时,为什么部分css悬停颜色会遗留下来?

这是一个非常奇怪的问题,当剩余部分悬停颜色遗留下来时,确实会使链接看起来很难看.例如,我将鼠标悬停在一个白色的链接上,它将变为蓝色,并且在悬停时,它会变回白色,但剩下一些蓝色.

在下面的图片中,"hi"是未发现的链接,"Quotes"显示链接上的左侧悬停颜色,"信息理论"目前正在盘旋,因而是蓝色.正如你可以看到"报价"上的左侧颜色是我的问题.

在此输入图像描述

此外,将鼠标悬停在此文件夹图标上时,如果整个图标在悬停时应为黑色,则文件夹的一侧会有一些白色.

在此输入图像描述

这是这个问题的一个小问题: http ://jsfiddle.net/000ge3xv/1/

如果您快速将鼠标悬停在所有链接上,您可以轻松地使用小提琴重现它.最终,悬停颜色将部分"卡住"在某些链接上.我正在Chrome中测试该网站.我没有注意到Safari中的问题,也没有在其他浏览器中测试过.

UPDATE

经过更多测试后,我认为问题与在笔记本电脑上使用触控板滚动有关.由于侧边栏是可滚动的,如果用户使用光标在链接上向下滚动列表,则当用户向上或向下滚动时,悬停状态将被激活.当悬停状态以这种方式激活时,颜色趋于卡住,如下图所示.通常,我向下滚动列表,然后选择一个链接,该链接会在使用触控板滚动时激活状态.因此,如果您正在使用笔记本电脑(我正在使用macbook pro触控板)并滚动选择链接,您应该能够重现该错误.)

这是我正在使用的html和css:

HTML

<div id="sidebar">
<nav id="cbp-spmenu-s1" class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-left unselectable cbp-spmenu-open">
   <div class="sidebar-content">
      <div class="heading">
         <div class="fa fa-bookmark-o"></div>
         <span data-toggle="modal" data-target="#newCollectionModal">
            Bookmarks
            <div class="fa fa-plus"></div>
         </span>
      </div>
      <ul class="allList">
         <li><a href="/bookmarks">All Bookmarks</a></li>
      </ul>
      <ul id="sortableCollections" class="ui-sortable">
         <li><a href="/bookmarks/GhbYYoo2Qokib8Wkk">Created in IE</a></li>
         <li><a href="/bookmarks/qFFspAHte7hKmFyuG">Test2</a></li>
         <li><a href="/bookmarks/34ujRW3wjJrfTsbiG">Physics</a></li>
         <li><a href="/bookmarks/h2otTW6rmPA3W7Ri3">Food</a></li>
         <li><a href="/bookmarks/3AiQot9WvrGeMAN5C">Meteor Packages</a></li>
         <li><a href="/bookmarks/y3Max5ind7N6CTRto">Seelio</a></li>
         <li><a href="/bookmarks/tScXGq4ZMfSJx2LZL">Test</a></li>
         <li><a href="/bookmarks/6ijnJL3GZzLgiaJso">Meteor</a></li>
      </ul>
      <div class="heading">
         <div class="fa fa-pencil-square-o"></div>
         <span data-toggle="modal" data-target="#newNotepadModal">
            Notepads
            <div class="fa fa-plus"></div>
         </span> …
Run Code Online (Sandbox Code Playgroud)

html css hover

6
推荐指数
1
解决办法
423
查看次数