I am using the following code(no my own code) to load image to a css element (called cell) and to display an activity indicator.
var cell = document.createElement('li');
cell.textContent = this.labelForIndex(index);
var indicator = new NKActivityIndicator();
indicator.init(10,100,20,"white");
indicator.show();
indicator.spin();
$(cell).css("background-image", "url("+iconImage+")");
Now i want to place the indicator in the middle of the cell.this line of code indicator.init(10,100,20,"white");define the position width and color of indicator. I want to place it int the mid of cell.Any kind to response?
You can use jQuery’s .position() or .offset() to retrieve the position of the cell and with the use of .height() and .width(), you can place the component in the middle of the cell.