同样是要实现 鼠标放到工具上面就显示出右上角收藏的功能!
我现在用JS做了一个简单的显示出层,但是这个层总是跑在外面了,如何把层弄到区域(右上角)里面来啊?
<script type="text/javascript">
var username;
function setFace(ObjId,AttrStr){
var faceList = document.getElementById(ObjId);
faceList.style.cssText = "display:"+AttrStr+";";
}
</script>
<style>
a.Ico_aBox{position:relative;width:226px; height:60px; float:left; margin:1px 3px; display:inline; text-decoration:none;cursor:pointer!important;cursor:hand}
a.Ico_aBox:hover{text-decoration:none;background-color:#F6F8FC;}
.Ico_aBox_icon{position:absolute; top:7px; left:5px; width:42px; height:42px;background:url(/img/icons.gif) no-repeat;}
.Ico_aBox_icon1{position:absolute; top:7px; left:5px; width:42px; height:42px;}
.Ico_aBox_tit{ position:absolute; left:56px; top:10px;font-size:14px; font-weight:bold; color:#005EAC;}
.Ico_aBox_intro{position:absolute; left:56px; top:30px;font-size:12px}
</style>
<a class="Ico_aBox" href="/wnl" onMouseOver="javascript:setFace('FaceList','block');" onmouseout="javascript:setFace('FaceList','none');">
<div class="Ico_aBox_icon INico1">图标</div>
<div class="Ico_aBox_tit">万年历</div>
<div class="Ico_aBox_intro">农历/公历/各种重要节日等</div>
</a>
<div id="FaceList" onmouseover="javascript:setFace('FaceList','block')" onmouseout="javascript:setFace('FaceList','none')" style="display:none;">
<a href="abc">+</a>
</div>
解答
#FaceList {position:relative; left: -20px;}