使用jQuery的Angular Widget

时间:2014-09-29 18:21:41

标签: jquery angularjs angularjs-directive popup angularjs-controller

我正在尝试编写一个小部件,它将显示在按钮点击上。 这是我想要实现的jQuery表示。 jQuery (This is not my code. Found this one on net) 我不知道如何继续开发。指令是否需要元素或属性或其他内容。 我没有对此进行测试,因为我不确定是否继续这样做。这就是我计划做的事情。

angular.module('common').directive('shareModal',function (){

return {
    restrict: 'E',
    show: '=',
    transclude: true,
    replace: true,
    template: '',
    link: function (scope, elem, attrs) {

        $(elem).click (function() {
            var $this = $(this);
            $("#background").css({
                 "opacity": "0.3"
            }).fadeIn("slow");

            $("#large").html(function() {
                $('.ttip').css({
                                   left: $this.position() + '20px',
                                   top: $this.position() + '50px'
                               }).show(500)

            }).fadeIn("slow");

            $('.note').on('click', function() {
                $('.ttip').hide(500);
                $("#background").fadeOut("slow");
                $("#large").fadeOut("slow");

            });
            $("#large").click(function() {
                $(this).fadeOut();
            })
        })
    }
}});

提前致谢。

更新: Custom Popover是我想要实现的目标。 Custom Popover

0 个答案:

没有答案
相关问题