使用jQuery为固定位置div设置固定高度

时间:2016-08-15 15:24:33

标签: jquery html css css3

我的网站垂直有两个div,两个高度各不相同。因此,我试图通过使用JQuery成为固定位置时为下面的div设置最高值。

JQuery代码:

Sub uniqRnd()

    Dim lb As Long: lb = 1    ' lower bound
    Dim ub As Long: ub = 1000 ' upper bound

    ' populate collection with numbers starting from lb to ub
    Dim i As Long
    Dim c As New Collection
    For i = lb To ub: c.Add i: Next

    ' randomly pick the number and (!) remove it from the
    ' collection at the same time so it won't be repeated
    While c.Count > 0
        lb = 1
        ub = c.Count
        i = Int((ub - lb + 1) * Rnd + lb)
        Debug.Print c(i) ' this is your unique random number from the
                         ' remaining in the collection
        c.Remove i
    Wend

End Sub

“contents”高于div类名,“suggest”低于div类名。高度未在css代码中定义。我的问题是,当它变得固定时,div高度会发生变化。然后根据上面的div高度,顶部值变得更小,并且div与div之上重叠。如何解决它。我想在固定之前设置下面的div的顶部值,高于div的高度。

0 个答案:

没有答案