English 中文(简体)
jquery bounce effect not working with Mobile elements
原标题:jquery bounce effect not working with floating elements

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>
最佳回答

当你提出清单项目时,不是联系,而是在链接上做事时会发生什么?

#menu li, #mainlinks li, #searchdropdown li{
display: inline;
}

#menu li {
float: left;
padding: 10px 10px;
}

#menu a{
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;
}
问题回答

对寻求类似问题的其他人:

我有这样的情况:

<div>
  <a href="#">
    link
  </a>
  <div style="float:right;">
    Controls
  </div>
</div>

在一次事件之后,我只想把这个联系与bou。 但是,当它这样做时,它就敲响了其他内地的展示。

我将浮标转到另一边,现在该浮体运行:

<div>
  <a href="#" style="float:left;">
    link
  </a>
  <div>
    Controls
  </div>
</div>




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签