$('.wo_content_container').hover(function(){ var element = $(this); if (!hasEditUrl(element)) return; element.addClass('active'); var editIcon = '
'; element.append(editIcon); }, function(){ var element = $(this); if (!hasEditUrl(element)) return; element.removeClass('active'); element.find('.edit-button').fadeOut(function(){ $(this).remove(); }); }); $(document).on('click', '.edit-button', function() { var editUrl = $(this).parents('.wo_content_container').attr('edit-url'); if (editUrl) { $.fancybox.open({ href : 'http://inspire.com:8080/Weborient_Web/administrator/dashboard.htm?oab=true&comp=true&lpp=' + encodeURIComponent(editUrl) + '&lap=i', type : 'iframe', padding : 5, afterClose: function() { var mask = '