Use JavaScript to create a responsive, cool 360-degree panorama to view slideshow effects

Source: Internet
Author: User

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.

  1. <! DOCTYPE html>
  2. lang="en">
  3. <metaCharSet="Utf-8">
  4. <metaName="viewport"content="initial-scale=1.0, maximum-scale=1.0"/>
  5. <title></title>
  6. <linkrel="stylesheet"href="Css/reset.css"Media="screen"type= "Text/css"/>
  7. <linkrel="stylesheet"href="Css/threesixty.css"Media="Screen" type="Text/css"/>
  8. <body>
  9. </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.

  1. <! DOCTYPE html>
  2. lang="en">
  3. <metaCharSet="Utf-8">
  4. <metaName="viewport"content="initial-scale=1.0, maximum-scale=1.0"/>
  5. <title></title>
  6. <linkrel="stylesheet"href="Css/reset.css"Media="Screen" Type="Text/css"/>
  7. <linkrel="stylesheet"href="Css/threesixty.css"Media="screen"type ="Text/css"/>
  8. <body>
  9. <divid="ThreeSixty">
  10. <divid="Spinner">
  11. <span>0%</span>
  12. </div>
  13. <olid="Threesixty_images"></ol>
  14. </div>
  15. </body>

4. Add Interaction

At the end of the code, we add jquery to handle the interaction, threesixity.js to handle the picture slide.

  1. <! DOCTYPE html>
  2. lang="en">
  3. <metaCharSet="Utf-8">
  4. <metaName="viewport"content="initial-scale=1.0, maximum-scale=1.0"/>
  5. <title></title>
  6. <linkrel="stylesheet"href="Css/reset.css"Media="screen"type= "Text/css"/>
  7. <linkrel="stylesheet"href="Css/threesixty.css"Media="Screen" type="Text/css"/>
  8. <body>
  9. <divid="ThreeSixty">
  10. <divid="Spinner">
  11. <span>0%</span>
  12. </div>
  13. <olid="Threesixty_images"></ol>
  14. </div>
  15. <scriptsrc="Js/heartcode-canvasloader-min.js"></script>
  16. <scriptsrc="Js/jquery-1.7.min.js"></script>
  17. <scriptsrc="Js/threesixty.js"></script>
  18. </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.

  1. #threesixty {
  2. Position:absolute;
  3. Overflow:hidden;
  4. Top:%;
  5. Left:%;
  6. Width:960px;
  7. Height:540px;
  8. Margin-left:-480px;
  9. Margin-top:-270p

Use JavaScript to create a responsive, cool 360-degree panorama to view slideshow effects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.