zurb / joyride

jQuery feature tour plugin.
http://www.zurb.com/playground/jquery-joyride-feature-tour-plugin
1.42k stars 238 forks source link

Add support for `data-selector` #175

Open kkeiper1103 opened 10 years ago

kkeiper1103 commented 10 years ago

Using just data-id and data-class are rather limiting. Please add support for data-selector, so we can build our own jQuery selector for the target el.

jquery.joyride-2.1.js, Line 400 change to

var cl = settings.$li.attr('data-class'),
        id = settings.$li.attr('data-id'),
        selector = settings.$li.attr("data-selector"),
        $sel = function () {
          if (selector) {
              return $( selector );
          } else if (id) {
            return $(settings.document.getElementById(id));
          } else if (cl) {
            return $('.' + cl).filter(":visible").first();
          } else {
            return $('body');
          }
        };
ksjones commented 8 years ago

Great suggestion, I've removed the class and id parts, having an open selector is great. Thanks

nacesprin commented 8 years ago

What about this?