Hello,
Is there any way i could add a toggle bar before the chatbox memberlist (#chatbox_members) that functions as below:
The default way to display will be: Show a bar with "<" and when pressed the #chatbox_members will appear (display:block) and the "<" will change to ">".
After that when ">" bar is pressed the #chatbox_members will toggle (display:none) and the ">" will change to "<"
I am trying to do this using a javascript but it doesn't work for some reason.
Any help would be appreciated.
Is there any way i could add a toggle bar before the chatbox memberlist (#chatbox_members) that functions as below:
The default way to display will be: Show a bar with "<" and when pressed the #chatbox_members will appear (display:block) and the "<" will change to ">".
After that when ">" bar is pressed the #chatbox_members will toggle (display:none) and the ">" will change to "<"
I am trying to do this using a javascript but it doesn't work for some reason.
- Code:
$(document).ready(function(){
$('<span class="toggleO"> < <span class="toggleC" style="display:none"> > </span> </span>').insertBefore('body #chatbox #chatbox_members');
$(function(onclick,"toggleO"){
$('.toggleO').css({"display":"none"});
$('toggleC').attr('style','block');
$('body #chatbox #chatbox_members').toggle();
}
$(function(onclick,"toggleC"){
$('.toggleC').css({"display":"none"});
$('toggleO').attr('style','block');
$('body #chatbox #chatbox_members').toggle();
}
}
Any help would be appreciated.