Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member solidgold's Avatar
    Join Date
    Jun 2006
    Posts
    766
    Member #
    13373
    I have been trying to learn how to make my own scriptaculous effects, but with limited success, can anybody tell me how i can make this bit of code work?

    HTML Code:
    <html>
    <head>
    <title> Test Page </title>
    <script src="/javascripts/prototype.js?1206204823" type="text/javascript"></script>
    <script src="/javascripts/effects.js?1206204823" type="text/javascript"></script>
    <script src="/javascripts/dragdrop.js?1206204823" type="text/javascript"></script>
    <script src="/javascripts/controls.js?1206204824" type="text/javascript"></script>
    <script src="/javascripts/application.js?1206204824" type="text/javascript"></script>
    <script>
    Effect.Alert = Class.create();
      Object.extend(Object.extend(Effect.Alert.prototype, Effect.Base.prototype), {
        initialize: function (){
    alert ("This is a Javascript Alert");
    	}});
    </script>
    </head>
    <body>
    
    
    	<input type="button" onclick="Effect.Alert"/><br/> 
    
    </body>
    </html>
    I know that its only a very simple effect, but im just using it as a bit of practise before i make any real effects.

    thanks in advance,
    Solidgold

  2.  

  3. #2
    Senior Member solidgold's Avatar
    Join Date
    Jun 2006
    Posts
    766
    Member #
    13373
    i've read around a little bit and found some of the problems, but not all (as it still doesn't work) - here is an updated version of my code -

    HTML Code:
    <html>
    <head>
    <title> Test Page </title>
    <script src="/javascripts/prototype.js?1206204823" type="text/javascript"></script>
    <script src="/javascripts/effects.js?1206204823" type="text/javascript"></script>
    <script src="/javascripts/dragdrop.js?1206204823" type="text/javascript"></script>
    <script src="/javascripts/controls.js?1206204824" type="text/javascript"></script>
    <script src="/javascripts/application.js?1206204824" type="text/javascript"></script>
    <script>
    Effect.Alert = Class.create();
      Object.extend(Object.extend(Effect.Alert.prototype, Effect.Base.prototype)); {
        initialize: function Alert (){
    alert('it works');
    	}};
    </script>
    </head>
    <body>
    
    
    	<input type="button" id="button" onclick="Effect.Alert"/><br/> 
    </body>
    </html>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:06 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com