How to construct a URL to open a page with jquery lightbox plugin colorbox?

前端 未结 3 812
故里飘歌
故里飘歌 2021-01-03 10:40

I am using jquery lightbox plugin colorbox (http://colorpowered.com/colorbox/) and i want to be able to construct a URL like www.example.com/about-me.html which will send th

3条回答
  •  孤独总比滥情好
    2021-01-03 11:24

    edit - have updated my example source code below

    i'm not familiar with that lightbox but I would assume that all you need to do is create a page and call the lightbox on window.load or dom ready like:

    $(document).ready(function () {
       if(document.location.hash){
        //launch colorbox and use this hash
        $.fn.colorbox({width:"50%", inline:true, href:""+document.location.hash+""});
       }
    });
    

提交回复
热议问题