css - jQuery - How to get position of element that has a class -


i have slider ads class (.current-item) each tab on, , removes when it`s off. want use lavalamp menu efect , need position of each element has class current-item.

i used:

var = $("li.current-item");  var myposition = my.position();  function setcurr(el) {          $back.css({'top': myposition.top });          curr = el;  }; 

but works 1 item (the first). afer slider removes class , ads class next li nothing happens.

here live: http://asgg.ro/slider-html/ src script @ bottom of source.

i`m new jquery , need help! thank much

var offset = $('.class_name').offset();  var x_pos = offset.left; var y_pos = offset.top; 

this give x , y position of element related viewport hoper helps


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -