Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [JavaScript][HTML]Select się nie rozwija, pod firefox
kamil_lk
post
Post #1





Grupa: Zarejestrowani
Postów: 325
Pomógł: 33
Dołączył: 31.05.2008

Ostrzeżenie: (0%)
-----


Cześć.

Mam pewien problem z listą rozwijaną. Mianowiście pod firefoxem nie chce mi się ona rozwinąć.
Pod chrome działa jak trzeba.
Dodam, że dana lista jest dodawana do dokumentu html poprzez jquery.

Miał ktoś podobny problem?
Go to the top of the page
+Quote Post
Kshyhoo
post
Post #2





Grupa: Opiekunowie
Postów: 3 855
Pomógł: 317
Dołączył: 4.01.2005
Skąd: że




W mojej stopce jest link do odpowiedniej strony, gdzie możesz to sprawdzić...
Go to the top of the page
+Quote Post
kamil_lk
post
Post #3





Grupa: Zarejestrowani
Postów: 325
Pomógł: 33
Dołączył: 31.05.2008

Ostrzeżenie: (0%)
-----


Niestety żadna wróżba nie pomogła (IMG:style_emoticons/default/wink.gif)
plik html
  1. <div id="user_data">
  2. <div class="user_content">
  3. <div class="user">John Kowal - jkowal<span class="id_user">1</span></div>
  4. <ul style="display: block;" class="user_objects connectedObject ui-sortable">
  5. <li class="survey-2 id-1">survey title1<span class="trash">[x]</span>
  6. <form action="" method="post">
  7. <select name="privilage_type">
  8. <option>select 1</option>
  9. <option>select 2</option>
  10. <option>select 3</option>
  11. </select>
  12. </form>
  13. </li>
  14. </ul>
  15. </div>
  16. </div>


plik js
  1. $("#user_data").on('click', 'div.user', function() {
  2. object = $(this).next();
  3. if (object.css('display') == 'none') {
  4. $("ul.user_objects").hide();
  5. object.show();
  6. id_user = $(this).children().html();
  7. data_user_objects = getObjectsUser(id_user);
  8. $(this).parent().children().next().html(data_user_objects);
  9. } else {
  10. object.hide();
  11. $('#objects li').show();
  12. }
  13. });
  14.  
  15. function getObjectsUser(id_user) {
  16. data_user_objects = '';
  17. $.ajax({
  18. type: "POST",
  19. url: "modules/3.4.1.2/index.php?action=getObjectsUser",
  20. async: false,
  21. data: {
  22. id_user: id_user
  23. },
  24. success: function(msg) {
  25. if (typeof msg !== 'undefined') {
  26. if (isJSON(msg)) {
  27. msg = jQuery.parseJSON(msg);
  28. user_programs = userPrograms(msg['programs']);
  29. data_user_objects = user_programs + user_surveys + user_videos;
  30. }
  31. }
  32. },
  33. error: function() {
  34. alert("Connection error!!!");
  35. }
  36. });
  37. return data_user_objects;
  38. }
  39.  
  40. function userPrograms(programs) {
  41. if (programs) {
  42. $('div.programs li').show();
  43. i = 0;
  44. user_program = '';
  45. $(programs).each(function() {
  46. $('div.programs li.id-'+programs[i]['id_program']).hide();
  47. user_program += '<li class="program-1 id-' + programs[i]['id_program'] + '">' + programs[i]['title'] + '<span class="trash">[x]</span>';
  48. user_program += '<form action="" method="post"><select name="privilage_type"><option>select 1</option><option>select 2</option><option>select 3</option></select></form>';
  49. user_program += '</li>';
  50. i++;
  51. });
  52. return user_program;
  53. }
  54. }
Go to the top of the page
+Quote Post
Kshyhoo
post
Post #4





Grupa: Opiekunowie
Postów: 3 855
Pomógł: 317
Dołączył: 4.01.2005
Skąd: że




Cieszę się, że pojąłeś moją aluzję (IMG:style_emoticons/default/wink.gif)
Muszę Cię zmartwić: Twój select się rozwija - patrz. Nawet z jQuery - patrz.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 05:12