display content from another page using fancybox

Asked

Viewed 126 times

0

I have a page with the names of various products and would like q when clicking on one open a fancybox with the details of each product. These details (name, price, etc.) are on another page and would like to display them on the same page on which are listed the products.

1 answer

0


try this here ^^

js scripts

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.1/jquery.fancybox.pack.js" type="text/javascript"></script>
<link rel="stylesheet" href="http://fancyapps.com/fancybox/source/jquery.fancybox.css?v=2.1.3" type="text/css" media="screen" />

then at the bottom

<script>
$(function() {
    $(".fancyboxIframe").fancybox({
        maxWidth    : 900,
        maxHeight   : 600,
        fitToView   : false,
        width       : '90%',
        height      : '90%',
        autoSize    : false,
        closeClick  : false,
        openEffect  : 'none',
        closeEffect : 'none',
    iframe: {
        scrolling : 'auto',
        preload   : true
    }
    });
});
</script>

and in your html

<a href="https://desapegogames.com.br" data-fancybox-type="iframe" class="fancyboxIframe">Clique aqui !!!</a>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.