开发者

jQuery bookmarklet for selectors [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Ins开发者_开发知识库tead, describe the problem and what has been done so far to solve it.

Closed 9 years ago.

Improve this question

It should work like this:

  1. Fire a bookmarklet
  2. Select the first element by clicking
  3. Select the second element
  4. It outputs a series of jQuery calls which would allow selecting the second element given a reference to a first element (i.e. using relative positions of the two elements in a DOM tree).

Is there such a bookmarklet (or browser extension)? If no may be you could give me a clue about how to write one?


Check out jQuerify. It loads jQuery as a bookmarklet, after which you can interact with the DOM. The same sort of stuff exists in Firebug Lite.

Just add a listener to the body to listen for the first mousedown/click on an element and store it in some data structure (like an array). You could probably chain events together to try to get it where you want.

Depending what you're doing, you could do some spatial detection using the coordinates of the element too.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜