[jQuery] Problem accessing current element from plugin

[jQuery] Problem accessing current element from plugin


Good Afternoon All,
I currently in the process of writing my first plugin, but I seem to
have run into a bit of a snag. The plugin will simplify using the
Yahoo Maps AJAX API, and as such requires an empty container to draw
the map in. I have an empty container on my page:
<div id='mapContainer'></div>
I'm trying to tell the plugin to use #mapContainer to draw the map in:
$('#mapContainer').ymap();
I've tried using:
var self = false;
var map = false;
return this.each(function() {
self = this;
map = new YMap(self, settings.mapType);
}
Similar to the way I have seen done in other plugins. The problem is
that at this point the script goes off into 'limbo' and returns
absolutely nothing. I've tried putting alerts and 'document.write()'
statements before, in and after 'this.each(function(){})'. I get
messages before and in 'this.each' but not after.
Any help would be greatly appreciated.