[solved] Using multiple Mootools in one Site

here you will find only solved 1.1 Help topics

Moderator: 1.1 Moderators

[solved] Using multiple Mootools in one Site

Postby rossnaumov on Fri Nov 06, 2009 8:57 am

Hello
I am trying to use both these Mootools products (below) in the one HTML site i'm building but can't seem to get them working together. They will work independently but unfortunately not together. From my knowledge i can see that both the .js file names are the same "mootools.js" leading me to believe this could be where the issue is. I have tried saving one in a separate folder **** "mtl/mootools.js" (see code below) but no such luck. I have looked through Mootools documentation http://mootools.net/docs/core for a possible solutions and googled my dilemma but no luck.

Can anyone help?

Thank you - Ross

**** I'M USING THESE MOOTOOLS PRODUCTS ****

#1. http://nettuts.s3.amazonaws.com/022_Moo ... mple.html# ***** (MOUSE HOVER EFFECT)

#2. http://www.roscripts.com/uploads/smooth ... index.html ***** ( SMOOTH SCROLLING)

**** MY CODE ****

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Ross</title>
  6.  
  7.  
  8. <SCRIPT src="mootools.js" type="text/javascript"></SCRIPT>
  9.  
  10.  
  11. <STYLE type="text/css" media="screen">
  12.    
  13.     /*--- the base ---*/
  14.     #pageWrap {
  15.         position: absolute; z-index: 10; top: 0px; left: 780px;
  16.     }
  17.     #audioPage {
  18.         position:absolute; top:50px; left:-85px; padding:0px; z-index:10;
  19.     }   
  20.     #psdPage {
  21.         position:absolute; top:50px; left:-200px; padding:0px; z-index:10;
  22.     }
  23.     /*--- the popup ---*/
  24.     #bubbleWrap {
  25.         position: absolute; z-index: 50; left: 0px; top: 285px;
  26.     }
  27.     .bubble {
  28.         position: absolute;
  29.     }
  30.     .clear {
  31.         clear: both;
  32.     }
  33.    
  34.     /*--- THE LOGO ---*/
  35.     #pageWrap2 {
  36.         position: absolute; z-index: 5; top: 50px; left: 0px;
  37.     }
  38.     #psdPage2 {
  39.         margin-right: 6px; float: left; cursor: pointer;
  40.         }
  41.     #netPage2 {
  42.         margin-right: 6px; float: left; cursor: pointer;
  43.     }   
  44.     #audioPage2 {
  45.         float: left; cursor: pointer;
  46.     }
  47.     #bubbleWrap2 {
  48.         position: absolute; z-index: 10; left: 0px; top: 285px;
  49.     }
  50.     .bubble2 {
  51.         position: absolute;
  52.     }
  53.     .clear {
  54.         clear: both;
  55.     }
  56. </STYLE>
  57.  
  58.  
  59. <SCRIPT type="text/javascript" charset="utf-8">
  60. window.addEvent('domready', function() {
  61.    
  62.     // Create variables (in this case two arrays) representing our bubbles and pages
  63.     var myPages = $$('.page');
  64.     var myBubbles = $$('.bubble');
  65.    
  66.     // Set bubbles opacity to zero so they're hidden initially and toggle visibility on for their container 
  67.     myBubbles.setStyle('opacity', 0);
  68.     $('bubbleWrap').setStyle('visibility','visible')
  69.    
  70.     // Add our events to the pages
  71.     myPages.each(function(el, i) {
  72.         el.set('morph', {link : 'cancel'});
  73.        
  74.         el.addEvents({
  75.             'mouseenter': function() {
  76.                 myBubbles[i].morph({
  77.                     'opacity' : 1,
  78.                     'margin-top' : '-0px'
  79.                 });
  80.             },
  81.             'mouseleave' : function() {
  82.                 myBubbles[i].morph({
  83.                     'opacity' : 0,
  84.                     'margin-top' : 0
  85.                 });
  86.             }   
  87.         });
  88.     });
  89.    
  90.     // 2nd LOT
  91.    
  92.     // Create variables (in this case two arrays) representing our bubbles and pages
  93.     var myPages2 = $$('.page2');
  94.     var myBubbles2 = $$('.bubble2');
  95.    
  96.     // Set bubbles opacity to zero so they're hidden initially and toggle visibility on for their container 
  97.     myBubbles2.setStyle('opacity', 0);
  98.     $('bubbleWrap2').setStyle('visibility','visible')
  99.    
  100.     // Add our events to the pages
  101.     myPages2.each(function(el, i) {
  102.         el.set('morph', {link : 'cancel'});
  103.        
  104.         el.addEvents({
  105.             'mouseenter': function() {
  106.                 myBubbles2[i].morph({
  107.                     'opacity' : 1,
  108.                     'margin-top' : '-0px'
  109.                 });
  110.             },
  111.             'mouseleave' : function() {
  112.                 myBubbles2[i].morph({
  113.                     'opacity' : 0,
  114.                     'margin-top' : 0
  115.                 });
  116.             }   
  117.         });
  118.     });
  119. });
  120.  
  121. </SCRIPT>
  122.  
  123. <link rel="stylesheet" href="index5.css" type="text/css" />
  124. <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
  125. <style type="text/css">
  126.     body {margin: 0px; padding: 0px;}
  127.     .footer2 {width: 100%; height: 1400px; background-image:url(images/BGgradient.gif);
  128.     position:absolute;
  129.     top:550px;
  130.     padding:0px;
  131.     z-index:10;
  132.     }
  133. .style5 {color: #6e7681}
  134. </style>
  135.  
  136.  
  137.  
  138.  
  139.  
  140. <!--SMOOTH SCROLLING -->
  141. <script language="JavaScript" type="text/javascript" src="mtl/mootools.js"></script>
  142. <script type="text/javascript">
  143.         window.onDomReady(function(){ new SmoothScroll({duration: 2800}); });
  144.     </script>
  145. <!-- TO HERE -->
  146.  
  147.  
  148.  
  149.  
  150.  
  151. </head>
  152. <body>
  153. <div class="main_box1">
  154.     <a id="main_box_image1" href="#" title="Test"><span>Contact Me</span></a>  </div>
  155.      
  156. <div class="footer2"></div>
  157.  
  158. <div id="wrap">
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165. <!--SMOOTH SCROLLING  -->
  166. <div style="position:fixed; right:400px; top:30px"><a href="#red" title="smoothly scroll to the red anchor">red</a> / <a href="#blue" title="smoothly scroll to the blue anchor">blue</a> / <a href="#gray" title="smoothly scroll to the gray anchor">gray</a> / <a href="#yellow" title="smoothly scroll to the yellow anchor">yellow</a> / <a href="#black" title="smoothly scroll to the black anchor">black</a> / <a href="#green" title="smoothly scroll to the green anchor">green</a></div>
  167. <a name="red" id="red"></a>
  168. <div style="width:10px;height:300px;background-color:red;margin:0px;"></div>
  169. <a name="blue" id="blue"></a>
  170. <div style="width:10px;height:300px;background-color:blue;margin:0px;"></div>
  171. <a name="gray" id="gray"></a>
  172. <div style="width:10px;height:300px;background-color:gray;margin:0px;"></div>
  173. <a name="yellow" id="yellow"></a>
  174. <div style="width:10px;height:300px;background-color:yellow;margin:0px;"></div>
  175. <a name="black" id="black"></a>
  176. <div style="width:10px;height:300px;background-color:black;margin:0px;"></div>
  177. <a name="green" id="green"></a>
  178. <div style="width:10px;height:300px;background-color:green;margin:0px;"></div>
  179. <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
  180. <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.   <div class="designDevelopment"></div>
  189.   <div class="designDevelopmentHeading"></div>
  190.   <div class="navCover"></div>
  191.   <div class="leftCover"></div>
  192.   <div class="plus"></div>
  193.   <div class="homepageWording"></div>
  194.   <div class="plus"></div>
  195.  
  196. <!--ENIGMA -->
  197. <div class="main_box01">
  198.     <a id="main_box_image01" href="#" title="Test"><span>Email Us</span></a>  </div>
  199.   <div class="BGimage_enigma"></div>
  200.   <div class="enigma_pic"></div>
  201.  
  202. <!--OH SEW -->  
  203.   <div class="main_box2">
  204.     <a id="main_box_image2" href="#" title="Test"><span>Email Us</span></a>  </div>
  205.   <div class="BGimage_ohsewnoosa"></div>
  206.  
  207.   <!-- SOUTHSIDE CLEANING -->
  208.   <div class="main_box3">
  209.     <a id="main_box_image3" href="#" title="Test"><span>Email Us</span></a>  </div>
  210.   <div class="BGimage_southsidecleaning"></div>
  211.  
  212.   <!-- FALLOW -->
  213.   <div class="main_box4">
  214.     <a id="main_box_image4" href="#" title="Test"><span>Email Us</span></a>  </div>
  215.   <div class="BGimage_fallowfox"></div>
  216.  
  217.   <!-- CONSTRUCTIONS-->
  218.   <div class="main_box5">
  219.     <a id="main_box_image5" href="#" title="Test"><span>Email Us</span></a>  </div>
  220.   <div class="BGimage_suncoastConstructions"></div>
  221.  
  222.   <!-- ROLLYS -->
  223.   <div class="main_box6">
  224.     <a id="main_box_image6" href="#" title="Test"><span>Email Us</span></a>  </div>
  225.   <div class="BGimage_rollysCustoms"></div>
  226.  
  227. <DIV id="siteWrap">
  228.         <DIV id="bubbleWrap" style="visibility: visible; ">
  229.             <div class="bubble"><img src="images/homepageWording2.gif" alt="PSDTUTS" /></div>
  230.             <div class="bubble"><img src="images/homepageWording2.gif" alt="NETTUTS" /></div>
  231.             <div class="bubble"><img src="images/homepageWording2.gif" alt="AUDIOTUTS" /></div>
  232. </DIV>
  233.        
  234.         <DIV id="pageWrap">
  235.             <div class="page" id="psdPage"><a href="work.html"><img src="images/workHome.gif" alt="PSDTUTS" /></a></div>
  236.             <div class="page" id="audioPage"><a href="work.html"><img src="images/aboutHome.gif" alt="AUDIOTUTS" /></a></div>
  237.            
  238.     </DIV>
  239. </DIV>
  240.  
  241. <div id="siteWrap2">
  242.         <div id="bubbleWrap2" style="visibility: hidden;">
  243.             <div class="bubble2"><img src="images/homepageWording2.gif" alt="PSDTUTS" /></div>
  244.         </div>
  245.        
  246.         <div id="pageWrap2">
  247.             <div class="page2" id="psdPage2"><a href="work.html"><img src="images/logoHome.gif" alt="PSDTUTS" /></a></div>
  248.            
  249.         </div>
  250.   </div>
  251.  
  252. </div>
  253. </body>
  254. </html>
rossnaumov
 
Posts: 11
Joined: Fri Nov 06, 2009 8:11 am

Re: Using multiple Mootools in one Site

Postby wowenkho on Fri Nov 06, 2009 6:33 pm

hello. i'm if this is going to be harsh, but your implementation of CSS and JS in your head tag is very unsound and unstable. not to mention, the longer your post become because of your pasted code, the more i got hesitant in planning to "forgive" you for not posting appropriately according to help rules indicated above. i had to fix everything into bbcode so it just won't be all messed up.

going back to the topic, if you would want to at least find ways to debug your code, you have to at least keep them in order and not just doing some copy-pasting barrage hoping that it will mash up perfectly. JS, as powerful as it may possibly be in itself and because of MooTools, is still fragile when code organization is not taken care of.

so what i'm suggesting is to fix your implementation such that all your CSS links and tags come first (and if possible they're all included as documents outside of your HTML). after that, then you can include the JS files of whatever plugins you've got to apply to your site. similarly your personal JS script would be better off being in a different document as well.

from there, needless to mention, it'll be easier to look for bugs and whatnot. it'll be more pleasing to the eye too. in a way, you're doing all of us a favor.

here's how a clean implementation inside your <head> tag could look like:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml"
  3.     xmlns:ns="http://www.lazurski.pl/">
  4.   <head>
  5.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  6.    
  7.     <title>Ross</title>
  8.    
  9.     <!-- CSS implementations come first and are imported via links as much as possible -->
  10.     <link rel="stylesheet" type="text/css" href="css/pluginstyles.css" />
  11.     <link rel="stylesheet" type="text/css" href="css/anotherpluginstyles.css" />
  12.     <link rel="stylesheet" type="text/css" href="css/mystyles.css" />
  13.    
  14.     <!-- JS implementations come next and are imported via the src attribute as much as possible -->
  15.     <script type="text/javascript" src="js/mootools.js"></script>
  16.     <script type="text/javascript" src="js/mootools-more.js"></script>
  17.     <script type="text/javascript" src="js/plugin.js"></script>
  18.     <script type="text/javascript" src="js/anotherplugin.js"></script>
  19.     <script type="text/javascript" src="js/myscript.js"></script>
  20.      
  21.   </head>
  22.   <body>
  23.      
  24.      <!-- your HTML content -->
  25.      
  26.   </body>
  27. </html>
my sword is yours...
http://wowenkho.com

for those who want to talk with me quicker, add me on Yahoo! Messenger through my ID: michaelapeles
User avatar
wowenkho
mootools freak
 
Posts: 1146
Joined: Sat Aug 15, 2009 10:38 am
Location: Antipolo City, Philippines

Re: Using multiple Mootools in one Site

Postby rossnaumov on Sat Nov 07, 2009 9:11 am

Thanks for your help wowenkho. Harsh no, I'm always looking to move forward and improve on what I already know. I guess that's what i love about the web .. there's always better ways to do things!... I digress now. I have cleaned up my HTML page significantly as suggested and created a folder called js and copied both the MOOTOOLS files in there re-naming them appropriately to not get confused. I have also moved my CSS as suggested. Do you mind taking a look at what i've done so far and let me know what you think? I have through "help rules" so i hope to follow the necessary procedures. please let me know of any other ways on improving my communication.

Hover effect - version:"1.2.0"
Smooth Scrolling - couldn't find a version


Thanks - Ross

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3.     <head>
  4.      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5.  
  6.     <title>Ross</title>
  7.    
  8.     <link rel="stylesheet" href="index5a.css" type="text/css" />
  9.  
  10.     <!--HOVER -->
  11.     <SCRIPT src="js/mootools_hover.js" type="text/javascript"></SCRIPT>
  12.    
  13.     <!--SMOOTH SCROLL -->
  14.     <SCRIPT src="js/mootools_scroll.js" type="text/javascript"></SCRIPT>
  15.  
  16.     <!--SMOOTH SCROLL -->
  17.     <SCRIPT type="text/javascript" charset="utf-8">
  18.         window.onDomReady(function(){ new SmoothScroll({duration: 2800}); });
  19.     </script>
  20.    
  21.     <!--HOVER -->
  22.     <SCRIPT type="text/javascript" charset="utf-8">
  23.     window.addEvent('domready', function() {
  24.    
  25.     // Create variables (in this case two arrays) representing our bubbles and pages
  26.     var myPages = $$('.page');
  27.     var myBubbles = $$('.bubble');
  28.    
  29.     // Set bubbles opacity to zero so they're hidden initially and toggle visibility on for their container 
  30.     myBubbles.setStyle('opacity', 0);
  31.     $('bubbleWrap').setStyle('visibility','visible')
  32.    
  33.     // Add our events to the pages
  34.     myPages.each(function(el, i) {
  35.         el.set('morph', {link : 'cancel'});
  36.        
  37.         el.addEvents({
  38.             'mouseenter': function() {
  39.                 myBubbles[i].morph({
  40.                     'opacity' : 1,
  41.                     'margin-top' : '-0px'
  42.                 });
  43.             },
  44.             'mouseleave' : function() {
  45.                 myBubbles[i].morph({
  46.                     'opacity' : 0,
  47.                     'margin-top' : 0
  48.                 });
  49.             }   
  50.         });
  51.     });
  52.    
  53. });
  54.  
  55. </SCRIPT>
  56.  
  57.     </head>
  58.     <body>
  59.  
  60.     <!-- your HTML content -->
  61.  
  62.     </body>
  63. </html>
rossnaumov
 
Posts: 11
Joined: Fri Nov 06, 2009 8:11 am

Re: Using multiple Mootools in one Site

Postby wowenkho on Sat Nov 07, 2009 9:59 am

first of all, if you really have read the help rules clearly, you should realize that whatever code you place in your posts should be wrapped with the code, html, css, or js bb tags for readability purposes. i wrapped it once again for you..

where's your mootools.js file all of a sudden? it should be included before you place your other mootools plugins and whatnot.
my sword is yours...
http://wowenkho.com

for those who want to talk with me quicker, add me on Yahoo! Messenger through my ID: michaelapeles
User avatar
wowenkho
mootools freak
 
Posts: 1146
Joined: Sat Aug 15, 2009 10:38 am
Location: Antipolo City, Philippines

Re: Using multiple Mootools in one Site

Postby rossnaumov on Sat Nov 07, 2009 11:30 am

Do i wrap the code by downloading GeSHi ?
rossnaumov
 
Posts: 11
Joined: Fri Nov 06, 2009 8:11 am

Re: Using multiple Mootools in one Site

Postby wowenkho on Sat Nov 07, 2009 11:36 am

not really. just be aware that there are button on the top of the textarea where you type your posts. the code, css, html, and js buttons help you wrap your code nicely.
my sword is yours...
http://wowenkho.com

for those who want to talk with me quicker, add me on Yahoo! Messenger through my ID: michaelapeles
User avatar
wowenkho
mootools freak
 
Posts: 1146
Joined: Sat Aug 15, 2009 10:38 am
Location: Antipolo City, Philippines

Re: Using multiple Mootools in one Site

Postby rossnaumov on Sat Nov 07, 2009 11:56 am

Yes great thank you! I hope I've wrapped this correctly!?

I have also added my mootools.js directly below <link rel="stylesheet" href="index5a.css" type="text/css" />
Last edited by rossnaumov on Sat Nov 07, 2009 11:59 am, edited 1 time in total.
rossnaumov
 
Posts: 11
Joined: Fri Nov 06, 2009 8:11 am

Re: Using multiple Mootools in one Site

Postby rossnaumov on Sat Nov 07, 2009 11:57 am

Sorry i hit enter before i wrapped it!!!

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3.     <head>
  4.      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5.  
  6.     <title>Ross</title>
  7.    
  8.     <link rel="stylesheet" href="index5a.css" type="text/css" />
  9.    
  10.     <script language="JavaScript" type="text/javascript" src="mootools.js"></script>
  11.  
  12.     <!--HOVER -->
  13.     <SCRIPT src="js/mootools_hover.js" type="text/javascript"></SCRIPT>
  14.    
  15.     <!--SMOOTH SCROLL -->
  16.     <SCRIPT src="js/mootools_scroll.js" type="text/javascript"></SCRIPT>
  17.  
  18.     
  19.     <!--SMOOTH SCROLL -->
  20.     <SCRIPT type="text/javascript" charset="utf-8">
  21.         window.onDomReady(function(){ new SmoothScroll({duration: 2800}); });
  22.     </script>
  23.    
  24.    
  25.    
  26. <!--HOVER -->
  27.     <SCRIPT type="text/javascript" charset="utf-8">
  28.     window.addEvent('domready', function() {
  29.    
  30.     // Create variables (in this case two arrays) representing our bubbles and pages
  31.     var myPages = $$('.page');
  32.     var myBubbles = $$('.bubble');
  33.    
  34.     // Set bubbles opacity to zero so they're hidden initially and toggle visibility on for their container 
  35.     myBubbles.setStyle('opacity', 0);
  36.     $('bubbleWrap').setStyle('visibility','visible')
  37.    
  38.     // Add our events to the pages
  39.     myPages.each(function(el, i) {
  40.         el.set('morph', {link : 'cancel'});
  41.        
  42.         el.addEvents({
  43.             'mouseenter': function() {
  44.                 myBubbles[i].morph({
  45.                     'opacity' : 1,
  46.                     'margin-top' : '-0px'
  47.                 });
  48.             },
  49.             'mouseleave' : function() {
  50.                 myBubbles[i].morph({
  51.                     'opacity' : 0,
  52.                     'margin-top' : 0
  53.                 });
  54.             }   
  55.         });
  56.     });
  57.    
  58. });
  59.  
  60. </SCRIPT>
  61.  
  62.      
  63. </head>
  64. <body>
  65. <div class="main_box1">
  66.     <a id="main_box_image1" href="#" title="Test"><span>Contact Me</span></a>  </div>
  67.      
  68. <div class="footer2"></div>
  69.  
  70. <div id="wrap">
  71.  
  72.  
  73. </body>
  74. </html>
rossnaumov
 
Posts: 11
Joined: Fri Nov 06, 2009 8:11 am

Re: Using multiple Mootools in one Site

Postby wowenkho on Sat Nov 07, 2009 12:53 pm

the question now is: does it work? if not, does it throw any errors (and i'm hoping you're using firebug of firefox to do so).
my sword is yours...
http://wowenkho.com

for those who want to talk with me quicker, add me on Yahoo! Messenger through my ID: michaelapeles
User avatar
wowenkho
mootools freak
 
Posts: 1146
Joined: Sat Aug 15, 2009 10:38 am
Location: Antipolo City, Philippines

Re: Using multiple Mootools in one Site

Postby rossnaumov on Sun Nov 08, 2009 5:39 am

Yes i'm getting 3 errors in firebug

#1. C.prototype is undefined
#2. el.set is not a function
#3. el.removeEvents is not a function

Although i have fixed the flicker i get each time i click the nav menu to view the Smooth Scrolling effect!!

Can i recap on my last revisions please as i'm a little confused.

To clean up my code i renamed my .js files and put it in a folder called "js" I did the same with the Smooth Scroll (see below)
HOVER
  1. <SCRIPT src="js/mootools_hover.js" type="text/javascript"></SCRIPT>


SMOOTH SCROLL
  1. <SCRIPT src="js/mootools_scroll.js" type="text/javascript"></SCRIPT>


I'm confused as to what file goes in here? Which i feel might be the issue.
  1. <script language="JavaScript" type="text/javascript" src="js/mootools.js"></script>


See my revised code below
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3.     <head>
  4.      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5.  
  6.     <title>Ross</title>
  7.    
  8.     <link rel="stylesheet" href="index5a.css" type="text/css" />
  9.    
  10.     <script language="JavaScript" type="text/javascript" src="js/mootools.js"></script>
  11.  
  12.     <!--HOVER -->
  13.     <SCRIPT src="js/mootools_hover.js" type="text/javascript"></SCRIPT>
  14.    
  15.     <!--SMOOTH SCROLL -->
  16.     <SCRIPT src="js/mootools_scroll.js" type="text/javascript"></SCRIPT>
  17.  
  18.    
  19.     <!--SMOOTH SCROLL -->
  20.     <SCRIPT type="text/javascript" charset="utf-8">
  21.         window.onDomReady(function(){ new SmoothScroll({duration: 2800}); });
  22.     </script>
  23.    
  24.    
  25.    <!--HOVER -->
  26.     <SCRIPT type="text/javascript" charset="utf-8">
  27.     window.addEvent('domready', function() {
  28.    
  29.     // Create variables (in this case two arrays) representing our bubbles and pages
  30.     var myPages = $$('.page');
  31.     var myBubbles = $$('.bubble');
  32.    
  33.     // Set bubbles opacity to zero so they're hidden initially and toggle visibility on for their container
  34.     myBubbles.setStyle('opacity', 0);
  35.     $('bubbleWrap').setStyle('visibility','visible')
  36.    
  37.     // Add our events to the pages
  38.     myPages.each(function(el, i) {
  39.         el.set('morph', {link : 'cancel'});
  40.        
  41.         el.addEvents({
  42.             'mouseenter': function() {
  43.                 myBubbles[i].morph({
  44.                     'opacity' : 1,
  45.                     'margin-top' : '-0px'
  46.                 });
  47.             },
  48.             'mouseleave' : function() {
  49.                 myBubbles[i].morph({
  50.                     'opacity' : 0,
  51.                     'margin-top' : 0
  52.                 });
  53.             }  
  54.         });
  55.     });
  56.    
  57. });
  58.  
  59. </SCRIPT>
  60.      
  61. </head>
  62. <body>
  63.  
  64. </body>
  65. </html>
rossnaumov
 
Posts: 11
Joined: Fri Nov 06, 2009 8:11 am

Next

Return to Solutions

Who is online

Users browsing this forum: No registered users and 1 guest