0
Welcome Guest! Login
0 items Join Now

JavaScript/MooTools Question/Help?

    • bryantoth's Avatar
    • bryantoth
    • Jr. Rocketeer
    • Posts: 49
    • Thanks: 0

    JavaScript/MooTools Question/Help?

    Posted 14 years 8 months ago
    • I've managed to implement this feature into my website. On click it fades in the <div> and on another click it fades out the <div>

      However, it doesn't hide the <div> on pageload. Instead, I had to use css and "visibility: hidden;" to hide the <div> on page load. While this works it doesn't do the fancy fade when the visitor first clicks to show the <div>

      Essentially, I'm curious if anyone who is good with JavaScript /MooTools can help me hide the <div> on page load without using CSS and therefore get the fancy fade.

      Any help is appreciated.

      Here is the code and a link to the site/tutorial I'm using. ( http://davidwalsh.name/mootools-show-hide )
      //when the dom is ready...
      window.addEvent('domready', function() {
          //time to implement fancy show / hide
          Element.implement({
              //implement show
              fancyShow: function() {
                  this.fade('in');
              },
              //implement hide
              fancyHide: function() {
                  this.fade('out');
              }
          });
      });

      <p>
          <strong>Fancy: </strong><a href="javascript&#058;$('blove2').fancyShow();">Show</a> | <a href="javascript&#058;$('blove2').fancyHide();">Hide</a><br />
          <img src="/dw-content/beatles-love.jpg" id="blove2" />
      </p>
    • bryantoth's Avatar
    • bryantoth
    • Jr. Rocketeer
    • Posts: 49
    • Thanks: 0

    Re: JavaScript/MooTools Question/Help?

    Posted 14 years 8 months ago
    • Any thoughts?
      Anybody?
      :cheesy:
      :oops:

Time to create page: 0.080 seconds