A simple and small function can be encapsulated as a plug-in as needed, and some configuration parameters are added, such as the delay time, expansion time, expansion effect, callback function, container, and so on.
<! Doctype HTML>
<HTML>
<Head>
<Title> </title>
<Style>
Body {
Margin: 0;
Padding: 0;
}
. Wrap {
Overflow: hidden;
Position: fixed;
Z-index: 99999;
Width: 100%;
Top: 0;
Left: 0;
}
. Div {
Overflow: hidden;
Position: absolute;
Width: 100%;
}
. D {
Background: url(1.jpg) center no-Repeat;
Height: 100%;
}
</Style>
</Head>
<Body>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<P> This is the website content. </P>
<Div class = "Wrap">
<Div id = "d1" class = "Div">
<Div class = "D"> </div>
</Div>
<Div id = "D2" class = "Div">
<Div class = "D"> </div>
</Div>
</Div>
<SCRIPT src = "jquery-1.8.3.min.js"> </SCRIPT>
<SCRIPT>
VaR H = $ (window). Height ();
VaR H1 = H/2;
$ ('# D1, # D2'). Height (H1 );
$ ('. Wrap,. D'). height (H );
Certificate ('{d2'}.css ('top', H1 );
$ ('# D2 .d'hangzhou.css ('margin-top',-H1 );
SetTimeout (function (){
$ ('# D1'). animate ({'top':-H/2}, 3000 );
$ ('# D2'). animate ({'top ': H}, 3000, function (){
$ ('. Wrapp'). Remove ();
});
}, 2000); // open it after a certain period of time
</SCRIPT>
</Body>
</Html>
Enable full screen image