lumos
lumos

Reputation: 753

jQuery issue with fancybox

I am using jquery click event to open fancybox and it is working perfect. I have added one textbox inside this inline1 div but when I input something I can't writer anything.

My Code:

$(document).ready(function() {
    $(".fancybox").on("click", function() {
        $("#inline1").fancybox().trigger('click');
    })
});

jsFiddle: my code

Any Idea?

Thanks

Upvotes: 1

Views: 113

Answers (2)

Anil kumar
Anil kumar

Reputation: 4177

$(".fancybox").on("click", function() {
    $.fancybox($('#inline1').html())
})

check here

Upvotes: 0

Tim Sheehan
Tim Sheehan

Reputation: 4014

There was a problem with the triggering of 'click', I managed to fix this by simply using the Fancybox API to open the Fancybox without requiring a trigger.

$(".fancybox").on("click", function () {
    $.fancybox.open( '#inline1' )
});

http://jsfiddle.net/xW5gs/1171/

Upvotes: 1

Related Questions