You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fill_order_hotel.js 1.3 KiB

3 jaren geleden
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. window.onload = function() {
  2. addHandler($$('#room_count'), 'click', function() {
  3. $('.model_box_room_count').removeClass('fadeInUp animated');
  4. $('.model_box_room_count').removeClass('fadeInDown animated');
  5. $(".model_room_count").show();
  6. $('.model_box_room_count').show();
  7. $("#body_mod").addClass("mod_fil");
  8. $('.model_box_room_count').addClass('fadeInUp animated');
  9. })
  10. $(".room_count_num").on('click',function(){
  11. var count = $(this).text();
  12. $('.room_title').html('选择房间数 — '+count);
  13. $('.model_box_room_count').addClass('fadeInDown animated');
  14. setTimeout(function() {
  15. $('.model_room_count').hide();
  16. $('#body_mod').removeClass('mod_fil');
  17. }, 400);
  18. })
  19. $(".model_room_count").on("click", function(e) {
  20. $(".model_box_room_count").animate({
  21. height: "hide"
  22. }, 400, function() {
  23. $(".model_room_count").hide();
  24. $("#body_mod").removeClass("mod_fil");
  25. });
  26. });
  27. $(".model_box_room_count").on("click", function(e) {
  28. e.stopPropagation();
  29. });
  30. }
  31. //辅助函数
  32. function addHandler(element, type, handler) {
  33. try{
  34. element.addEventListener(type, handler, false);
  35. }catch(e){
  36. try{
  37. element.attachEvent("on" + type, handler);
  38. }catch(e){
  39. element["on" + type] = handler;
  40. }
  41. }
  42. }
  43. function $$(str) {
  44. return document.querySelector(str);
  45. }