In my code below, I want to be able to pass in prev or next.
I basically just want to know how to make pn into a variable in my function(I tried below but its wrong), so i can do this:
doSlide($('UL li:last'), 0, next)
or
doSlide($('UL li:last'), 15, prev)
function:
function doSlide(current, px, pn) {
$(current).animate({
right: px
},200);
setTimeout(function(){
doSlide($(current)."+ pn +"('li'), px);
},45);
}
I’d send the functions as strings like this:
or
And the function would be:
Try it. It works.
Hope this helps. Cheers