当页面内点击次数减少时,页脚会被修复

时间:2016-02-03 09:28:56

标签: jquery css fixed

如果在点击内容发生变化时所有屏幕上的内容较少,并且只有当CSS或Jquery的内容较少时将其固定在底部时,我怎么能将页脚固定为总是在底部?

2 个答案:

答案 0 :(得分:1)

您可以尝试以下

var originalTransform: CGAffineTransform?

 UIView.animateWithDuration(0.3, animations: {

            if self.buttonPriceOrder.imageView != nil {
                originalTransform = self.buttonPriceOrder.imageView!.transform
                self.buttonPriceOrder.imageView!.transform = CGAffineTransformMakeRotation(CGFloat(M_PI))
            }

        }, completion: {
            (success) in

            if success {

                self.buttonPriceOrder.imageView?.transform = originalTransform!

                if self.isPriceOrderAsc == true {
                    self.isPriceOrderAsc = false
                    let rotatedimage = UIImage(CGImage: (self.buttonPriceOrder.imageView!.image!.CGImage)!, scale: CGFloat(1.0), orientation: UIImageOrientation.DownMirrored)
                    self.buttonPriceOrder.setImage(rotatedimage, forState: .Normal)

                }else{
                    self.isPriceOrderAsc = true
                    let rotatedimage = UIImage(CGImage: (self.buttonPriceOrder.imageView?.image!.CGImage)!, scale: CGFloat(1.0), orientation: UIImageOrientation.UpMirrored)
                    self.buttonPriceOrder.imageView?.image = nil
                    self.buttonPriceOrder.setImage(rotatedimage, forState: .Normal)

                }
                self.isFilterActive = true
                self.delegate.filterUpdated(self)
            }

    })

css class(您还可以根据需要添加更多属性)

<html>
 <body>
  <div id="wrap">
     MY Content
  </div>
 <footer class="footer" id="appfooter">
   <div>
    MY Footer
   </div>
 </footer>
 </body>
</html>

准备好文件

 .footer {
    clear: both;
    text-align: center;
  }

答案 1 :(得分:0)

我认为这对你有帮助。 通过使用footer{ position: fixed;z-index: 100;bottom: 0; width: 100%;}你可以实现固定的页脚。

&#13;
&#13;
footer {
    position: fixed;
    z-index: 100; 
    bottom: 0; 
    width: 100%;
}
&#13;
<!DOCTYPE html>
<html>
<style>

</style>
<body>

<footer>
  <p>Posted by: Someone</p>
  <p>Contact information: <a href="mailto:someone@example.com">someone@example.com</a>.</p>
</footer>

</body>
</html>
&#13;
&#13;
&#13;