Currently, I am utilizing the flot library for data plotting functionality. Flot utilizes the height and width properties of a div to create the plotted data, as shown below:
<div id="graph" style="width: 300px; height: 300px;"></div>
I am interested in making this graph (div) clickable so that it can expand to a larger size, such as 500*500. Initially, the plot should be visible in dimensions of 300*300. Upon clicking, it should expand to its original size. I understand that setting initial height and width is necessary for flot to function properly. How can I achieve this effect?
Some techniques I have attempted include: 1) Using jQuery toggle to target the parent class and animate its height and width attributes like so:
$(this).parent().animate({'height': '500px'},{'width': '500px'});