gpt4 book ai didi

javascript - aspx鼠标悬停时水平展开DIV

转载 作者:行者123 更新时间:2023-11-28 13:41:55 25 4
gpt4 key购买 nike

我正在尝试做类似 this 的事情您可以在页面右侧看到可折叠的 DIV

这是我尝试过的,出于某种原因我为此使用了 UserControl

<div class="widget-content">
<style type="text/css">
.w2bslikebox{background: url("/uploadedimages/_system/images/online-helpdesk.png") no-repeat scroll left center transparent !important;display: block;float: right;height: 192px;padding: 0 5px 0 39px;width: 213px;z-index: 99999;position:fixed;right:-218px;top:30%;}
.w2bslikebox:hover{background: url("/uploadedimages/_system/images/online-helpdesk-ov.png") no-repeat scroll left center transparent !important;}

.w2bslikebox div{border:none;position:relative;display:block;}
.w2bslikebox span{bottom: 12px;font: 8px "lucida grande",tahoma,verdana,arial,sans-serif;position: absolute;right: 0px;text-align: right;z-index: 99999;}
.w2bslikebox span a{color: gray;text-decoration:none;}
.w2bslikebox span a:hover{text-decoration:underline;}
.esn_searchTitle {
color: #669613;
font-size: 130%;
font-weight: bold;
}
</style>
<div style="right: -218px;" class="w2bslikebox">
<div id="Inner">
<asp:Literal ID="ltlOnlineHelpdesk" runat="server"></asp:Literal>
</div>
</div>
</div>

我在代码隐藏中绑定(bind)文字控件。问题是,DIV 没有在鼠标悬停时展开。

我错过了什么?或者有任何其他最好的方法来做到这一点,如 URL 中所示?

最佳答案

添加这个之后,工作正常..

<script type="text/javascript">

//<!--

$(document).ready(function () { $(".w2bslikebox").hover(function () { $(this).stop().animate({ right: "0" }, "medium"); }, function () { $(this).stop().animate({ right: "-225" }, "medium"); }, 500); });

//-->

</script>

关于javascript - aspx鼠标悬停时水平展开DIV,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12294460/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com