code in one plugin accessing features/functions in another plugin ?

code in one plugin accessing features/functions in another plugin ?

well what my title says .. is that possible . i am pritty much almost sure its possible , i don't know if its a common use case , but is it possible ? 

I came across an interesting case recently , i was going the source of a simple carousel plugin : unslider.js . 


the carousel is a lightweight one , it says the following about adding mobile , touch , swipe support : 

If you want to add mobile/touch/swipe/whatever support to Unslider, you’ll need to include the   jQuery.event.swipe   plugin, then it’ll work out the box. Easy! . 

now going through the unslider.js code , i came across the following peice of code : 

  1. if ($.event.special['move'] || $.Event('move')) {
  2. el.on('movestart', function(e) {
  3. if ((e.distX > e.distY && e.distX < -e.distY) || (e.distX < e.distY && e.distX > -e.distY)) {
  4. e.preventDefault();
  5. }else{
  6. el.data("left", _.ul.offset().left / el.width() * 100);
  7. }
  8. }).on('move', function(e) {
  9. var left = 100 * e.distX / el.width();
  10.        var leftDelta = 100 * e.deltaX / el.width();
  11. _.ul[0].style.left = parseInt(_.ul[0].style.left.replace("%", ""))+leftDelta+"%";

  12. _.ul.data("left", left);
  13. }).on('moveend', function(e) {
  14. var left = _.ul.data("left");
  15. if (Math.abs(left) > 30){
  16. var i = left > 0 ? _.i-1 : _.i+1;
  17. if (i < 0 || i >= len) i = _.i;
  18. _.to(i);
  19. }else{
  20. _.to(_.i);
  21. }
  22. });
  23. };

  24. return _;
  25. };
now is that peice code interacting with the functionality of an external plugin ?? i mean Jquery.event.swipe.js ?? also i guess since both are separate plugins and they have thier code enclosed within themselves , , how does the functionality of Jquery.event.swipe.js  become available to unslider.js ?? 

also if i don't load Jquery.event.swipe.js in the script tags before unslider.js , is the above peice of code rendered usless ?? 

Thank you. 

gautam.