Passing a dynamic href into Fancybox Iframe

后端 未结 1 1638
Happy的楠姐
Happy的楠姐 2021-01-26 03:42

I\'m trying to build a href on the fly to pass it into fancybox iframe and pass the link into a php file

 

        
1条回答
  •  走了就别回头了
    2021-01-26 04:27

    No need to select all a tags and loop, you can do simply like

    $(document).on('click', '.Images', function(e) {
        e.preventDefault();
        var Href = 'GetImg.php?img=' + $(this).attr("href");
        alert(Href);
        $.fancybox.open({
            href: Href,
            type: 'iframe',
            padding: 5
        });
    });​
    

    0 讨论(0)
提交回复
热议问题