jQuery Plugin to Embed Giphy Images

jQuery Plugin to Embed Giphy Images - Bootstrap Giffy Gallery
Code Snippet:Giffy-Gallery
Author: Chris Ross
Published: January 19, 2024
Last Updated: January 22, 2024
Downloads: 2,826
License: MIT
Edit Code online: View on CodePen
Read More

The Giffy Gallery is a jQuery & Bootstrap-powered plugin to embed Giphy images on websites. It use the GIPHY API to get animated images with specific tag / keyword from Giphy. The plugin also lets users add categories (from the front-end) from which it loads gif images.

How to Use jQuery Giffy Gallery

1. Load the jQuery and Bootstrap CSS into your HTML document.

<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>

<!-- Bootstrap CSS -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">

2. Also, include Giffy Gallery CSS and JavaScript file in your webpage.

<!-- Giffy Gallery CSS -->
<link rel="stylesheet" type="text/css" href="assets/css/style.css">

<!-- Giffy Gallery Js -->
<script type="text/javascript" src="assets/javascript/app.js"></script>

3. Create HTML structure for Gallery as follows.

<div id="divGallery" class="container">
   <div class="row">
      <div id="divButtons" class="col col-lg-12"></div>
   </div>
   <div class="row">
      <div class="col col-lg-7 text-center m-3">
         <input type="text" class="mb-1" id="txtCategory" maxlength="20">
         <button id="btnSaveCategory" class="btn btn-info">Add Category</button>
      </div>
      <div class="col col-lg-4 text-center m-3">
         <button id="btnReset" class="btn btn-danger invisible">Clear Giffs</button>
         <button id="btnDelLocal" class="btn btn-danger invisible">Delete User Buttons</button>
      </div>
   </div>
</div>

4. The basic CSS styles to customize the overall gallery page.

body{
    background-color: gray;
    background-image: url("../images/grey_wash_wall.png");
    height:100%;
}
header{
    border-bottom: 2px solid #66ffff;
}
img{
    width:100%;height:auto;
}
.card{
    cursor:pointer;
    width:100%;
}
.col-md-2{
    min-width: 150px;
}

@media screen and (max-width:667px){
    ul{
        padding-left:1px;
    }
    .container{
        margin-bottom:160px;
    }
    .display-5{
        font-size: 10px;
    }
}

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About CodeHim

Free Web Design Code & Scripts - CodeHim is one of the BEST developer websites that provide web designers and developers with a simple way to preview and download a variety of free code & scripts. All codes published on CodeHim are open source, distributed under OSD-compliant license which grants all the rights to use, study, change and share the software in modified and unmodified form. Before publishing, we test and review each code snippet to avoid errors, but we cannot warrant the full correctness of all content. All trademarks, trade names, logos, and icons are the property of their respective owners... find out more...