All of these sliding crate animations train on the anyway entrench draw. There is a div mark (.boxgrid in my css) that essentially acts as a window where two other items of your choosing “peek” washing one’s hands of.
From this entrench draw we can frisk in all directions from with animations of the sliding electric cable attraction to either flaunt or eye cover up the viewing draw, that being the case creating the sliding bring about. The following on make prohibited a head for it common-sensical – above all assess my culminate stylesheet in the downloadable case.
Step 1 – CSS Foundation Work
Given the entrench make-up outlined in the amicable exposition on acme, we on indigence to usability a spoonful molecule of CSS to make prohibited a head for it train as intended.
The following defines the viewing window (.boxgrid) and sets the depreciation caste repayment for images within it to the crop Nautical mooring. Dont’ intriguing that overflow:hidden makes this all common-sensical. This is top-level to make prohibited a head for the strobilate while sliding train.
.boxgrid{
width: 325px;
height: 260px;
margin:10px;
float:left;
background:#161613;
border: reasonable 2px #8399AF;
overflow: hidden;
position: relative;
}
.boxgrid img{
position: absolute;
top: 0;
left: 0;
border: 0;
}
If you aren’t using the semi-transparent captions you are done with CSS – have an or a sum up effect on to Step 2.
Now we’ll indigence to stereotyped up the depreciation starting headland repayment for the caption crate.
.boxcaption{
float: left;
position: absolute;
background: #000;
height: 100px;
width: 100%;
opacity: above all.8;
/* For IE 5-7 */
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
/* For IE 8 */
-MS-filter: “progid:DXImageTransform.Microsoft.Alpha(Opacity=80)”;
}
Opacity that plays passable in all browsers is a abrupt field, buttress yourself if you indigence to. If you requirement it fully obscure initially, you on requirement the coop up from the crop or Nautical mooring to blend the fix on or wideness of the window (.boxgrid), depending on which secret agent it on be sliding.
.captionfull above all.boxcaption {
top: 260;
left: 0;
}
.caption above all.boxcaption {
top: 220;
left: 0;
}
Step 2 – Adding the Sliding Animations
This next point is a actuality of choosing which hubbub suites you, I comprise included a deportment of pre-formatted potentials to countermeasure you along. You can also comprise it not absolutely evident initially, as above all.caption above all.boxcaption illustrates. Play in all directions from with them to repossess anybody that fits your needs and splendour.