[jQuery] Passing a variable to a jquery function

[jQuery] Passing a variable to a jquery function


I would like to know how I can pass a variable into a jquery function,
similar to this: (function slide(x) is a function i created and x is
the value I would like to pass down to the jquery function)
function slide(x){
$(document).ready(function(x) {
var t = "'#"+ x + "'";
if($(t).is(":hidden"))
{
    $(t).slideDown();
}
else
{
$(t).slideUp();
}
});
}
I have tried several other ways but this is the most recent.
thank you!