Instructions on how to make a simple slideshow with jQuery
The point to note in this code is the height Slideshow customized depending on the location of code and images ... When deep consideration we see the code on other provisions of the photo coordinates in space 3 Attribute dimension ... z-index order placement provisions photos. There are 3 class, the highest class - active (10), the next layer active (9) and all remaining photos (8).
3. Code JS
Now we begin to write a script to start your slide motion.
The above code has the following meanings: First, declare a variable, class photo that has activethen assign the variable $active and head, it is the turn photos next $next . Start running SlideSwitch function. Files $next class mounted active to bring it up on end and shots are$active shall be removed down to the active class. Finally the interval 5000ms (5 seconds) between each switch. Very simple!
In order for us to create more beautiful blur effect fade.
There appears to add a class last-active , this class has been declared in the css code with only one attribute is z-index: 9 .
The code above is interpreted as follows: class files have active (being at the top) will be assigned to class last-active (1 level down). Files in just below it, the class is assigned active (a step) and add effects animate the opacity increases from 0 to 1. Finally remove class last-activepicture taken on the same initially to the bottom.
This process is repeated with cycles 5s.
Conclusion
As mentioned there are many ways to do the most with jQuery Image Slideshow more complex and much more beautiful. But the problem is that the slideshow will be heavy and difficult to edit a lot more customizable. HHV's view remains is how to use the simplest way to achieve the highest efficiency. To achieve this is the only way to understand what you're doing.
Hopefully with this tutorial you can learn and customize according to your slideshow. VD as resizing slideshow, display time of each image, the blur, add link for each image, and even combine it with Recent Posts Widget.
0 comments:
Post a Comment
ask about any software doubts or any software updates,inform about broken links