0


I'm using the fancybox plugin for ajax and images displays and it's working fine when it's a simple scenario. But I'm dealing with quite a tricky issue here.

I have a link which does an ajax call via fancybox, and returns an HTML code with a image within (<img /> tag). From what I do understand in the fancybox jquery plugin, the HTML is put into a tmp var via the html() jquery function. After that it calls the _process_inline() function in which the width and height of the fancybox box are calculated thanks to the height and width of the tmp var content.
The problem is that at this point, when I do a tmp.find("img").width() the value is 0 whereas the actual one is 560 pixels.


Does any of you know a solution to solve this problem apart from adding width and height attributes to the image?

Cheers,
Nicolas

1 Answer 1

2

No one ever suggested anything about this, so I decided to go to my first (and only) solution: adding width and height to the img tag.

Works like a charm although I'd have preferred a different solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.