Fancybox iframe loading icon fix

1,381 views
Skip to first unread message

Jas

unread,
Jun 26, 2009, 4:50:33 AM6/26/09
to fancybox
Fancybox doesnt show the loading icon when opening an iframe... to fix
this put the following code:

$.fn.fancybox.showLoading();

On line 131 directly below:

} else if (href.match("iframe") || elem.className.indexOf("iframe") >=
0) {

Problem solved :-)

X10

unread,
Jun 28, 2009, 8:09:13 AM6/28/09
to fancybox
Hey Jas,
I tried as you suggested but it doesn't seem to work for me.

I turned these lines:

} else if (href.match("iframe") || elem.className.indexOf
("iframe") >= 0) {
_set_content('<iframe id="fancy_frame"
onload="$.fn.fancybox.showIframe()" name="fancy_iframe' + Math.round
(Math.random()*1000) + '" frameborder="0" hspace="0" src="' + href +
'"></iframe>', opts.frameWidth, opts.frameHeight);

into these lines:

} else if (href.match("iframe") || elem.className.indexOf
("iframe") >= 0) {
$.fn.fancybox.showLoading();
_set_content('<iframe id="fancy_frame"
onload="$.fn.fancybox.showIframe()" name="fancy_iframe' + Math.round
(Math.random()*1000) + '" frameborder="0" hspace="0" src="' + href +
'"></iframe>', opts.frameWidth, opts.frameHeight);

Is that what you meant?

I'm also using the edit that allows the easing for iFrame / AJAX
content, would this affect this?

X10

Jason

unread,
Jul 6, 2009, 5:38:31 AM7/6/09
to fancybox
Hi X10,

Yes that's what I meant, I havent tested it with easing on the iframe
though so I am not sure if it will work.

Jas

On Jun 28, 1:09 pm, X10 <ecks...@gmail.com> wrote:
> Hey Jas,
> I tried as you suggested but it doesn't seem to work for me.
>
> I turned these lines:
>
>                          } else if (href.match("iframe") || elem.className.indexOf
> ("iframe") >= 0) {
>                                 _set_content('<iframeid="fancy_frame"
> onload="$.fn.fancybox.showIframe()" name="fancy_iframe' + Math.round
> (Math.random()*1000) + '" frameborder="0" hspace="0" src="' + href +
> '"></iframe>', opts.frameWidth, opts.frameHeight);
>
> into these lines:
>
>                          } else if (href.match("iframe") || elem.className.indexOf
> ("iframe") >= 0) {
>                          $.fn.fancybox.showLoading();
>                                 _set_content('<iframeid="fancy_frame"
> onload="$.fn.fancybox.showIframe()" name="fancy_iframe' + Math.round
> (Math.random()*1000) + '" frameborder="0" hspace="0" src="' + href +
> '"></iframe>', opts.frameWidth, opts.frameHeight);
>
> Is that what you meant?
>
> I'm also using the edit that allows the easing foriFrame/ AJAX
> content, would this affect this?
>
> X10
>
> On Jun 26, 9:50 am, Jas <emailf...@gmail.com> wrote:
>
> > Fancybox doesnt show theloadingicon when opening aniframe... to fix
Reply all
Reply to author
Forward
0 new messages