Search code examples
javascriptjqueryhtmlcssfancybox-2

Add custom html in outside the fancybox


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

I simply open images in fancybox. I want to add some html button in fancybox but problem is that it is override the image. but I don't want to override the image so I want to add button outside the image.

Any help?


Solution

  • How about you try having 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',
                   .......
            });
    

    Or you can try having your buttons in the html and position it to absolute.