today i need your help with simple thing, i think.. :)
i to create element and make his position to the next element with code.
i want to create autocomplete class, i know jquery have one, but i want to create one on my own, just for practice, so i saw that if i have element on the middle or in the left side of the page or the top/bottom page it always fetch the suggestions to the right place, it looks like the web browser autocomplete..
now my question is... how do i do this with my class, i want that my code will create new element(ul) after the input, so for that i used jquery simple function
that is simple, now how do i edit the css so it will look like real autocomplete like jquery or like the autocomplete on the web browsers.. i want it to looks real professional.
i managed to create some function that use % key but the problem is when i do zoom to the page. that looks real bad..
i know there is way that i can get the left position of the input element user .position() function that jquery have.
example(if the code were existed.):
<input type="text" id="txt" value="" />
var auto = new Autocomplete("txt"); //The Class
so that is basically what i want to do, simple create new class and in the class create function, he will calculate the position and create new ul element.
basically i want to match the list element perfectly to the input, in all positions(top left right bottom) all it's need.. :)
please help me, i want to make real nice class.. :)
if you don't understand my question please command, i try to explain my self better.. :)