css - How to get first element on jQuery cycle? -


i want vertical center on cycles height < 531:

before : function(currslideelement, nextslideelement, options, forwardflag){     foto = $(nextslideelement).find('img');     alert(foto.height());     if(foto.height() < 531){         foto.css('margin-top', 266 - (foto.height()/2));     } }, 

but alert returns me "0" on first element, adding 266px margin top no matter size. tried before currslideelement , nextslideelement, same after .

what's wrong?

try alert($(foto).height());. find not return jquery object.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -