I used a javascript to update and manage data using $ .jax ({}) and external php scripts The object is created. When the object is called then the table element is returned from the object, which has many hidden trays (using the "hidden" square, which is set to display: none).
The display function inside the object is:
this.displayData = function (location_div) {var location_div = location_div; $ .ajax ({url: "display_data.php", type: "post", success: function (response) {$ (location_div). Html (feedback);}, error: function (response) {warning ("display Error problems. "+ Response)},}); }; that displays:
(Note: "#location_div" is the element passed to "displaydata (location_div)")
The problem occurs when trying to use jQuery Returns the returned data I have a function that looks for all the tricks, pushes everyone into the array, and then fades one by one in each one.
var elements_array = new array (); $ ("# Location_div Table Tables"). Children () Each (function () {elements_array.push (this);}); // function in the fadeAllIn (elements_array) for extinction in each element; As I understand, the Ajax loaded elements are not part of the DOM, and therefore one needs to use the JQuery function such as $ (element) .on (); Or $ (element) .live (); However, I have not tried anything that has worked table being loaded, but jQuery can not seem to select each tr .each () because the table is Ajax loaded.
Does anyone know its solution / solution? Is there any better solution for using jQuery to fade in every tr in the table?
I think you just need to tie your event / animation after loading dynamic data .
this.displayData = function (location_div) {var location_div = location_div; $ AZ ({url: "display_data.php", type: "post", success: function (feedback) {$ (location_div) .html (feedback); bine_avents ();}, error: function (feedback) {alerts (" Error displaying problems. "+ Response)},}); }; Var bind_events = function () {var elements_array = new array (); $ ("# Location_div Table Tables"). Children () Each (function () {elements_array.push (this);}); FadeAllIn (elements_array); };
No comments:
Post a Comment