dcrall / proto-facebox Goto Github PK
View Code? Open in Web Editor NEWYet Another Facebox Clone for Prototype
Yet Another Facebox Clone for Prototype
This may be an artifact of the original Facebox, but I'm not sure why Facebox.reveal() invokes show() on all the children of facebox_content instead of just showing facebox_content itself. Certainly for things like MAUI's list options, this is problematic.
reveal: function(data, klass){
this.loading();
$('facebox').fire('facebox:beforeReveal');
var faceboxContent = $('facebox_content');
if (klass) faceboxContent.addClassName(klass);
faceboxContent.update(data);
$$('#facebox .loading').invoke('remove');
// Why show all children?
$('facebox_content').childElements().invoke('show');
this.setLocation();
this.open();
$('facebox').fire('facebox:reveal');
$('facebox').fire('facebox:afterReveal');
}
For some reason, Prototype doesn't calculate the width correctly on a large image on the initial reveal. If the window is resized, the facebox centers correctly. Use the following logging code:
setLocation: function(){
var pageScroll = document.viewport.getScrollOffsets();
var vertical_margin = pageScroll.top + (document.viewport.getHeight()/ this.settings.v_margin_divisor);
var left_offset = (document.viewport.getWidth()/2) - ($('facebox').getWidth()/2);
console.log('Viewport width: ' + document.viewport.getWidth());
console.log('Facebox width: ' + $('facebox').getWidth());
console.log('Top: ' + vertical_margin);
console.log('Left: ' + left_offset);
$('facebox').setStyle({
'top': vertical_margin + 'px',
'left': left_offset + 'px'
});
},
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.