EragonJ / Trip.js

🚀 Trip.js is a plugin that can help you customize a tutorial trip easily with more flexibilities.
https://eragonj.github.io/Trip.js/
MIT License
793 stars 109 forks source link

Add width option to trips #89

Closed mbrostami closed 9 years ago

mbrostami commented 9 years ago

Thanks Trip.js. I want to limit trip block of some trips to an special width. I do this by adding these lines of code :

this.settings = $.extend({
    width: 'auto',
    ...
});

And this :

setTripBlockPosition: function(o, horizontalOrVertical) {  
      var $tripBlock = this.$tripBlock;   
      if (o.width) {
          $tripBlock.css({
              width: o.width
          });         
      } else {
          $tripBlock.css({
              width: this.settings.width
          });         
      }
      ....
}
EragonJ commented 9 years ago

Hi @mbrostami, I am glad you are using this plugin and this does help you ! With current design, I think you can easily make this happen using onTripStart() handler. You can check this link for more details about workflow : https://github.com/EragonJ/Trip.js/wiki/Workflow-inside-Trip.js-(When-to-call-onXYZ-callbacks)

If I was the one who tries to accomplish with Trip.js, I think I would override specific step with CSS to make sure these UI works are not included in scripts. For me, this is a better approach for this use case.