$(function(){
  var tips;
  $('.tooltip').on({
    mouseenter: function() {
      var that = this;
      var content = $(this).data('content');
      if (!content) return;
      var maxWidth = $(this).data('width') || 300;
      tips = layer.tips("<span style='color:#000;'>" + content + "</span>",
        that,
        {tips:[1,'#fff'],time:0,area: 'auto',maxWidth: parseInt(maxWidth)}
      );
      //tips = layer.tips("智能组卷：每个用户考试时抽到的试题及顺序随机组成", that, {tips: 1});
    },
    mouseleave: function() {
      layer.close(tips);
    }
  });
});