openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

jquery-plugin-toggleAttr.js (237B)


      1 import $ from "../jquery-global.js";
      2 
      3 export default function(attr, attr1, attr2) {
      4 	return this.each(function() {
      5 		let self = $(this);
      6 		if (self.attr(attr) == attr1)
      7 			self.attr(attr, attr2);
      8 		else
      9 			self.attr(attr, attr1);
     10 	});
     11 };