The issue you have is that you are loading an iframe
as inline content so regardless it's visible or not, it still loads in the background.
What you have to do is, instead of targeting the inline selector #image_link
, target directly to the contents of the iframe
(the value of its src
attribute) in your <a>
tag like :
<a href="http://www.putlocker.com/embed/E25FA20CE8643E5F" title="PutLockerMedia" id="click">watch</a>
... and that's the only html you need (you can delete the hidden div
)
Then use this code :
$(document).ready(function () {
$("#click").fancybox({
type: "iframe",
width: 600,
height: 360
});
});
See JSFIDDLE