auto detect size of SWF

754 views
Skip to first unread message

Schnitzel

unread,
Mar 5, 2010, 12:53:25 PM3/5/10
to fancybox
Hi,

i have some SWF-files with diverent sizes (1024x576, ect.). I want
that fancybox always displays the original size of the SWFs
automaticly.

At the Moment my Code looks like this:

$("a#source").fancybox({
'type' : 'swf',
'padding' : 0,
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none'
});

But at this Point i always get one Containersize for every SWF and the
fancybox resizes the Files into this Container.

Maybe the problem is that i get the "path" from Worpdress
(CostomFields). Is it possible to get the sizeinformations from swf-
file in any way?!
Any Solutions?

Thanks

AC Design

unread,
Mar 5, 2010, 3:02:42 PM3/5/10
to fancybox
did u try

'autoScale' : true,

?

Janis

unread,
Mar 5, 2010, 3:16:58 PM3/5/10
to fancybox
No, it`s not possible to get width/height from swf file as they are
generally scalable. 'autoScale' works only for html elements.

Janis

Schnitzel

unread,
Mar 8, 2010, 3:43:19 AM3/8/10
to fancybox
i can write one function with the axact height and width information
for every swf File to get it work

$("a#source1").fancybox({
'height' : '1024',
'width' : 576
});
$("a#source2").fancybox({
'height' : '800',
'width' : 600
});
and so on…
but i dont want redundant code
so there is no way to write only one function for every swf file and
size…

Janis

unread,
Mar 8, 2010, 11:19:32 AM3/8/10
to fancybox
Actually ... there is a way. FancyBox since 1.3.1 has support of
"metadata" plugin. So, if you include http://plugins.jquery.com/project/metadata
than you can pass custom params - <a class="fancybox_swf {width:
800,height:600}" href="...">...</a>

Janis

Schnitzel

unread,
Mar 10, 2010, 8:42:10 AM3/10/10
to fancybox
hm…every time i want to load the jquery.metadata.js into my page, the
other Javascript-files are not working anymore

<script type="text/javascript" src="http://code.jquery.com/
jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<?php
bloginfo('template_directory') ?>/js/jquery.metadata.js"></script>
<script type="text/javascript" src="<?php
bloginfo('template_directory') ?>/js/fancybox/
jquery.fancybox-1.3.1.js"></script>
<script src="<?php bloginfo('template_directory') ?>/js/filterable.js"
type="text/javascript" charset="utf-8"></script>

any solution for that problem :c)


On 8 Mrz., 17:19, Janis <janis.skarne...@gmail.com> wrote:
> Actually ... there is a way. FancyBox since 1.3.1 has support of

> "metadata" plugin. So, if you includehttp://plugins.jquery.com/project/metadata


> than you can pass custom params - <a class="fancybox_swf {width:
> 800,height:600}" href="...">...</a>
>
> Janis
>
> On Mar 8, 10:43 am, Schnitzel <ruben.boeh...@googlemail.com> wrote:
>
> > i can write one function with the axact height and width information

> > for everyswfFile to get it work

Mauricio

unread,
Jun 27, 2013, 7:26:47 AM6/27/13
to fanc...@googlegroups.com
This seems to be an old topic, but I'm experiencing the same issue, did find any solution for this? if did so, do you mind to share it with me?
Reply all
Reply to author
Forward
0 new messages