在fancybox外添加自定义html

时间:2018-02-02 05:40:26

标签: javascript jquery html css fancybox-2

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

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

任何帮助?

1 个答案:

答案 0 :(得分:0)

你尝试使用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中使用按钮并将其置于绝对位置。