javascript - Best way to use multiple functions in jquery plugin development -


suppose have plugin named jquery.area.js , have various methods triangle, square etc

$.fn.area = function( options ){          if(options == 'sqaure')         {             square();         }else if(options == 'circle')         {             circle();         }        ......and on } 

how use this? proper way have multiple function in jquery plugin?

$("#show").click( function(){         $(".area1").area('circle',{             x : 5         }); 

is right way?


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -