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
Post a Comment