Hot File

Creating Flyout Image Slider with jQuery & CSS3

View: 725    Dowload: 0   Comment: 0   Post by: hanhga  
Author: none   Category: References   Fields: Other

9 point/3 review File has been tested

Flyout Image Slider is a transition effects based on the pictures are stacked, and when we click one of the images, so the picture will be taken up front, while the rest will be shaped rearrange the order. For more information, you can check out the demo below.

Introduction

Flyout Image Slider is a transition effects based on the pictures are stacked, and when we click one of the images, so the picture will be taken up front, while the rest will be shaped rearrange the order. For more information, you can check out the demo below.

To achieve such effects, you can follow the following steps:

Step 1: HTML Markup

First, we need a standard html frame as follows:

01
02
03
04
05
06
07
08
09
10
11
12
<div id="container">
  <div id="itemlist">
    <img src="images/busby.jpg" alt="Busby" id="busby">
    <img src="images/gridly.jpg" alt="Gridly" id="gridly">
    <!-- to n image -->
  </div>
  <div id="itemdescription">
    <span data-for="busby">Busby Theme</span>
    <span data-for="gridly">Gridly Theme</span>
    <!-- to n description -->
  </div>
</div>

As you can see in the above paragraphs html, each one photograph will be assigned an id attribute and description (description) attribute data-cho. The purpose of this is to link the description with the corresponding photograph.

Step 2: Format CSS

First we will share basic format:

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
body {
background: radial-gradient(ellipse at center center , #1CA5C7 0%, #16547B 100%) no-repeat fixed 0 0 rgba(0, 0, 0, 0);
    color: #FFFFFF;
    font-family: Raleway;
    margin-top: 7%;
    text-align: center;
}
 
a {
  color: #fff;
  font-family: Raleway;
  font-style: normal;
  text-decoration: none;
  font-size: 15px;
}
 
a:hover {
  text-decoration: underline;
}
 
h1 {
  font-family: Raleway;
  font-weight: normal;
  margin: 0;
}
 
#container {
  display: block;
  margin: 0 auto;
  text-align: center;
  -webkit-perspective: 2000px;
  -moz-perspective: 2000px;
  -ms-perspective: 2000px;
  -o-perspective: 2000px;
  perspective: 2000px;
}
 
#information {
  margin-top: 1em;
  display: block;
  font-size: 15px;
}

Next is for the image to be stacked and declared effects.

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#itemdescription {
  position: relative;
  width: 400px;
  margin: 0 auto;
  left: 6em;
  top: 2em;
  font-size: 50px;
  font-family: Pacifico;
  text-shadow: 2px 2px 3px rgba(0,0,0,0.2);
}
 
#itemdescription span {
  display: none;
}
 
#itemlist {
  display: block;
  width: 400px;
  margin: 3em auto;
  position: relative;
  -webkit-transform-style: preserve-3d;
  -moz-transform-style: preserve-3d;
  -ms-transform-style: preserve-3d;
  -o-transform-style: preserve-3d;
  transform-style: preserve-3d;
}
 
#itemlist img {
  position: absolute;
  cursor: pointer;
  left: 0;
  box-shadow: 0px 15px 50px rgba(0,0,0,0.4);
}
 
#itemlist img:hover {
  top: -5px;
}
 
#itemlist img.item-0 {
  z-index: 4;
  -webkit-transform: scale(1);
  -moz-transform: scale(1);
  -ms-transform: scale(1);
  -o-transform: scale(1);
  transform: scale(1);
}
 
#itemlist img.item-1 {
  z-index: 3;
  left: -80px;
  -webkit-transform: scale(0.9);
  -moz-transform: scale(0.9);
  -ms-transform: scale(0.9);
  -o-transform: scale(0.9);
  transform: scale(0.9);
}
 
#itemlist img.item-2 {
  z-index: 2;
  left: -160px;
  -webkit-transform: scale(0.8);
  -moz-transform: scale(0.8);
  -ms-transform: scale(0.8);
  -o-transform: scale(0.8);
  transform: scale(0.8);
}
 
#itemlist img.item-3 {
  z-index: 1;
  left: -240px;
  -webkit-transform: scale(0.7);
  -moz-transform: scale(0.7);
  -ms-transform: scale(0.7);
  -o-transform: scale(0.7);
  transform: scale(0.7);
}
 
.transition {
  -webkit-transition: 0.5s ease-out;
  -moz-transition: 0.5s ease-out;
  -ms-transition: 0.5s ease-out;
  -o-transition: 0.5s ease-out;
  transition: 0.5s ease-out;
}
 
.show {
  -webkit-animation: show 1s linear;
  -moz-animation: show 1s linear;
  -ms-animation: show 1s linear;
  -o-animation: show 1s linear;
  animation: show 1s linear;
}

Have you noticed that we have added 2 class is declared and .show .transition, this is the part that will be used to create the effect when we do the jQuery in steps.

Next, we will do the effects:

001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
@-webkit-keyframes show{
  25% { left: -450px;}
  50% {
    z-index: 5;
    left: -500px;
    -webkit-transform: rotate3d(0,1,0,0deg);
  }
 
  70% {
    z-index: 5;
    left: -250px;
    -webkit-transform: rotate3d(0,1,0,180deg);
  }
 
  100% {
    z-index: 5;
    left: 0px;
    -webkit-transform: rotate3d(0,1,0,360deg);
  }
}
 
@-moz-keyframes show{
  25% {
    left: -450px;
  }
 
  50% {
    z-index: 5;
    left: -500px;
    -moz-transform: rotate3d(0,1,0,0deg);
  }
 
  70% {
    z-index: 5;
    left: -250px;
    -moz-transform: rotate3d(0,1,0,180deg);
  }
 
  100% {
    z-index: 5;
    left: 0px;
    -moz-transform: rotate3d(0,1,0,360deg);
  }
}
 
@-ms-keyframes show{
  25% {
    left: -450px;
  }
 
  50% {
    z-index: 5;
    left: -500px;
    -ms-transform: rotate3d(0,1,0,0deg);
  }
 
  70% {
    z-index: 5;
    left: -250px;
    -ms-transform: rotate3d(0,1,0,180deg);
  }
 
  100% {
    z-index: 5;
    left: 0px;
    -ms-transform: rotate3d(0,1,0,360deg);
  }
}
 
@-o-keyframes show{
  25% {
    left: -450px;
  }
 
  50% {
    z-index: 5;
    left: -500px;
    -o-transform: rotate3d(0,1,0,0deg);
  }
 
  70% {
    z-index: 5;
    left: -250px;
    -o-transform: rotate3d(0,1,0,180deg);
  }
 
  100% {
    z-index: 5;
    left: 0px;
    -o-transform: rotate3d(0,1,0,360deg);
  }
}
 
@keyframes show{
  25% {
    left: -450px;
  }
 
  50% {
    z-index: 5;
    left: -500px;
    transform: rotate3d(0,1,0,0deg);
  }
 
  70% {
    z-index: 5;
    left: -250px;
    transform: rotate3d(0,1,0,180deg);
  }
 
  100% {
    z-index: 5;
    left: 0px;
    transform: rotate3d(0,1,0,360deg);
  }
}

That does it for CSS, we will continue in steps.

Step 3: jQuery

First we will insert jQuery declared on the </ body>

1
2
<script src="script.js"></script>

Then you create and copy files script.js each script as follows:

First, the script sort images automatically by insertion into the corresponding class name, and hide the different descriptions and display only the description of the first picture.

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
var itemList, item, className, thisItem, newOrder, itemDesc, desc;
 
 itemList= $('#itemlist');
 item= itemList.children('img');
 
 itemDesc= $('#itemdescription');
 desc= itemDesc.children('span');
 
 //Add class name for each item
 item.each(function(index) {
 
   className= 'item-' + index;
   $(this).addClass(className).attr('data-order', index);
 });
 
//Show first item description
 desc.filter(':first-child').fadeIn();

Next, we will proceed to the Click event

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//On clicked fire animation
    item.on('click', function() {
 
         thisItem= $(this);
        thisOrder = parseInt(thisItem.attr('data-order')) - 1;
 
        thisItem.addClass('show');
 
        //Reorder item position
        item.on('animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd', function() {
 
            thisItem.removeClass().addClass('item-0').attr('data-order', '0');
 
            //Show selected item description
            desc.hide();
            desc.filter('[data-for=' + thisItem.attr('id') + ']' ).fadeIn('fast');
        });
 
        //Move siblings items backward
      window.setTimeout(function () {
 
      for(var i = thisOrder; i >= 0; i--) {
 
        //Reorder item position
        movedItem = item.filter('[data-order=' + i + ']');
        newOrder= parseInt(movedItem.attr('data-order')) + 1;
        className = 'item-' + newOrder;
 
        //Move them with transition
        movedItem.removeClass().addClass('transition ' + className).attr('data-order', newOrder);
 
        //Remove their transition
        item.on('transitionend webkitTransitionEnd MSTransitionEnd oTransitionEnd', function() {
          item.removeClass('transition');
        });
      }
    }, 500);
 
 });

That is it for you, and save the test results and see how offline. Good luck!

 

 

Creating Flyout Image Slider with jQuery & CSS3

Creating Flyout Image Slider with jQuery & CSS3 Posted on 14-08-2015  Flyout Image Slider is a transition effects based on the pictures are stacked, and when we click one of the images, so the picture will be taken up front, while the rest will be shaped rearrange the order. For more information, you can check out the demo below. 3/10 725

Comment:

To comment you must be logged in members.

Files with category

  • Instructions for installing and configuring Windows Live Mail on Windows 10 simple

    View: 2688    Download: 0   Comment: 0   Author: none  

    Instructions for installing and configuring Windows Live Mail on Windows 10 simple

    Category: References
    Fields: Other

    0/3 review
    Windows 10 pre-installed Mail application for managing personal email on the device. The latest version of this application but improved a lot and support other email accounts such as Gmail or Yahoo Mail but users almost no "salty" really with this...

  • Step by step instructions to create social networking buttons with CSS3

    View: 1876    Download: 0   Comment: 0   Author: none  

    Step by step instructions to create social networking buttons with CSS3

    Category: References
    Fields: Other

    0.75/6 review
    CSS3 help web designers have the ability to create buttons (buttons) very nice, today I will share with you two tips decoration for button in your web becomes radiant beauty that no need to use photoshop.

  • You should understand the CSS Box Shadow

    View: 2029    Download: 0   Comment: 0   Author: none  

    You should understand the CSS Box Shadow

    Category: References
    Fields: Other

    1.3181818181818/11 review
    Effects his shadow was introduced in the previous article, however, in this article, I will guide more specific about shadow attributes, you try it with anything. First we try to learn css following paragraph:

  • How to do button movement with beautiful CSS3

    View: 1716    Download: 0   Comment: 0   Author: none  

    How to do button movement with beautiful CSS3

    Category: References
    Fields: Other

    0/4 review
    Previously to create motion effects button, you must draw the button in photoshop, then switched to flash to make it possible to move. But now you need not spend too much time doing it, all because of the emergence of CSS3.

  • Create a dropdown menu with CSS3 effects with beautiful transtions

    View: 1991    Download: 0   Comment: 0   Author: none  

    Create a dropdown menu with CSS3 effects with beautiful transtions

    Category: References
    Fields: Other

    0.45/10 review
    More of the dropdown menu you want to introduce to you, this will have the effect menu transitions (converted background of menu background from pale to dark). This menu works well on browsers like FF, Chrome, Safary, but unfortunately did not work...

  • How to hack css for all browsers you should know

    View: 1625    Download: 0   Comment: 0   Author: none  

    How to hack css for all browsers you should know

    Category: References
    Fields: Other

    1.6875/8 review
    In the process of web design, which makes it the most headaches is how to design web pages that you can run on the browser. Especially when clients use the old as IE6 browser such. However, with this article, you will easily edit interface runs well...

  • Create Accordion with extremely beautiful CSS3

    View: 2025    Download: 0   Comment: 0   Author: none  

    Create Accordion with extremely beautiful CSS3

    Category: References
    Fields: Other

    0.9/5 review
    Accordion is a technique that helps you shortened the content that you want displayed on the website. It is often used for the display of submenus. In addition you can also use it for content, images. Before applying this procedure, you have to use...

  • Create the effect Hovercho images with Webkit and CSS3 is great

    View: 1722    Download: 0   Comment: 0   Author: none  

    Create the effect Hovercho images with Webkit and CSS3 is great

    Category: References
    Fields: Other

    1.125/4 review
    WebKit is one open source application framework provides the necessary components built one for your web browser. Along with CSS3, cả have contributed to very nice effect những previously only using JavaScript or JQuery thực beige.​

 
Newsletter Email

File suggestion for you

File top downloads

logo codetitle
Codetitle.com - library source code to share, download the file to the community
Copyright © 2015. All rights reserved. codetitle.com Develope by Vinagon .Ltd