2013-04-24, 03:01 AM
This is an animated CSS spoiler (No JS), with an optional spoiler title.
Demo: http://wedesignthe.net/staff_uploads/eri...pid=4#pid4
Regular Expression:
Replacement:
Add this to your global.css in all of your themes:
If you use the code below, use it in place of the code above.
Optional (Animated height):
Demo: http://wedesignthe.net/staff_uploads/eri...pid=4#pid4
Regular Expression:
\[spoiler=?(.*?)\](.*?)\[/spoiler\]
Replacement:
<div class="spoiler">
<div><span>$1</span></div>
$2
</div>
Add this to your global.css in all of your themes:
.spoiler {
background-color: #EEE;
border: 1px solid #DDD;
position: relative;
padding: 10px;
border-radius: 3px;
}
.spoiler div {
background-color: #DDD;
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
padding: 10px;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
-webkit-transition: all 0.7s;
-moz-transition: all 0.7s;
-o-transition: all 0.7s;
-ms-transition: all 0.7s;
transition: all 0.7s;
border-radius: 3px;
}
.spoiler:hover div {
left: 100%;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
}
If you use the code below, use it in place of the code above.
Optional (Animated height):
.spoiler {
background-color:#EEE;
border:1px solid #DDD;
position:relative;
padding:10px;
border-radius:3px;
max-height:20px;
overflow:hidden;
-webkit-transition:max-height .7s;
-moz-transition:max-height .7s;
-o-transition:max-height .7s;
-ms-transition:max-height .7s;
transition:max-height .7s;
}
.spoiler:hover {
overflow-y: auto;
max-height:500px;
}
.spoiler div {
background-color:#DDD;
position:absolute;
top:0;
bottom:0;
right:0;
left:0;
padding:10px;
-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
filter:alpha(opacity=100);
opacity:1;
-webkit-transition:all .7s;
-moz-transition:all .7s;
-o-transition:all .7s;
-ms-transition:all .7s;
transition:all .7s;
border-radius:3px;
}
.spoiler:hover div {
left:100%;
-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
filter:alpha(opacity=0);
opacity:0;
}