How to open fancybox using map link

后端 未结 2 1811
情歌与酒
情歌与酒 2020-12-07 04:55

The link was given to a jpg file using map.




        
相关标签:
2条回答
  • 2020-12-07 05:18
    $('#Map area').click(function(e){     // On click of <area> tag
        var href = $(this).attr('href'); // Get the href param 
        $.fancybox({                     // Open fancybox
            'href'   : href,
            'width'  : 350,
            'height' : 'auto'
        });
    
        e.preventDefault();
    });
    
    0 讨论(0)
  • 2020-12-07 05:30

    Simply use this script

    $(document).ready(function(){
     $("#Map area").fancybox({
      // API options here
     }); // fancybox
    });//ready
    

    Make sure you add the right API options for the version you are using (if your href targets an image, you may not need any)

    If using v1.3.4 check http://fancybox.net/api.

    For v2.x check http://fancyapps.com/fancybox/#docs

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