My Sharona Posted August 11, 2022 Posted August 11, 2022 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
My Sharona Posted August 26, 2022 Author Posted August 26, 2022 Since no responses, I am going to guess that this is not possible with IPS?
SeNioR- Posted August 26, 2022 Posted August 26, 2022 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, _)); My Sharona and Adriano Faria 1 1
My Sharona Posted August 27, 2022 Author Posted August 27, 2022 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.
Recommended Posts