Getting index value of cropped Div : Jquery -


OK, so I load a li with several ones in a div, which overflows: hidden next BTN Click on it and it slides the next thumb into the slide.

All sliding is working fine but how am I trying to understand this? "If the last le element is being seen, then the next BTN is not working.

Since all are loaded on runtime and get out of sight through the device with only overflow: hidden, how can I find out the last le element?

All this is based on the fact That the number of light elements can change so that everyone can speed up Required to be, so no matter how light, generic scripting works.

Click <$> ('. Next_btn') (function () {var baseElement = $ ($ ('. Cs_vidThumbList ', $ (this) .Parent () .Parent ()) var currLoc = $ (baseElement) .css (' left '); if (currLoc! = 0) {$ (base element) .Met ({left : '- = 625',}, 'slow')}});

With each click, I slide the ul (which is the 'base element') 625 Because we are at the end until at least 5 thumbnails are shown and in each Lee The total is DTH 125.

So I need to see if the last line is actually on-screen, I was thinking that I somehow took the left property with an id of "last" I can check, but still I can not think that Jquery will know whether it is in looking at that particular lue because the entire UL is loading (meaning .. it is technically visible, only visible Has croped from)

You (though I'm sure there is a better way) li number of elements Is counted only in ul , and then works where the last possible 'set' of images will appear.

You must run this calculation before the click event.

  var listLength = $ ("ul li") length;  

Divide it by number in each set, which I think you said was 5, and rounded it to the nearest integer

  Var setTotal = listLength / 5; SetTotal = Math Cecil (settool);   

Again, by increasing the result -625, to possibly get the total number of movements

  var maxMovement = setTotal * - 625;  

Then you will know that when your code exceeds currLoc or maxMovement , you will know that you Looking at the last set of images


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -