Can't open a URL in fancybox - beginner

5,220 views
Skip to first unread message

estherM

unread,
Apr 4, 2011, 12:35:41 PM4/4/11
to fancybox
I have a contest entry site that requires a file upload to an external
service. Right now, we just have a link to that external service, but
we've found that even if we open the link in a separate tab/window,
users sometimes forget to come back and complete the rest of our
application. (This external service has no API for allowing us to do
the uploads seamlessly from our site.)

Someone on stackoverflow suggested it was possible to use fancybox to
open an external URL. (I'm not looking to control that URL in any way;
I just want to keep the users on our main page while at the same time
preventing them from being able to interact with the rest of our site
until they've completed the upload.)

I've tried, but cannot get it to work. The popup works, but no matter
what URL I use, it gives me this message in the box: "The requested
content cannot be loaded. Please try again later." Also, even though I
have showCloseButton set to true and the height and width attributes
set, it's ignoring those params.

Here's my code sample: http://www.esthermstrom.com/test/fancybox.html

Per the suggester's comments, I've tried setting the URL of the link
to http://www.google.com just to make sure there wasn't something
funky about the site I'm trying to link to. Same results. I've also
(per suggestion) tried removing/setting to false the modal param (even
though the whole point of this is to be modal), but it's still the
same - no URL will open in the box that pops up.

Any ideas?

Tony Alfrey

unread,
Apr 4, 2011, 12:47:22 PM4/4/11
to fanc...@googlegroups.com
Like this:
add type iframe and make sure no comma in the last option.


$(function() {
$("#dropLink").click(function() {
$.fancybox({
'padding' : 0,
'modal' : true,
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'title' : 'Upload Video',
'width' : 680,
'height' : 495,
'showCloseButton' : true,
'type' :'iframe'

});

return false;
});
});


--
Tony Alfrey
tonya...@earthlink.net
"I'd Rather Be Sailing"

estherM

unread,
Apr 4, 2011, 12:56:56 PM4/4/11
to fancybox
Thanks. That helps, sort of. It now opens something, but not the URL I
have listed in my link's href. I have no idea what the URL is that
it's actually opening. It's also still ignoring the showCloseButton
param, so with modal set, there's no way to actually close the modal
dialog and get back to the main page.
> > tohttp://www.google.comjust to make sure there wasn't something
> > funky about the site I'm trying to link to. Same results. I've also
> > (per suggestion) tried removing/setting to false the modal param (even
> > though the whole point of this is to be modal), but it's still the
> > same - no URL will open in the box that pops up.
>
> > Any ideas?
>
> --
> Tony Alfrey
> tonyalf...@earthlink.net

Tony Alfrey

unread,
Apr 4, 2011, 2:40:42 PM4/4/11
to fanc...@googlegroups.com
Ha! Yeah, I'm asleep at the switch.
Do it the easy way:

<script type="text/javascript">
$(document).ready(function() {
$("#dropLink").fancybox({

'padding' : 0,


'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'title' : 'Upload Video',
'width' : 680,
'height' : 495,

'type': 'iframe'

});
});

</script>


--
Tony Alfrey
tonya...@earthlink.net

estherM

unread,
Apr 4, 2011, 3:28:05 PM4/4/11
to fancybox
Thanks! That did it.
> >>> tohttp://www.google.comjustto make sure there wasn't something
Reply all
Reply to author
Forward
0 new messages