Note that there are some explanatory texts on larger screens.

plurals
  1. POFancybox loading animation does not trigger
    primarykey
    data
    text
    <p>Is there any particular reason why fancybox function</p> <pre><code>$.fancybox.showActivity(); </code></pre> <p>throws an error in my script? Is there a specific order in which the functions need to be called? The function is intended to show the loading image before the content is loaded to the popup. Here's my code:</p> <pre><code>$(".info_button").click(function () { var pictid_browse = $(this).parent().find('#pictid').val(); $.fancybox.showActivity(); $.ajax({ url: "ajax.html", type: "POST", async:false, data: ({f:"get_info",pictid:pictid_browse}), success: function(data){ $.fancybox({ 'autoDimensions' : false, 'width' : 950, 'height' : 'auto', 'transitionIn' : 'none', 'transitionOut' : 'none' }); $.fancybox({content:data,'autoDimensions':true,'scrolling':'no',}); } }); return false; }); </code></pre> <p>The errors I'm getting are:</p> <pre><code>Uncaught TypeError: Object function () { F.open.apply( this, arguments ); } has no method 'showActivity' </code></pre> <p>or</p> <pre><code>TypeError: 'undefined' is not a function (evaluating '$.fancybox.showActivity()') </code></pre> <p>Fancybox version: 2.1.3</p> <p><strong>UPDATE:</strong></p> <p>I have no clue what is going on but if I place the</p> <pre><code>$.fancybox.showLoading(); </code></pre> <p>outside of </p> <pre><code>$(".info_button").click(function () { </code></pre> <p>then it fires and shows the animation. But I need it to happen once the item of a class '.info_button' i clicked</p> <p>The following solution does not seem to solve the problem either:</p> <pre><code> $(".info_button").bind('click', function (e) { e.stopPropagation(); e.preventDefault(); } </code></pre> <p>The research shows that the loading is triggered if the following code is deleted:</p> <pre><code> $.fancybox({ content:data, 'autoDimensions' : true, 'width' : 'auto', 'height' : 'auto', 'transitionIn' : 'none', 'transitionOut' : 'none', 'scrolling':'no' }); </code></pre> <p>This may mean that the fancybox does not work fine when included inside ajax function, but why-I have no clue</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload