Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. $.fn.dyna_select = function (options){
  2.  
  3. init: function (options) {
  4.  
  5. parent_group = $(this).data('dyna-select');
  6.  
  7. dyna_show_class = $(this).val().toLowerCase().split(' ').join('_');
  8.  
  9. $(options.parent).find("[data-dyna-parent='"+parent_group+"']").each(function(){
  10.  
  11. if($(this).hasClass(dyna_show_class)) {
  12.  
  13. $(this).removeClass('hide');
  14.  
  15. } else {
  16.  
  17. $(this).addClass('hide');
  18.  
  19. }
  20.  
  21. });
  22.  
  23. }
  24.  
  25. $(this).on('change', function () {
  26.  
  27. this.init(options);
  28.  
  29. });
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement