Guest User

Untitled

a guest
Feb 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. I'm trying to populate a hidden <div> with an AJAX call, and then show that <div> with a scriptaculous effect. The AJAX works, but the <div> appears suddenly without the slide effect. Thanks for any help.
  2.  
  3. Here's the relevant HTML:
  4.  
  5. <div id="admin_populated_user_form" style="display: none">
  6. <div>
  7. </div>
  8. </div>
  9.  
  10. And the Javascript:
  11.  
  12. var sel = $('user_sel');
  13. sel.onchange = function () {
  14. var val = $F('user_sel');
  15. if( val != 0 ) {
  16. var ajax = new Ajax.Updater(
  17. 'admin_populated_user_form',
  18. '/admin/users/fetch_user',
  19. { method: 'get',
  20. parameters: 'user=' + val
  21. }
  22. );
  23.  
  24. Effect.toggle( 'admin_populated_user_form', 'slide' );
  25. }
  26. }
  27.  
  28.  
  29.  
  30. Thanks for any help.
Add Comment
Please, Sign In to add comment