360 degrees of panoramic picture effect can often be used to give customers to do product display, today we recommend a very good from Robert Pataki's 360 Panorama slideshow Implementation Tutorial, this tutorial will use JavaScript to create a cool Panorama slideshow implementation, I'm sure you'll love it!
No plugins are used in this tutorial, we will use HTML,CSS and JavaScript to implement, and of course, the use of the jquery framework!
How is it implemented?
We will use a pre-built image of 360 to make the animation appear as a carousel. Contains 180 images. So the load time may be longer.
Code implementation
We'll add media queries to the CSS code to make this effect available on both the ipad and iphone.
1. code files
We add js,css, picture catalog. The CSS catalog contains the RESET.CSS. JS contains jquery. The code files are as follows:
2. New projects
Create an HTML file index.html. In
Reset.css and Threesixty.css. A custom CSS style is included.
- <! DOCTYPE html>
- lang="en">
- <metaCharSet="Utf-8">
- <metaName="viewport"content="initial-scale=1.0, maximum-scale=1.0"/>
- <title></title>
- <linkrel="stylesheet"href="Css/reset.css"Media="screen"type= "Text/css"/>
- <linkrel="stylesheet"href="Css/threesixty.css"Media="Screen" type="Text/css"/>
- <body>
- </body>
3. Loading the progress bar
Create a <div> to accommodate the slideshow. It contains a <ol>, which is used to include the picture sequence <li>, and also contains a <span> to display the progress bar. We will use JavaScript to dynamically load images.
- <! DOCTYPE html>
- lang="en">
- <metaCharSet="Utf-8">
- <metaName="viewport"content="initial-scale=1.0, maximum-scale=1.0"/>
- <title></title>
- <linkrel="stylesheet"href="Css/reset.css"Media="Screen" Type="Text/css"/>
- <linkrel="stylesheet"href="Css/threesixty.css"Media="screen"type ="Text/css"/>
- <body>
- <divid="ThreeSixty">
- <divid="Spinner">
- <span>0%</span>
- </div>
- <olid="Threesixty_images"></ol>
- </div>
- </body>
4. Add Interaction
At the end of the code, we add jquery to handle the interaction, threesixity.js to handle the picture slide.
- <! DOCTYPE html>
- lang="en">
- <metaCharSet="Utf-8">
- <metaName="viewport"content="initial-scale=1.0, maximum-scale=1.0"/>
- <title></title>
- <linkrel="stylesheet"href="Css/reset.css"Media="screen"type= "Text/css"/>
- <linkrel="stylesheet"href="Css/threesixty.css"Media="Screen" type="Text/css"/>
- <body>
- <divid="ThreeSixty">
- <divid="Spinner">
- <span>0%</span>
- </div>
- <olid="Threesixty_images"></ol>
- </div>
- <scriptsrc="Js/heartcode-canvasloader-min.js"></script>
- <scriptsrc="Js/jquery-1.7.min.js"></script>
- <scriptsrc="Js/threesixty.js"></script>
- </body>
5. Style
We add the Threesixty.css file. The RESET.CSS is used to set the default style. First define the #threesixty wrapper. The default picture slide is 960x450. Horizontally vertically centered.
- #threesixty {
- Position:absolute;
- Overflow:hidden;
- Top:%;
- Left:%;
- Width:960px;
- Height:540px;
- Margin-left:-480px;
- Margin-top:-270p
Use JavaScript to create a responsive, cool 360-degree panorama to view slideshow effects