window.addEvent('domready', function() { // Morphing the list with CSS selectors $$('#idList LI').each(function(el){ new Fx.Elements(el).start({ '0': { 'opacity': [1,0.01] } }); }); $$('#idList LI').each(function(el22){ el22.set('morph', {duration: '300'}); el22.morph({'opacity': '0.01' }); el22.addEvent('mouseover', function(){ el22.morph({'opacity': '1' }); }); el22.addEvent('mouseout', function(){ el22.morph({'opacity': '0.01' }); }); }); function startbg() { var size = $('image_backg').getSize(); var ori_height = size.y; var av_height = ori_height-45; var ori_width = size.x; var av_width = ori_width-45; var myEffect = new Fx.Morph('image_backg', { duration: 1000, transition: Fx.Transitions.Sine.easeOut }); myEffect.start({ 'height': [ori_height, av_height], 'width': [ori_width, av_width], 'top': [0, -5], 'left': [-45, 0] }); } function startbg2() { new Fx.Elements($$('.accueil'), {duration: 500}).start({ '0': { 'opacity' : [0,1] } }); } /* progress bar */ var progressBar = new dwProgressBar({ container: $('progress-bar'), startPercentage: 0, speed:750, boxID: 'box', percentageID: 'perc', displayID: 'text', displayText: true }); /* preloading */ var images = ['/themes/images/diapo/general.jpg']; var loader = new Asset.images(images, { onProgress: function(counter,index) { progressBar.set((counter + 1) * (100 / images.length)); }, onComplete: function() { var size = $('image_backg').getSize(); var av_height = size.y+50; var av_width = size.x+45; $('image_backg').setStyle('width', av_width+'px'); $('image_backg').setStyle('height', av_height+'px'); $('image_backg').style.left = "-45px"; new Fx.Elements($$('#progress-bar'), {duration: 200}).start({'0': {'opacity' : [0.7,0] } }); new Fx.Elements($$('#image_backg'), {duration: 1000}).start({'0': {'opacity' : [0,1] } }); var myTimer = startbg.delay(1); var myTimer2 = startbg2.delay(200); } }); $$('.bbas2').each(function(bbas2) { bbas2.morph({'opacity': '0', 'height': '1'}); }); $$('.bbas').each(function(bbas) { bbas.addEvent('mouseover', function(){ bbas.getElements('ul').morph({'opacity': '0.1' }); bbas.getElements('li').morph({'opacity': '1', 'height': '80'}); bbas.getElements('li').tween('margin-top', -90); }); bbas.addEvent('mouseout', function(){ bbas.getElements('ul').morph({'opacity': '1' }); bbas.getElements('li').morph({'opacity': '0', 'height': '1' }); bbas.getElements('li').tween('margin-top', -10); }); }); var bIsMobile = fnIsMobile(); if(bIsMobile===false){ window.addEvent('resize', function(){ }); } var myElement = $(document.body); var myFx = new Fx.Scroll(myElement).start(0, 0.5); var boutonrem = new Fx.Elements($('topbut')); boutonrem.start({ '0': {'opacity': [1,0] }}); $('topbut').addEvent('click', function(){ myFx.toTop(); }); var ss = new ScrollSpy({ min: 200, onEnter: function() { boutonrem.start({ '0': {'opacity': [0,1] }}); }, onLeave: function() { boutonrem.start({ '0': {'opacity': [1,0] }}); } }); // MENU HAUT var list = $$('#nav li a'); list.set('morph', { duration: 200 }); list.addEvents({ mouseover: function(){ var test = this.getParent().className; if (test == "menupassif") { this.morph({ 'padding-top': '17' }); } }, mouseout: function(){ var test = this.getParent().className; if (test == "menupassif") { this.morph({ 'padding-top': '12' }); } } }); // FIN MENU HAUT }); window.addEvent('load', function(){ new MooTooltips({ hovered:'.tipper', // the element that when hovered shows the tip ToolTipClass:'ToolTips', // tooltip display class toolTipPosition:-1, // -1 top; 1: bottom - set this as a default position value if none is set on the element sticky:false, // remove tooltip if closed fromTop: 5, // distance from mouse or object showDelay: 150, fromLeft: -45, // distance from left duration: 300, // fade effect transition duration fadeDistance: 20 // the distance the tooltip starts the morph }); });