Hi, I'm using some dialogs with tabs in it. I was wondering if it's possible to create something like a tabbed dialog, e.g. having the tab-links in the head of the dialog, because it takes a lot of space for 2 head-sections. Yesterday I found an old solution for this, but this doesn't seem to work correct with the current version, and it was not that clean...
Hi, I'm looking for the possibility of resizing the height of an dialog with a smooth animation (like .toggle() does it).
I'm using some ajax-tabs inside of an dialog, whith each tab having different height values. I need to set the height of the dialog manually. At the moment i'm resizing the dialog with
The .data() function returns inconsistent values: If you try to load a not-existing-value of an object, which does not have ANY values stored, it will return null. But if this object has ANY value stored in it, and you load the not-existing-value, it returns "undefined".
Hi, I think i found a problem in jQuery. If you store the options and properties for el.animate() in el.data(), it will end up in an stack overflow.
jQuery version: 1.4.2.min Firefox version: 3.6
The way i used it: I stored the information in data() on pageload. When calling the animate function, i recieve them from data(), and pass them to animate(). This works, if you only call the animate function once. (e.g. to hide a div) If you call it again in order to show the div, you will have firefox posting endless "too much recursion" errors in the console, until you close the tab.
I think i found the reason why: Before animate() is called, the "animationoptions" object in .data() only is: { 'duration' : 150 } After the call, there are 2 more elements in the object:
old: undefined complete: function()
(see attached picture)
The function directs to the jQuery-core, I can't give you more information using the min-version.
Based on this information, i was able to build a workaround: When receiving the info from data(), i clone the objects using extend(), and pass the clone to animate().
Heres an example code. There are 2 buttons, one calls the buggy version on a div, and one calls the version with workaround on another div. Both divs get the same information on pageload. Make sure you try to click the buttons more then 1 time, and watch firebug console.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Test page</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> </head> <body> <div id="notworking" style="border: 1px solid red;"> This one is not working. </div> <br> <div id="working" style="border: 1px solid black;"> This one is working. </div>
$("#buttonNotWorking").bind('click', function(){ var divNotWorking = $("#notworking");
var anprop = divNotWorking.data("animationproperties"); var anopt = divNotWorking.data("animationoptions");
divNotWorking.animate(anprop, anopt); }); $("#buttonWorking").click(function(){ var divWorking = $("#working");
var anprop = divWorking.data("animationproperties"); var anopt = divWorking.data("animationoptions"); // clone the objects var anpropClone = jQuery.extend(true, {}, anprop); var anoptClone = jQuery.extend(true, {}, anopt);