GithubHelp home page GithubHelp logo

kristofzerbe / downuppopup.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ali-dincer/downuppopup.js

0.0 1.0 0.0 26 KB

Simple, fast and customizable popups.

Home Page: https://downuppopupjs.dincerali.com/

JavaScript 85.75% CSS 14.25%

downuppopup.js's Introduction

downupPopup.js

Ali Dinçer

Usage


  1. Include jQuery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
  1. Include plugin's code
<link rel="stylesheet" href="downupPopup/downupPopup.css">
<script src="downupPopup/downupPopup.js"></script> <!-- don't forget - add after jquery -->
  1. Create an element
<div id="myElement1">
  <div class="downupPopup-content">
  </div>
</div>
  1. Call the plugin
$("#myElement1").downupPopup();

Default Options

$("#myElement1").downupPopup({ 
 duration: "300", // milliseconds
 animation: "ease", // css effects -> ease, linear, ease-in, ease-out, ease-in-out, cubic-bezier(n,n,n,n)
 background: true, // true, false -> dark background
 radiusLeft: "10px", // top-left-radius
 radiusRight: "10px", // top-right-radius
 distance: 20, // distance top
 headerText: "", // title, you can use HTML here -> <b>Example</b>
 width: "100%", // width -> 100%, 80%, 200px etc.
 minContentHeight: null, // minimum content height in px if needed (dynamic distance)
 contentScroll: false, // true, false -> for use, <div class="downupPopup-content"></div> have to inside the element
 urlHash: null // url hash & BACK button support
});

Open - Close

$("#myElement1").downupPopup('open');
$("#myElement1").downupPopup('close');

Examples


Open With Button

$("#btn-1").click(function () { 
  $("#myElement1").downupPopup("open"); 
});

Duration

$("#duration-700").downupPopup({
 duration: 700 
});

Animation

$("#linear").downupPopup({ 
 animation: "linear",
 duration: 400
}); 

$("#cubic").downupPopup({
 animation: "cubic-bezier(.96,.33,0,1)",
 duration: 1000 
});

Background

$("#background").downupPopup({ 
 background: false
});

Radius

$("#radius").downupPopup({ 
 radiusLeft: "40px",
 radiusRight: "0px" 
});

Distance

$("#distance0").downupPopup({ 
 distance: 0,
 radiusLeft: "0px",
 radiusRight: "0px" 
}); 
                
$("#distance70").downupPopup({
 distance: 70 
});

Minimum Content Height (Dynamic Distance)

$("#mincontent-600").downupPopup({
 minContentHeight: '600' //in Pixel
});

Header Text / Title

$("#headertext").downupPopup({
 headerText: "<h5 class='bg-dark text-white'>html is usable here</h5>"
});

Width

$("#width-90").downupPopup({
 width: '90%'
});

Content Scroll

$("#contentscroll").downupPopup({
 contentScroll: true 
});

<div id="contentscroll">
  <div class="downupPopup-content">
     your HTML elements... 
  </div>
</div>

URL Hash and BACK button support

$("#hash").downupPopup({
 urlHash: 'dialog-open'
});


Responsive and Mobile Performance


downupPopup


Copyright 2021, Ali Dinçer

Dual licensed under the MIT or GPL.

written by Ali Dinçer

dincerali.com

downuppopup.js's People

Contributors

ali-dincer avatar kristofzerbe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.