This article mainly introduces how to use javascript to create slides (360-degree panoramic images). Slides are often used during product demonstrations, here I have compiled a very good 360-degree panoramic slide implementation tutorial for you. If you need a slide, you can refer to the slides that are frequently used for product demonstration, with a panoramic image of 360 degrees, you can enjoy a good user experience. Here we will introduce you to a 360 panoramic magic lamp implementation tutorial from Robert Pataki. This tutorial uses js to implement a cool panoramic magic lamp. The details are as follows:
No plug-ins are used in this tutorial. We will use HTML, css, and javascript. Of course, jQuery is also used!
How to implement it?
We will use the images generated in advance according to 360 for carousel to achieve the animation display effect. It contains 180 images. Therefore, the loading time may be relatively long.
Code Implementation
We will add media queries to the css code so that this effect can be achieved on both ipad and iphone.
1. Code File
Add js, css, and image directory. The CSS directory contains reset.css. Js contains jQuery. The code file is as follows:
2. New Project
Create an HTML file index.html. InWe have set the viewport of the mobile device so that the content cannot be scaled. Add two files
Reset.cssand threesixty.css. Contains custom css styles.
360
3. Load progress bar
Create
To hold the slides. Contains
Used to contain Image Sequences
- It also contains a progress bar. We will use javascript to dynamically load images.
360
0%
4. Add Interaction
At the end of the code, we added jQuery to process interaction, and threesixity. js to process image slides.
360
0%
《script》
《script》
《script》
5. Style
We need the threesixty.css file. Reset.css is used to set the default style. First define # threesixty packaging. The default image Phantom is 960x450. Center horizontally and vertically.
#threesixty {position:absolute;overflow:hidden;top:50%;left:50%;width:960px;height:540px;margin-left:-480px;margin-top:-270p
The above content is all about using javascript to make slides. I hope you will like it.