I’m trying to solve the sliding problem(3*3 grid) through jquery.
In my HTML file I have 8 li’s(9th empty).
<ul class=”Puzzle”>
<li class=”Box Box1″>1</li>
<li class=”Box Box2″>2</li>
<li class=”Box Box3″>3</li>
<li class=”Box Box4″>4</li>
<li class=”Box Box5″>5</li>
<li class=”Box Box6″>6</li>
<li class=”Box Box7″>7</li>
<li class=”Box Box8″>8</li>
</ul>
I want to access these li’s in my js(javascript file) through jQuery,so that I can implement the sliding effect.
I tried to convert them into arrays through jQuery.map() function but it didn’t work
var liclass = $(‘Puzzle li’).map(function(i,n){
return $(n).attr(‘class’);
}).get().join(‘,’)
Can someone please tell me how can I convert them into arrays and use them in my js file.
Thanks