Results 1 to 4 of 4

Thread: FrogJS help

  1. #1
    Join Date
    Feb 2008
    Location
    Spring Branch, TX
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default FrogJS help

    1) Script Title: FrogJS

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ogjs/index.htm

    3) Describe problem: I've been messing around with this script for hours tonight and I have no clue what I may or may not be doing wrong. I apologize for the "newbie" question/issue. I'm using Dreamweaver and I have the page done except for the slideshow script that I want to insert. I followed the steps but then realized that I need to copy all the documents from the script onto my website assets :P. I've figured out where to place frog, prototype, and scriptaculous ("assests" under scripts). Not sure about builder, controls, dragdrop, etc. Do they all need to be in the assests folder with the rest of the scripts? I guess what I'm trying to get at...is how in the heck does the program know which files to run and when? Please don't flame me for trying to learn a new hobby!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,027
    Thanks
    44
    Thanked 3,210 Times in 3,172 Posts
    Blog Entries
    12

    Default

    These scripts, if you are following the installation from the archive, go in a folder named scripts off of the folder in which the page with the gallery is.

    That's actually a pretty good question. And, as far as I can tell, Frog Gallery only requires:

    prototype.js
    scriptaculous.js
    effects.js
    frog.js

    I deleted the rest from my local installation, and the script still worked. The only one of those that isn't linked directly to the page is effects, and it is linked to by:

    Code:
    <script type="text/javascript" src="scripts/scriptaculous.js?load=effects"></script>
    Which tells scriptaculous to load that one. It does so using this code:

    Code:
    var Scriptaculous = {
      Version: '1.7.0',
      require: function(libraryName) {
        // inserting via DOM fails in Safari 2.0, so brute force approach
        document.write('<script type="text/javascript" src="'+libraryName+'"></script>');
      },
      load: function() {
        if((typeof Prototype=='undefined') || 
           (typeof Element == 'undefined') || 
           (typeof Element.Methods=='undefined') ||
           parseFloat(Prototype.Version.split(".")[0] + "." +
                      Prototype.Version.split(".")[1]) < 1.5)
           throw("script.aculo.us requires the Prototype JavaScript framework >= 1.5.0");
        
        $A(document.getElementsByTagName("script")).findAll( function(s) {
          return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/))
        }).each( function(s) {
          var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,'');
          var includes = s.src.match(/\?.*load=([a-z,]*)/);
          (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider').split(',').each(
           function(include) { Scriptaculous.require(path+include+'.js') });
        });
      }
    }
    
    Scriptaculous.load();
    Which basically just writes out the tag:

    Code:
    <script type="text/javascript" src="path/effects.js"></script>
    where path/ is the same path as to scriptaculous.

    I believe that the others are included in the distribution because, if you skip:

    ?load=effects

    it will look for all of them and possibly throw an error if one or more are not found.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Feb 2008
    Location
    Spring Branch, TX
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You are too awesome!! I had figured out that somewhere along all the lines of code, it would know what to do from one point to another. I stayed up until 1:30 last night referencing between 2 books. If I had put this much effort while I was in school, I'd be a millionaire!

  4. #4
    Join Date
    Feb 2008
    Location
    Spring Branch, TX
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Doing the Happy Dance!!!! Got it figured out and it works beautifully!!! I was up way too late last night and if I hadn't been so sleep deprived I would have noticed that I had the wrong path names!! Duh!!! Thank you for such a great site!!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •