Book Image

Responsive Web Design by Example : Beginner's Guide

By : Thoriq Firdaus
Book Image

Responsive Web Design by Example : Beginner's Guide

By: Thoriq Firdaus

Overview of this book

Table of Contents (16 chapters)
Responsive Web Design by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – compiling JavaScript and styling the website with media queries


Perform the following steps to compile the JavaScript files and optimize the website for a small viewport size:

  1. Create a new JavaScript file in the assets/js directory named foundation.js.

  2. In foundation.js, import the following JavaScript files:

    // @koala-prepend "../../components/foundation/js/vendor/jquery.js"
    // @koala-prepend "../../components/foundation/js/foundation/foundation.js"
    // @koala-prepend "../../components/foundation/js/foundation/foundation.topbar.js"
    // @koala-prepend "../../components/foundation/js/foundation/foundation.orbit.js"
  3. Via Koala, compile foundation.js.

  4. Then, open index.html and add the following lines right before </body> to enable the Orbit Slider functionalities:

    <script src="assets/js/foundation.min.js"></script>
    <script>
    $(document).foundation({
         orbit: {
           timer_speed: 3000,
           pause_on_hover: true,
           resume_on_mouseout: true,
           slide_number...