jquery效果后边距和填充重置

时间:2016-10-27 16:45:31

标签: javascript jquery effect

我对图像悬停的jquery效果有问题。在图像上悬停几次之前,它看起来像这样:

enter image description here

将我的图像棒悬停在按钮上,如下所示:

enter image description here

这是我的JS:

//For animate images in skills
$('.skills, .contact').find('img').hover(function(){
   $(this).finish().effect("bounce",1000);
}); //End of hover() animate

HTML:

<div class="row future hideme">
  <div class="col-lg-3 col-xs-4 col-lg-offset-1">
    <img src="images/angular.png" alt="AngularJS" title="AngularJS">
  </div>
</div>
<a href="#projects"><button name="projects" class="hideme">Check my projects</button></a>

CSS:

.hideme { opacity: 0; }
.row { margin: 0 0 0 350px; }

  .future {
    margin: 0 0 50px 500px;
  }

  button {
    background: none;
    outline: none;
    border: 1px solid #D4DFE6;
    padding: 13px;
    border-radius: 5%;
    padding: 50px 0 0 0 0;
  }

这是小提琴: https://jsfiddle.net/avm7a6oa/12/

我该如何修复?

2 个答案:

答案 0 :(得分:1)

您遇到问题的原因是JqueryUI在应用position:absolute;时放置了bounce。这可以通过将img或将在div position:relative;内加height和右'fixing:run time error '-2147467259 automation error unspecified error Sub Unprotect_WorkSheet_With_Password() Sheets("Sheet1").Unprotect "YourPassword" End Sub Sub Consolidate() Dim sSQL As String 'SQL String Dim oCn As Object 'Connection Dim oRs As Object 'Recordset Dim vFile As Variant 'File Name Dim sCustomer As String 'Customer ID Dim sItem As String 'Inventory Item ID ' Get filenames vFile = Dir(ThisWorkbook.Path & "\ml\testdirectory\*.csv") ' Create SQL While vFile <> vbNullString If sSQL <> vbNullString Then sSQL = sSQL & vbCr & "Union " & vbCr sCustomer = Split(vFile, "-")(0) sItem = Split(Split(vFile, "-")(1), ".")(0) sSQL = sSQL & "Select '" & sCustomer & "' as Customer, '" & sItem & "' as Item, * from [" & vFile & "]" vFile = Dir DoEvents Wend ' Create Connection Objects Set oCn = CreateObject("ADODB.Connection") Set oRs = CreateObject("ADODB.Recordset") oCn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & ThisWorkbook.Path & ";" & _ "Extended Properties=""Text;HDR=YES;FMT = CSVDelimited"";" oRs.Open sSQL, oCn Debug.Print sSQL If Sheet1.ListObjects.Count > 0 Then Sheet1.ListObjects(1).Delete Sheet1.ListObjects.Add( _ SourceType:=xlSrcQuery, _ Source:=oRs, _ Destination:=Sheet1.Range("C6")).QueryTable.Refresh oRs.Close oCn.Close Set oRs = Nothing Set oCn = Nothing End Sub

的元素放回来解析

工作DEMO

答案 1 :(得分:0)

反弹动画使图像处于absolute位置,因此边距不再影响其他元素。