I have a function which is called by moving round on the page, and depending where you are it sends you do a different element.
So
function changeFrame() {
$('#f2').stop(true,true).hide("blind", { direction: "vertical" }, 400);
}
Which works great, but I want to change the target ID on the fly, so I though I would be able to call the function with a variable and use that, but it doesn't work.
function changeFrame(requestedFrame) {
$(requestedFrame).stop(true,true).hide("blind", { direction: "vertical" }, 400);
}
Everything else is the same, and I have used I have also tried it like this:
$('requestedFrame')
Lastly, to make sure I am passing it the variable correctly, which I am I did this
alert(requestedFrame);
Example requestedFrame string
f2
changeFrame('#someId')orchangeFrame('.someClass')orchangeFrame(someElement)? If not, your are doing it wrong.