> For the complete documentation index, see [llms.txt](https://real3dflipbook.gitbook.io/jquery/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://real3dflipbook.gitbook.io/jquery/creating-flipbook.md).

# Creating Flipbook

To create a flipbook, you need to&#x20;

Include scripts and style in your head of your HTML

```html
<link rel="stylesheet" type="text/css" href="css/flipbook.style.css">

<script src="js/flipbook.min.js"></script>
```

Create an element that will be container for flipbook, for example

```html
...
<body>
    <div id="container"></div>
</body>
...
```

and call the flipBook function with options.

### Flipbook from images

```javascript
const options = {
    pages: [
        {src: "book1/1.jpg", thumb: "book1/thumb1.jpg"},
        {src: "book1/2.jpg", thumb: "book1/thumb2.jpg"},
        ...
    ]
}
const container = getElementById('container');

new FlipBook(container, options)
```

#### Full code

```html
<!DOCTYPE html>
<html>

<head>
  <link rel="stylesheet" type="text/css" href="css/flipbook.style.css">
  <script src="js/flipbook.min.js"></script>

  <script type="text/javascript">
    document.addEventListener("DOMContentLoaded", function () {
      const options = {
        pages: [
          {src: "book1/1.jpg", thumb: "book1/thumb1.jpg"},
          {src: "book1/2.jpg", thumb: "book1/thumb2.jpg"},
          ...
        ]
      }
      const container = document.getElementById('container');
      new FlipBook(container, options);
    });
  </script>

</head>

<body>
  <div id="container"></div>
</body>

</html>

```

### Flipbook from PDF

```javascript
const options = {
    pdfUrl: 'pdf/1.pdf'
}
const container = getElementById('container');

new FlipBook(container, options)
```

#### Full code

```html
<!DOCTYPE html>
<html>

<head>
  <link rel="stylesheet" type="text/css" href="css/flipbook.style.css">
  <script src="js/flipbook.min.js"></script>

  <script type="text/javascript">
    document.addEventListener("DOMContentLoaded", function () {
      const options = {
        pdfUrl: 'pdf/1.pdf'
      };
      const container = document.getElementById('container');
      new FlipBook(container, options);
    });
  </script>

</head>

<body>
  <div id="container"></div>
</body>

</html>

```

### Creating flipbooks using jQuery synthax (legacy)

Flipbooks can also be created using jQuery, to support legacy code

<pre class="language-javascript"><code class="lang-javascript">jQuery(document).ready({
<strong>  jQuery("#container").flipBook(optinos)
</strong>})
</code></pre>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://real3dflipbook.gitbook.io/jquery/creating-flipbook.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
