I have PHP code to generate a graph, it runs with AJAX, and then it would show up in hidden and using id I show it in fancy box, it works but it takes time for PHP to run and fancy box at first shows loader, then an image is finnally made it would apear in fancybox but it's size stays the same 50px x 50px (or something). I tryed every solution on this link How do you resize Fancybox at runtime? none of it worked or I was donig something wrong(I'm just starting with whole JS). It shows whole image after the window is resized maybe I could simulate some kind of resizing with some function, I don't know...Thanks in advance!
Added code (I don't think it will help):
JS
function graph2()
{
var ajax = getRequest();
ajax.onreadystatechange = function()
{
if(ajax.readyState == 4)
{
document.getElementById('graph').innerHTML = ajax.responseText;
}
}
document.getElementById('graph').innerHTML = "<br/><img src=img/ajax-loader.gif><br/><br/>";
ajax.open("GET", "graph_2.php?", true);
ajax.send(null);
}
HTML
<a class="graph" rel="group" onclick='graph2(); return false;' id="menu_button" href="#graph">Skambučiai per diena</a>
<span id="graph" display="none"></span>
Fancybox
$(document).ready(function()
{
$(".graph").fancybox(
{
helpers:
{
title :
{
type : 'float'
}
},
autoSize : true,
});