Skip to content
DearFlip JS Flipbook
  • Plugins
    • WordPress Flipbook
    • Joomla Flipbook
    • Javascript Flipbook
  • Demos
    • Embedded Example
    • Popup Examples
    • Online PDF Viewer
  • Pricing
  • Docs
  • Support
  • Account
  • Blog
DearFlip JS Flipbook
  • Plugins
    • WordPress Flipbook
    • Joomla Flipbook
    • Javascript Flipbook
  • Demos
    • Embedded Example
    • Popup Examples
    • Online PDF Viewer
  • Pricing
  • Docs
  • Support
  • Account
  • Blog

Getting Started

  • Getting started
  • File Structure & Template
  • Basic Usages
  • Options List

FAQs

  • Support and FAQs
  • License Activation
  • Why are there PHP files in download zip file?

Examples

  • Examples
  • Basic – Flipbook using HTML
  • Basic – Using options
  • Adding Outline/Table of Content
  • Adding Search

Customizations

  • onPageChanged
  • Customizations
  • Open flipbook in full-screen
  • onReady Function
  • PDF links custom class and usages
  • Update URL hash on the address bar when a page flips
  • How to add custom share button?

Advanced Customizations

  • Add Close button to ToolBar
  • Advanced Customizations
  • Store last viewed flipbook page
  • Add Custom Button to Flipbook
  • Add Custom Download button to Flipbook
  • Add print button to flipbook
  • Add Custom Zoom Reset button to Flipbook
  • Thumb animation on page scroll
  • Load more button for lightboxes
  • Reset flipbook zoom on flip
View Categories
  • Home
  • Documentation
  • Customizations
  • How to add custom share button?

How to add custom share button?

Click to open demo!
We expect knowledge of Javascript and CSS to complete this customization.

Add the following CSS for What’s App button icon, and close button:

.df-share-button.ti-whatsapp:before {
    content: url('https://api.iconify.design/simple-icons:whatsapp.svg?color=%23777&width=20&height=20');
}

.df-share-button.df-icon-close {
    position: absolute;
    top: 0px;
    right: 0px;
}

Also add the following code that
1. Removes mail icon
2. Creates the What’s App button
3. Adds close button

jQuery(function(){
    DFLIP.defaults.onCreateUI = function(flipbook){

        //1. remove Mail icon
        flipbook.ui.shareBox.mail.off().remove();


        //2. Add Whats App Button
        flipbook.ui.shareBox.whatsapp = jQuery("<a target='_blank'>").addClass("df-share-button ti-whatsapp");
        flipbook.ui.shareBox.whatsapp.appendTo(flipbook.ui.shareBox.box);
        flipbook.ui.shareBox.whatsapp.on("click",function(e){

            jQuery(this).attr('href', 'https://wa.me?text='+ encodeURIComponent('Check this link: ' + flipbook.ui.shareBox.shareUrl));

            e.stopPropagation();

        });

     
        //3. Add Close Button
        flipbook.ui.shareBox.closeButton = jQuery("<a target='_blank'>").addClass("df-share-button df-icon-close");
        flipbook.ui.shareBox.closeButton.appendTo(flipbook.ui.shareBox.box);
        flipbook.ui.shareBox.closeButton.on("click",function(e){

            flipbook.ui.shareBox.close();

            e.stopPropagation();

        });

    }
});

Updated on April 30, 2023

More Inquiry/Info & COMMENTS:

All DearFlip comments and discussion have been moved to
https://github.com/dearhive/dearflip-js-flipbook/discussions

Links

  • Terms and Conditions
  • License Terms
  • Privacy Policy

Recent Posts

  • Best Flipbook Javascript Plugins with Pros and Cons
  • PDF Partial Loading – What, How and Why?
  • PDF Hyper Links are not working? What is the issue?
  • How flipbook size works? How to make it bigger?
  • Customizing Buttons

Products

  • DearFlip WordPress Flipbook
  • DearFlip 3D Flipbook JS Plugin
  • Online PDF Viewer
  • DearFlip PDF Flipbook for Chrome
© 2025 | A product of DearHive.com