Html 当
我在一个div中插入了一个类似于facebook的按钮,将其自身隐藏在屏幕之外,直到您将鼠标悬停在上面:Html 当,html,css,facebook,hover,parent,Html,Css,Facebook,Hover,Parent,我在一个div中插入了一个类似于facebook的按钮,将其自身隐藏在屏幕之外,直到您将鼠标悬停在上面: <div id="fb">Some text here<br /> <div class="fb-like" data-href="http://etc..." data-layout="button" data-action="like" data-show-faces="false" data-share="false" data-colorscheme="
<div id="fb">Some text here<br />
<div class="fb-like" data-href="http://etc..." data-layout="button" data-action="like" data-show-faces="false" data-share="false" data-colorscheme="dark"></div></div>
问题是,当我在internet explorer中将鼠标移到父div上时,它会像正常一样滚动,但一旦我像facebook一样滚动div,它就会返回到原始的“屏幕外”状态,然后我才有机会点击like按钮
当我将鼠标移到like按钮上时,有人能帮我弄清楚如何使我的div保持在屏幕上。我现在无法在IE中进行测试,但您可能想试试:
#fb {
display:block;
background:url(images/facebook.png) right no-repeat #000;
color:#FFF;
height:89px;
width:280px;
position:absolute;
top:20px;
left:0px;
padding-right:22px;
margin-left:-280px;
-webkit-transition:all .5s ease-out;
-moz-transition:all .5s ease-out;
-o-transition:all .5s ease-out;
transition:all .5s ease-out;
font-size:10px;
border:solid 1px #E3D199;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
padding-top:5px;
padding-bottom:5px;
overflow:hidden;
}
亚历克斯试试看:
<style>
.zor{z-index:-1;}
</style>
....
<div class="zor">
<div class="fb-like zor" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="false"></div>
</div>
...
.zor{z-index:-1;}
....
...
如果要使用javascript,请尝试(已测试):
函数SetMarginLeft(v){
mm=document.getElementById(“fb”).style;
mm.marginLeft=v;
}
...
这里有一些文本
...
谢谢,但这根本没什么区别。哎呀!我发布了新的解决方案。并不是转换有错误,IE中没有转换。
<style>
.zor{z-index:-1;}
</style>
....
<div class="zor">
<div class="fb-like zor" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="false"></div>
</div>
...
<script>
function SetMarginLeft(v){
mm = document.getElementById("fb").style;
mm.marginLeft=v;
}
</script>
...
<div id="fb" onMouseOut="SetMarginLeft('-280px');" onMouseOver="SetMarginLeft('0px');">Some text here<br />
<div class="fb-like" data-href="http://etc..." data-layout="button" data-action="like" data-show-faces="false" data-share="false" data-colorscheme="dark"></div>
</div>
...