Skip to content Skip to sidebar Skip to footer

Bind The Position Of An Element To Another Element's Position

Is there any way in jQuery to make an element stay at the same position as another element? Say there is a textbox and a . How would one let the always ove

Solution 1:

Unless I am misunderstanding your question, you could put the <span> and the <input type="text" /> in the same parent container, such as a <div>, then move the <div> instead of the <input type="text" />.

Solution 2:

If you control the times when the textbox moves, you can also trigger the movement of the span. If not, then I'm unaware of any events that would work better than your setInterval idea.

Post a Comment for "Bind The Position Of An Element To Another Element's Position"