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

前端 未结 3 813
故里飘歌
故里飘歌 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:26

    Look at the examples on how to access other content. If I understand your question correctly, you want to display an external source in an iframe. You can do that using:

    (from the example page)

    $(".iframe").colorbox({iframe:true});
    
    

    Outside webpage (IFrame)

    Update: if what you want is to have something like the code above appear on the page when you enter a url, then I suggest that you use parameters or url rewriting to accomplish it. The idea would be that your url would include the page to load in the iframe and on the server you would extract this and use it to construct something like the code above on your page.

    http://www.example.com/main?load=about.htm
    

    or using something like MVC, you might have:

    http://www.example.com/main/about
    

    Which would invoke the about action on the main controller. This would render a view that contains the code injecting the "about.htm" content file into the iframe.

提交回复
热议问题