979bb041104de8c409731cdcd5080c78e6eaf60d1ae48a85f1e700871ecb61b8

Source Code:

$(function (){

  var TOP_ua = window.navigator.userAgent.toLowerCase();
  if (TOP_ua.indexOf("msie") != -1){
    $(window).on('load resize', function(){
      $('#jbk-FloatingBannerArea').css("margin-right","15px");
      $('#jbk-FloatingBannerArea').css("margin-bottom","15px");
    });
  }else if(TOP_ua.indexOf('trident/7') != -1){
      $(window).on('load resize', function(){
        $('#jbk-FloatingBannerArea').css("margin-right","15px");
        $('#jbk-FloatingBannerArea').css("margin-bottom","15px");
      });
    }

  setTimeout(function() {
    var TOP_point_top = 0, TOP_point_bottom = 0;
    var TOP_content_position = 1;
    var TOP_content_height = $('html,body').height();
    var TOP_content_position_bottom = TOP_content_height - TOP_content_position - $(window).height();

    //cookieの値がonじゃなかったら表示させる
    if ($.cookie('jbk_top_bnrRead') != 'on') {
      if(TOP_content_position <= TOP_point_top && TOP_content_position_bottom >= TOP_point_bottom){
        $('#jbk-FloatingBannerArea').addClass('jbk-FloatingBannerArea_off');
        $('#jbk-FloatingBannerArea').removeClass('jbk-FloatingBannerArea_on');
      }else if(TOP_content_position > TOP_point_top && TOP_content_position_bottom >= TOP_point_bottom){
        $('#jbk-FloatingBannerArea').addClass('jbk-FloatingBannerArea_on');
        $('#jbk-FloatingBannerArea').removeClass('jbk-FloatingBannerArea_off');
      }else if(TOP_content_position > TOP_point_top && TOP_content_position_bottom < TOP_point_bottom){
        $('#jbk-FloatingBannerArea').addClass('jbk-FloatingBannerArea_off');
        $('#jbk-FloatingBannerArea').removeClass('jbk-FloatingBannerArea_on');
      }
    }
  },0);



  //隠すボタンをクリックしたらバナーを隠す
  $('#jbk-FloatingBannerArea .img-FloatingBanner-close').click(function() {

    $('#jbk-FloatingBannerArea').addClass('jbk-FloatingBannerArea_off');
    $('#jbk-FloatingBannerArea').removeClass('jbk-FloatingBannerArea_on');

    $.cookie('jbk_top_bnrRead', 'on', { //cookieにjbk_top_bnrReadという名前でonという値をセット
      expires: 1, //cookieの有効日数
      path:'/' //有効にするパス
    });
  });
});