Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I am trying to write a widget which will show up on button click. This is a jQuery representation of what I want to achieve. jQuery (This is not my code. Found this one on net) I am not sure how to go on with the development. Should the directive needs to an element or an attribute or something else. I have not tested this as I am not sure about going on about this. This is how I planned to do.

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();
            })
        })
    }
}});

Thanks in advance.

Update: The Custom Popover is what I am trying to achieve. Custom Popover

share|improve this question
    
Also, getting a Unknown provider: $popoverProvider <- $popover <- shareModalDirective error. The error I believe is due to no Controller – maddog Sep 29 '14 at 23:51
up vote 0 down vote accepted

I fixed it by injecting the module 'mgcrea.ngStrap'

share|improve this answer
    
wow! i had forgotten about this. thanks for the update. – maddog Sep 10 '15 at 16:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.