Function for range

I can apply a function to all elements of a selection like in

$("#myid li").each(function(){})
Code (markup):

I can also apply a command to a range of childnodes like in

$('#myid li').slice(0,3).innerHeight(MaxHeight+'px');
Code (markup):

But what I want is to combine the two. Unfortunately it is not clear to me how I can apply a function to such a slice range. Can somebody help me?