So, with var $moving we are creating javascript object, right? But what is $('<li/>')? It is not even an html element.
Also, offset values describes the values of the $this element? So, in this case of the element #slidingMenu li:first?
var $menu = $("#slidingMenu");
var $selected = $menu.find('li:first');
var $moving = $('<li/>',{
className : 'move',
top : $selected[0].offsetTop + 'px',
width : $selected[0].offsetWidth + 'px'
});
$("#slidingMenu");takes the reference of#slidingMenuand $(‘#slidingMenu’) returns a jQuery object.$menu.find('li:first');find the firstliwithin the#slidingMenu.$moving = $('<li/>', properties)means, create ajQuery-wrappedlielement on the fly but not added to DOM. For more.$selectedis reference to jQuery object and$selected[0]gives an element reference/ JavaScript object.But it doesn’t means$selected[0]is a reference to the first object and$selected[1]to the second and so on.