Jump to content

Recommended Posts

Posted

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

  • 2 weeks later...
Posted

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, _));

 

Posted
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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...