在 fancybox 外添加自定义 html

Add custom html in outside the fancybox

 $.fancybox({
        content: '<button>prev</button><button>next</button>',
        href: src,
        'autoScale': false,
        'transitoinIn': 'none',
        'transitionOut': 'none',
       .......
});

我只是在 fancybox 中打开图像。我想在 fancybox 中添加一些 html 按钮,但问题是它覆盖了图像。但我不想覆盖图像,所以我想在图像外添加按钮。

有什么帮助吗?

你试试用 z-index 怎么样?

<style>
.btn1 {z-index: 5;}

</style>
<html>
...
<html>
<script>

$.fancybox({
                content: '<button class="btn1">prev</button><button class="btn1">next</button>',
                href: src,
                'autoScale': false,
                'transitoinIn': 'none',
                'transitionOut': 'none',
               .......
        });

或者您可以尝试将按钮放在 html 中并将其定位为绝对。