I am using a which has links which are floated to left. Then when I am giving the bounce effect to the elements on click, when I am clicking them the bounce occurs but it shifts to the right of the container.
The phenomenon does not happen when I remove the float:left effect. I have been trying to find a replacement for the float property but unable to find any proper effect. This is my HTML code
<div id="menu">
<ul>
<li><asp:LinkButton ID="lbDashboard" ClientIDMode="Static" runat="server" onclick="lbDashboard_Click">Dashboard</asp:LinkButton></li>
<li><asp:LinkButton ID="lbFindHotfix" ClientIDMode="Static" runat="server" onclick="lbFindHotfix_Click">Search</asp:LinkButton></li>
<li><asp:LinkButton ID="lbHelpWiki" ClientIDMode="Static" runat="server" onclick="lbHelpWiki_Click">Help/Wiki</asp:LinkButton></li>
</ul>
</div>
而这正是社会保障部的一部分。
#menu {
padding-top:30px;
padding-right:30px;
margin: 0;
float: right;
width:100%;
overflow:hidden;
}
#menu ul, #searchdropdown ul{
margin: 0;
list-style: none;
}
#mainlinks ul
{
margin: 0;
list-style: none;
}
#menu li, #mainlinks li, #searchdropdown li{
display: inline;
}
#menu a{
display: block;
float: left;
padding: 10px 10px;
margin: 0;
text-align: center;
text-decoration: none;
text-transform: uppercase;
font-size: 14px;
font-weight: normal;
font-family: Georgia, "Times New Roman", Times, serif;
color: #616B4F;
}
#menu a:hover{
background: #9FAB87;
color: #FFFFFF;
border-top-left-radius:1em;
border-bottom-right-radius:1em;
}
这是我的文字代码。
<script type="text/javascript" language="javascript">
$(function () {
//Add bounce effect on Click of the DIV
$( #lbDashboard ).click(function () {
$(this).effect("bounce", { times: 3 }, 300);
});
$( #lbFindHotfix ).click(function () {
$(this).effect("bounce", { times: 3 }, 300);
});
$( #lbHelpWiki ).click(function () {
$(this).effect("bounce", { times: 3 }, 300);
});
});
</script>