编写自己的jQuery提示框(Tip)插件

2020-05-23 06:00:53易采站长站整理

                    this.tip.css({top: top, left: left});
                    break;
                case ‘right’ :
                    top = (eTop – tiph/2) + eHeight/2;
                    left = eLeft + eWidth;
                    this.tip.css({top: top, left: left});
                    break;
                default:
                    break;
                }
            } else {
                this.tip.css({display:’block’});
            }
        },
        hide : function() {
            this.getTip().css({display:”none”});
        },
        getTip : function() {
            return this.tip ? this.tip : $(this.options.template);
        },
        detach : function() {
        },
        defaultOptions :{
            title : ”,
            content : ”,
            direction : ‘bottom’,
            html : false,
            template : ‘<div class=”tip”><div class=”tip-inner”><h3></h3><div class=”tip-container”></div></div></div>’
        }
    }