$(document).ready(function(){
  // Get Weather
  $('button').on('show.weather', function() {
    var results = $(this).closest('li').find('.results');
    results.append('<p>Weather: 74&deg;</p>');
    $(this).off('show.weather');
  });

  // Show Photos
  $('button').on('click.photos', function() {
    var tour = $(this).closest('li');
    var results = tour.find('.results');
    results.append('<p><img src="/assets/photos/'+tour.data('loc')+'.jpg" /></p>');
    $(this).off('click.photos');
    $(this).trigger('show.weather');
  });
});

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2021-08-21
  • 2022-12-23
  • 2022-01-03
猜你喜欢
  • 2022-12-23
  • 2021-05-17
  • 2021-06-08
  • 2022-12-23
  • 2021-11-01
  • 2021-10-09
  • 2021-09-30
相关资源
相似解决方案