質問

I am using lightbox by Warren Krewenki

https://github.com/krewenki/jquery-lightbox

Is there a way to open an image on page load? Like if there is some jQuery trigger which I can call on page load which will emulate like user clicking on image and then it will open lightbox?

Or if this is not possible then any other plugin that will allow me to open and HTML page in lightbox? I remember I saw one here but forgot the link.

役に立ちましたか?

解決

Trigger a click on one of the links to which lightbox is attached:

$(function () {
    $('a.lightbox').lightbox();
    $('a.lightbox:first').trigger('click');
});

他のヒント

$(document).ready(function () {
 $('#myLightbox').show();
});

You can try this one also :-

http://lokeshdhakar.com/projects/lightbox/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top