【jQuery】Techniques for implementing a simple callout using 'this'/Easy balloon tips | Demo page

※Please check using Developer tools

Commentary

Sponsored links

CSS

.wrap {
  width: 768px;
  margin: 200px auto 0;
}

.list {
  text-align: center;
}

.list li {
  position: relative;
  display: inline-block;
  margin: 0 10px;
}

.balloon {
  display: none;
  position: absolute;
  bottom: 25px;
  left: 0;
  border: 1px solid #000;
  width: 150px;
  line-height: 1.5;
  padding: 10px;
  background: #fff;
  z-index: 2;
  font-size: 12px;
  word-break: break-all;
}

.bk-balloon {
  display: none;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media screen and (max-width:640px){
  .wrap {
    width: 100%;
  }
  .list {
    text-align: left;
  }
  .list li {
    display: block;
    margin: 0 0 150px;
  }
  .balloon {
    width: 100%;
  }
}
  

JavaScript

$(function(){
  $('.list li a').on('click', function() {
    $(this).children().fadeIn();
    $(".bk-balloon").fadeIn();
  })
  $('.bk-balloon').on('click', function() {
    $(".balloon,.bk-balloon").fadeOut();
  });
});