Hey there,
The issue I'm having is effects like .slideDown() are not working correctly on elements appended to the DOM after page load. I have a $.post() call and I get the result. I add the result to my page using document.createElement() and then finally want the result to slideDown() but it just magically appears with no affect.
- $('#category_list').append('<div id="category_row'+category_id+'" style="display:none;"></div>');
- /* ++++TITLE+++++ */
- var div1 = document.createElement('div');
- div1.setAttribute('id', 'category_title_'+category_id);
- div1.className = 'grid_4';
- div1.innerHTML = '<strong>' + category_order + '. ' + category_name + '</strong>';
- $('#category_row_'+category_id).append(div1);
- /* ++++EDIT+++++ */
- var div2 = document.createElement('div');
- div2.setAttribute('id', 'category_edit_'+category_id);
- div2.className = 'grid_4';
- var button = document.createElement('button');
- button.innerHTML = document.getElementById('edit_text').innerHTML;
- button.onclick = function(){
- editCategory(category_id, category_name, category_order);
- }
- div2.appendChild(button);
- $('#category_row_'+category_id).append(div2);
- /* ++++REMOVE+++++++ */
- var div3 = document.createElement('div');
- div3.className = 'grid_4';
- div3.setAttribute('id', 'category_remove_'+category_id);
- var button2 = document.createElement('button');
- button2.innerHTML = document.getElementById('remove_text').innerHTML;
- button2.onclick = function(){
- removeCategory(category_id);
- }
- div3.appendChild(button2);
- $('#category_row_'+category_id).append(div3);
- /* +++++CLEAR+++++ */
- var div4 = document.createElement('div');
- div4.className = 'clear';
- $('#category_row_'+category_id).append(div4);
- /* +++++++++++++++++ */
- $('#category_row_'+category_id).slideDown('slow');
On line 1 I initially had the category_row_category_id div created with document.createElement as well -- I had just changed it to see if that was the issue.
I did a search on the forum and found a post about ajax calls messing with effects but its just a bunch of jibberish.
Thanks in advance,
Lang14