Création des Logiciels de gestion d'Entreprise, Création et référencement des sites web, Réseaux et Maintenance, Conception
Création des Logiciels de gestion d'Entreprise, Création et référencement des sites web, Réseaux et Maintenance, Conception
.CSS_FLOATY_BAR {
...
top: -50px; /* start off the screen, so it slides in nicely */
-webkit-transition: top 0.2s ease-out;
...
}
In JavaScript:// Constructor for the floaty bar
gmail.FloatyBar = function() {
this.menuDiv = document.createElement('div');
this.menuDiv.className = CSS_FLOATY_BAR;
...
};
// Called when it's time for the floaty bar to move
gmail.FloatyBar.prototype.setTop = function() {
this.menuDiv.style.top = window.scrollY + 'px';
};
// Called when the floaty bar menu is dismissed
gmail.FloatyBar.prototype.hideOffScreen = function() {
this.menuDiv.style.top = '-50px';
};
gmail.floatyBar = new gmail.FloatyBar();
// Listen for scroll events on the top level window
window.onscroll = function() {
...
gmail.floatyBar.setTop();
...
};
The essence here is that when the viewport scrolls, the floaty bar 'top' is set to the new viewport offset. The -webkit-transition rule specifies the animation parameters. (The 'top' property is to be animated, over 0.2s, using the ease-out timing function.) This is the animation behavior we had at launch, and it works just fine on Android and mobile Safari browsers..CSS_FLOATY_BAR {
...
top: -50px; /* start off the screen, so it slides in nicely */
-webkit-transition: -webkit-transform 0.2s ease-out;
...
}
In JavaScript:// Called when it's time for the floaty bar to move
gmail.FloatyBar.prototype.setTop = function() {
var translate = window.scrollY - (-50);
this.menuDiv.style['-webkit-transform'] = 'translateY(' + translate + 'px)';
};
// Called when the floaty bar menu is dismissed
gmail.FloatyBar.prototype.hideOffScreen = function() {
this.menuDiv.style['-webkit-transform'] = 'translateY(0px)';
};
Upon every scroll event, the floaty bar is translated vertically to the new viewport offset (modulo the offscreen offset which is important to the floaty bar's initial appearance). And, why exactly is this such an improvement? Even though the logic is equivalent, iPhone OS's implementation of CSS transforms is "performance enhanced", whilst our first iteration (animating the 'top' property) is performed by the OS in software. That's why the experience was unfortunately somewhat chunky at times, depending on the speed of the iPhone hardware.Google is dedicated to making the Internet relevant and useful to Arabic speakers, and to developing meaningful and local products for the Middle East. We fully realise that we cannot foster this growing Internet ecosystem alone, and we therefore believe that tech entrepreneurs and developers have the opportunity to transform the Web for the world and for the Middle East.
So for the first time ever in Egypt and Jordan, Google is very excited to host its G-days, in Cairo between December 8th and 10th for G-Egypt, and Amman between December 12th and 14th for G-Jordan.
Each day of the 3-day conference will cater to a different audience, spanning computer science students and professors, professional developers, webmasters, entrepreneurs, small businesses and tech marketers. Take a look at our sites (G-Egypt and G-Jordan) to learn more about the G-day that might fit your appetite. You must pre-register on the websites as space is limited - you will then be fully registered as soon as we send you a confirmation.
Some of Google’s best and most engaging engineers, product managers, business managers and leadership will be speaking about Google’s open web and mobile technologies. Attendees will have the chance to interact with Googlers and explore Google’s technologies through a combination of tech talks and breakout sessions. We’re getting ready to make these events fun, insightful and interesting so we hope to see you there !
On Twitter : #gegypt #gjordan @GoogleDevMENA
By Sebastian Trzcinski-Clément, Developer Relations for the Middle East and Northern Africa2013, By: Seo Master