运行代码 缩小
十度
HTML代码
复制 格式化 注释 注释 清空
放大
x
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
    <head>
4
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
        <title>新7款HTML5/CSS3特效之图片扇形展开
6
        </title>
7
        <script type="text/javascript" src="http://ku.shouce.ren/libs/jquery/1/jquery1.6.1.min.js">
8
        </script>
9
    </head>
10
    <body>
11
        <div id="page_wrap"> 
12
            <!--Stack 1  -->
13
            <div class="image_stack" style="margin-left:600px">
14
                <img id="photo1" class="stackphotos" src="//ku.shouce.ren/files/images/201603/56e511e30fd22.jpg"  >
15
                <img  id="photo2" class="stackphotos" src="//ku.shouce.ren/files/images/201603/56e51207283fd.jpg" >
CSS代码
复制 格式化 注释 注释 颜色 清空
放大
xxxxxxxxxx
193
 
1
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, menu, nav, section {
2
  margin: 0;
3
  padding: 0;
4
  border: 0;
5
  outline: 0;
6
  font-weight: inherit;
7
  font-style: inherit;
8
  font-size: 100%;
9
  font-family: inherit;
10
  vertical-align: baseline;
11
}
12
/* remember to define focus styles! */
13
:focus {
14
  outline: 0;
15
}
JS代码
复制 格式化 注释 注释 清空
放大
xxxxxxxxxx
31
 
1
$(document).ready(function() {
2
  $(".image_stack").delegate('img', 'mouseenter', function() {
3
    //when user hover mouse on image with div id=stackphotos 
4
    if ($(this).hasClass('stackphotos')) {
5
      //
6
      // the class stackphotos is not really defined in css , it is only assigned to each images in the photo stack to trigger the mouseover effect on  these photos only 
7
      var $parent = $(this).parent();
8
      $parent.find('img#photo1').addClass('rotate1');
9
      //add class rotate1,rotate2,rotate3 to each image so that it rotates to the correct degree in the correct direction ( 15 degrees one to the left , one to the right ! )
10
      $parent.find('img#photo2').addClass('rotate2');
11
      $parent.find('img#photo3').addClass('rotate3');
12
      $parent.find('img#photo1').css("left","150px");
13
      // reposition the first and last image 
14
      $parent.find('img#photo3').css("left","50px");
15
    }
16
  }
17
                            )
18
    .delegate('img', 'mouseleave', function() {
19
    // when user removes cursor from the image stack
20
    $('img#photo1').removeClass('rotate1');
21
    // remove the css class that was previously added to make it to its original position
22
    $('img#photo2').removeClass('rotate2');
23
    $('img#photo3').removeClass('rotate3');
24
    $('img#photo1').css("left","");
25
    // remove the css property 'left' value from the dom
26
    $('img#photo3').css("left","");
27
  }
28
             );;
29
}
30
                 );
31
名称
新7款HTML5/CSS3特效之图片扇形展开
分类
图片代码
描述
今天要分享的这款CSS3图片特效没有那么绚丽,它的功能非常简单,当你把鼠标移到图片上时,多张图片便会由原先的叠在一起变成展开状态,展开过程中伴随CSS3动画,展开的形状是扇形。这款简单的CSS3图片层叠展开动画可以应用在图片展示和图片分享上。
收藏