Toggle BBCode please...
@ Stoker... Do you could share the code of this BBCode?
Code: Select all
h2.trigger {
padding: 0 0 0 50px;
margin: 0 auto;
background: url("{T_THEME_PATH}/images/h2_trigger_a.gif") no-repeat;
height: 46px;
line-height: 46px;
width: 450px;
font-size: 2em;
font-weight: normal;
}
h2.trigger a {
color: #fff;
text-decoration: none;
display: block;
}
h2.trigger a:hover { color: #ccc; }
h2.active {background-position: left bottom;} /*--When toggle is triggered, it will shift the image to the bottom to show its "opened" state--*/
.toggle_container {
margin: 0 auto;
border: 1px solid #d6d6d6;
background: #f0f0f0;
overflow: hidden;
font-size: 1.2em;
width: 490px;
clear: both;
}
.toggle_container .block {
padding: 20px; /*--Padding of Container--*/
}
Code: Select all
//Hide (Collapse) the toggle containers on load
$(".toggle_container").hide();
//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
$("h2.trigger").click(function(){
$(this).toggleClass("active").next().slideToggle("slow");
return false; //Prevent the browser jump to the link anchor
});
Really nice this bbcode!!!Stoker wrote:Im not sure this is all of it:and some jquery is also needed.Code: Select all
h2.trigger { padding: 0 0 0 50px; margin: 0 auto; background: url("{T_THEME_PATH}/images/h2_trigger_a.gif") no-repeat; height: 46px; line-height: 46px; width: 450px; font-size: 2em; font-weight: normal; } h2.trigger a { color: #fff; text-decoration: none; display: block; } h2.trigger a:hover { color: #ccc; } h2.active {background-position: left bottom;} /*--When toggle is triggered, it will shift the image to the bottom to show its "opened" state--*/ .toggle_container { margin: 0 auto; border: 1px solid #d6d6d6; background: #f0f0f0; overflow: hidden; font-size: 1.2em; width: 490px; clear: both; } .toggle_container .block { padding: 20px; /*--Padding of Container--*/ }
To be used within a document ready function:Should be all.Code: Select all
//Hide (Collapse) the toggle containers on load $(".toggle_container").hide(); //Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state) $("h2.trigger").click(function(){ $(this).toggleClass("active").next().slideToggle("slow"); return false; //Prevent the browser jump to the link anchor });
$("a.cross").click(function() {
Code: Select all
h2.trigger {
padding: 0 0 0 50px;
margin: 0 auto;
background: url("{T_THEME_PATH}/images/h2_trigger_a.gif") no-repeat;
height: 46px;
line-height: 46px;
width: 450px;
font-size: 2em;
font-weight: normal;
}
h2.trigger a {
color: #fff;
text-decoration: none;
display: block;
}
h2.trigger a:hover { color: #ccc; }
h2.active {background-position: left bottom;} /*--When toggle is triggered, it will shift the image to the bottom to show its "opened" state--*/
.toggle_container {
margin: 0 auto;
border: 1px solid #d6d6d6;
background: #f0f0f0;
overflow: hidden;
font-size: 1.2em;
width: 490px;
clear: both;
}
.toggle_container .block {
padding: 20px; /*--Padding of Container--*/
}
Code: Select all
//Hide (Collapse) the toggle containers on load
$(".toggle_container").hide();
//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
$("h2.trigger").click(function(){
$(this).toggleClass("active").next().slideToggle("slow");
return false; //Prevent the browser jump to the link anchor
});
Code: Select all
{T_THEME_PATH}