Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted August 11, 20222 yr I'm pretty much a noob when it comes to code, but I was able to successfully understand and implement the ips.ui.sticky as it was pretty straight forward. As part of my build, I would like for it to also be 'dismissible'. How would I go about inducing that element? TYIA
August 26, 20222 yr Author Since no responses, I am going to guess that this is not possible with IPS?
August 26, 20222 yr Hi! Check this out: ;( function($, _, undefined){ "use strict"; ips.controller.register('plugins.globalMessageDismiss', { initialize: function () { this.on( document, 'click', '[data-action="dismiss"]', this.dismiss ); }, dismiss: function (e) { e.preventDefault(); var url = $( e.currentTarget ).attr('href'); var message = $(this.scope); ips.getAjax()(url).done(function(){ ips.utils.anim.go( 'fadeOut', message ); }).fail(function(){ window.location = url; }); } }); }(jQuery, _));
August 27, 20222 yr Author 11 hours ago, SeNioR- said: Hi! Check this out: ;( function($, _, undefined){ "use strict"; ips.controller.register('plugins.globalMessageDismiss', { initialize: function () { this.on( document, 'click', '[data-action="dismiss"]', this.dismiss ); }, dismiss: function (e) { e.preventDefault(); var url = $( e.currentTarget ).attr('href'); var message = $(this.scope); ips.getAjax()(url).done(function(){ ips.utils.anim.go( 'fadeOut', message ); }).fail(function(){ window.location = url; }); } }); }(jQuery, _)); Thanks! Will look at this after I get some coffee in me.