surreal5335
03-18-2009, 06:48 PM
I am trying to use a small piece of javascript to show and hide a jcarousel lite plugin.
After completely giving up on another piece of code I resorted back to code that works which is purely javascript.
The only thing is, the other script would show and hide content with css which I have read does not work with jcarousel. I am suppose to use the show () and hide () function instead.
The only problem is firebug says my my syntax is not a proper function.
the old code is this:
var currentUl = 1;
function showMe(n) {
document.getElementById("p_"+currentUl).style.display = "none";
document.getElementById("p_"+n).style.display = "block";
currentUl = n;
}
the new code is:
var currentUl = 1;
function showMe(n) {
document.getElementById("p_"+currentUl).hide();
document.getElementById("p_"+n).show();
currentUl = n;
}
This is how I understand to plug in the show and hide function, but firebug disagrees.
If you have any ideas as to how the hide and show should be set up please let me know.
Thanks a lot
After completely giving up on another piece of code I resorted back to code that works which is purely javascript.
The only thing is, the other script would show and hide content with css which I have read does not work with jcarousel. I am suppose to use the show () and hide () function instead.
The only problem is firebug says my my syntax is not a proper function.
the old code is this:
var currentUl = 1;
function showMe(n) {
document.getElementById("p_"+currentUl).style.display = "none";
document.getElementById("p_"+n).style.display = "block";
currentUl = n;
}
the new code is:
var currentUl = 1;
function showMe(n) {
document.getElementById("p_"+currentUl).hide();
document.getElementById("p_"+n).show();
currentUl = n;
}
This is how I understand to plug in the show and hide function, but firebug disagrees.
If you have any ideas as to how the hide and show should be set up please let me know.
Thanks a lot