elkfox / focus Goto Github PK
View Code? Open in Web Editor NEW๐ A minimal popup, modal, overlay, drawer and dialogue window plugin
Home Page: https://elkfox.github.io/Focus/
๐ A minimal popup, modal, overlay, drawer and dialogue window plugin
Home Page: https://elkfox.github.io/Focus/
and also use contst where possible
One focus to control both a mobile view and a desktop view for example.
Perhaps it's best not to use Id as the default selector
The triggerClass option isn't included in the documentation.
Options to add config for:
In the original Reinforced popup system, we added an autofocus helper class into the JS to attach autofocus events to inputs in forms inside popups. It would be great if we could integrate this into the new Popups.js
The code went something like this:
$('.popup-link').on('click', function(event) {
... other stuff here
setTimeout(function(){
$(popupId + ' .Autofocus').focus();
}, 300);
});
data-target
check to data-close
eventsThe popups are using -50% transforms to center them. This sometimes means that they, and their contents are placed on a subpixel value which causes blurriness. There are hacks to resolve this but it varies across browsers and hardware.
Seems as though flexbox is the only pure css solution to this issue.
so that escape doesn't close certain popups
Add preventDefault to click events for v2x
Also address close bug #22
The popups trigger event listens for all elements with [data-trigger]
instead of [data-trigger="popup"]
which can disable other unrelated functions that might want to use the data-trigger attribute (such as: data-trigger="toggle"
or data=trigger="my-unrelated-trigger"
)
The trigger line should be updated as follows:
jQuery(document).on('click', '[data-trigger]', function(event) {
jQuery(document).on('click', '[data-trigger="popup"]', function(event) {
Hi. Thanks for the code.
I tried adding a second close link, but it doesn't work. As a work around, I used the .popup-outer on a div with a close text inside. This closed it on desktop, but not iphone.
Any advice would be much appreciated. It's the final step before I go live with this.
Thanks!
Bug: When a user clicks inside the popup the entire popup closes.
Expected: Clicking the overlay or close button should close the popup. When clicking the popup content, the popup should remain open
Add detach
flag to Focus config which appends popups to the end of the document body on load.
Add data-target
check to data-close
events
if ((typeof(jQuery(this).data('target')) == 'undefined') || (jQuery(this).data('target') == _this.target)) {
_this.hide();
}
// Detach unless and append to the end of body
if (this.config.detach) {
jQuery(document).ready(function() {
jQuery(target).detach().appendTo('body');
});
};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.