Jquery Fancybox auto display upon page load

Encounter this issue where it is needed to auto pop up Jquery Fancybox item. The solution is very easy.

$(document).ready(function(){
    $('#myElementId').fancybox().trigger('click');
});

Summary:
The main point here this snippet of code:
.trigger('click');
which will auto pop up fancybox

Comments

Popular posts from this blog

Django Form: MultipleChoiceField and How To Have Choices From Model Example

DJango Queryset comparing date time

Jquery Validation fix for date format dd/mm/yyyy in Chrome and Safari