手动定位Fancybox 2 [英] Position Fancybox 2 manually

查看:59
本文介绍了手动定位Fancybox 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法终生,想出如何重新定位Fancybox 2以使用left: 47px;top: 147px

I can not for the life of me, figure out how I can reposition Fancybox 2 to use left: 47px; and top: 147px

我通读了源代码,并且没有对其进行破解,没有看到一种替代定位的方法.

I read through the source code, and without hacking it, I don't see a way to override the positioning.

autoCenter设置为false只会在第一次完成后自动停止对中.

Setting autoCenter to false only stops auto-centering after the first time it does it.

使用jQuery更改CSS或提供自定义包装来应用CSS均不起作用,因为Fancybox始终会添加内联CSS来覆盖我的所有尝试.

Using jQuery to change the CSS, or giving a custom wrapper to apply the CSS doesn't work either, because Fancybox always adds inline CSS which overwrites all my attempts.

有没有办法告诉Fancybox停止自身定位并使用我的绝对定位?

Is there a way to tell Fancybox to stop positioning itself and to use my absolute positioning?

推荐答案

您可以覆盖内联CSS 样式使用!important修饰符.

You can override inline CSS styles using the !important modifier.

对于Fancybox用例,以下内容将覆盖JavaScript位置:

For the Fancybox use case the following will override the JavaScript positioning:

.fancybox-wrap { 
  top: 147px !important; 
  left: 47px !important; 
}

这篇关于手动定位Fancybox 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆