开发者

DESPERATE Request - jQuery tag suggestion, How is it inserting the DOM Element SPAN?

Take a look at this snazy plugin: http://remysharp.com/2007/12/28/jquery-tag-suggestion/ ** it's real small Source: http://remysharp.com/downloads/tag.js

For the life of me, I can't figure out where in the plugin JS the code is injecting the SPAN which contains the tags...

I see the following around line 73:

var tagMatches = document.createElement(settings.tagContainer);

But where is it injecting it into the doc? I ask because I need to find a way to control where it goes based on an ID, something like this:

document.body.insertBefore(newDiv, my_div);

T开发者_开发问答hanks so much, and good luck, It's tricky!


It's inserted here:

tagsElm.after(tagMatches).keypress(handleKeys).keyup(handleKeys).blur(function () {
  if (fromTab == true || suggestionsShow) { // tweak to support tab selection for Opera & IE
    fromTab = false;
    tagsElm.focus();
  }
});

Specifically the after() call.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜