I think I figured it out myself. I've moved the $(document).click and the declaration of $details to BEFORE the plugin definition, and the $ (".suggestion") methods to AFTER the end of the closure. I'm not sure if that falls within best practices, but it certainly works for what I need right now. Perhaps someone will point me to a better way of doing this in the future.
- T.J. On Dec 15, 11:30 am, "T.J. Simmons" <theimmortal...@gmail.com> wrote: > Well that's certainly one thought. :) > > Luis, to unsubscribe to gohttp://groups.google.com/group/jquery-en, > Edit my Membership and remove yourself there. > > On Dec 15, 9:38 am, "Luis Arcos G." <luis.ar...@gmail.com> wrote: > > > > > Unsubscribe > > > -----Mensaje original----- > > De: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] En nombre > > de T.J. Simmons > > Enviado el: martes, 15 de diciembre de 2009 12:02 > > Para: jQuery (English) > > Asunto: [jQuery] Plugin Questions > > > Hi all, > > > Got a question for you guys who're more knowledgeable than I am. I > > followed Mike Alsup's plugin development pattern > > athttp://www.learningjquery.com/2007/10/a-plugin-development-patternto > > create a plugin for a project I'm working on. It's a suggestion/ > > tooltip plugin, which although they've been written many times before, > > it was good experience in plugin-ifying my code so I can reuse it > > easily later. > > > However, my question is regarding the placement of some of the code; I > > have a block of code (the $(".suggestion") block) that I'm not sure of > > where it needs to be. It's honestly something that only needs to be > > called once to bind the event, but I don't want to have to place it by > > itself within a page; I want everything contained within the script > > for the plugin.. > > > and just now thinking about it, could I place it above the (function > > ($) { closure? Since script tags mingle together once they're loaded > > on the page, I assume that would work. Any thoughts or suggestions > > here would be greatly appreciated. Here's a link to the plugin > > code:http://jsbin.com/aweso3/edit > > > It's in the Javascript tab.. I've commented the area I'm curious > > about. > > > Thanks! > > > - T.J.