2
votes

im trying to display inline using fancybox. but currently it pops up but displaying error "The requested content cannot be loaded. Please Try again later." . below is the code.

<script type="text/javascript">
jQuery(document).ready(function() {

$(".various").click(function() {
    parent.$.fancybox({
        'padding'       : 0,
        'autoScale'     : false,
        'transitionIn'  : 'none',
        'transitionOut' : 'none',
        'width'         : 640,
        'height'        : 385,
        'type'          : 'inline'
    });

    return false;
});



});
</script>

and where i used fancybox

<a class="various" href="#inline3">Inline</a>
    <div id="inline3" style="display:none;" ><img src="https://xxxxx" /></div>

FOUND A SOLUTION!

the thing is, i need to change type from inline to iframe. and also insert a 'href' string inside the javascript and remove the href from the link. and for the href value put in "this.href" ... and now it works.

2

2 Answers

0
votes

ITs simple,

If the image is not loaded, it will happen,

Please check the image source in img tag then proceed.

0
votes
$('.fancybox').fancybox({
            autoSize : true,
            autoResize : true,
            autoDimensions : false,
            padding: 25,
            width : 630,
            openEffect : 'elastic',
            closeEffect : 'elastic',
                        type : 'iframe',
                        href :'Pass your url'
});

In my case, instead of using this.href, I passed url, and its working form me.