Results 1 to 6 of 6
  1. #1
    ABW Ambassador parentsworld's Avatar
    Join Date
    January 18th, 2005
    Location
    Calgary, Alberta, Canada
    Posts
    642
    Ok, there are supposed to be three errors here, but I'm not efficient enough in this to figure it out. I can use Script Builder to find the line with the error, but after that I'm lost.

    <pre class="ip-ubbcode-code-pre"> &lt;SCRIPT language="JavaScript"&gt;
    function getObjByName(name,doc) {
    if(!doc) doc = document;
    if(doc[name]) return doc[name];
    for(var i=0;i &lt; doc.layers.length;i+){
    var lyrdoc = doc.layers[i].document;
    if(lyrdoc[name]) return lyrdoc[name];
    if(lyrdoc.layers.length &gt; 0) {
    var obj = getObjByName(name, lyrdoc);
    if(obj) return obj;
    }
    }
    return 0;
    }

    function swapImg() {
    if(!document.image) return;
    var args = swapImg.arguments;
    for(var i = 0; i &lt; args.length; i+=2) {
    var imgSrc = (args[i + 1].indexOf('[') != -1) ? eval(args[i + 1] + ".src') : args[i + 1];
    if(getObjByName(args[i])) getObjByName(args[i]).src = imgSrc;
    }
    }
    &lt;/SCRIPT&gt; </pre>

    Anyone good enough to find the errors, AND explain them to me?

    'Veni, Vidi, Velcro' - I came, I saw, I stuck around

  2. #2
    ABW Veteran jc101's Avatar
    Join Date
    January 18th, 2005
    Location
    Santa Cruz, CA
    Posts
    4,597
    Hmm no thank you I hate Javascript.

    Jason

    Santa Cruz, CA 95060

  3. #3
    ABW Ambassador DesignerWiz's Avatar
    Join Date
    January 18th, 2005
    Location
    U.S.A
    Posts
    2,777
    Depending on what other codes are present can also contribute to errors. Here's a simple code that works great.

    A simple &lt;body&gt; tag image placement tag that goes exactly where image is to be placed:

    &lt;!-- Begin www.DesignerWiz.com Image Rollover --&gt;&lt;a href="http://Your URL" onMouseOver='rollover.src="Your 1st Image.gif"' onMouseOut='rollover.src="Your 2nd Image.gif"'&gt;
    &lt;img src="Your 2nd Image.gif" name="rollover" border="0" width="0" height="0" alt="Description Of Image Here"&gt;&lt;/a&gt;&lt;!-- End Image Rollover --&gt;

    DesignerWiz
    http://DesignerWiz.com

  4. #4
    Schlaumeier cumbrowski's Avatar
    Join Date
    January 18th, 2005
    Location
    Fresno/CA
    Posts
    640
    It would be helpful to know, what you want to accomplish with the script, before somebody tries to analyse, what that script might be good for.
    Some Sample HTML Code would be helpful too.

    DesignerWiz: I do not think, that he is looking for a simple mouseover effect. By the way. HTML Pages with Image Mouseover Effects should pre-load the images, to allow dial-up users to enjoy the beauty of "real-time" mouseovers as well.
    Keyword: Image Objects during loading of the page to utilize the Browser Cache.

    Carsten

    Shop-Links.net Partner
    http://www.shop-links.net

    If you can't move things, try harder!

  5. #5
    ABW Ambassador parentsworld's Avatar
    Join Date
    January 18th, 2005
    Location
    Calgary, Alberta, Canada
    Posts
    642
    Sorry guys, posted this a while back and found my errors already.

    Dumb things like in the fifth line it should be i++ and in the fifth from the bottom line there was a " and a ' where they should both have been the same.

    Just dumb errors, but I was too tired to find them that day. I walked away and the next day they were clear to me [img]/infopop/emoticons/icon_smile.gif[/img]

    Thanks, though.

    'Veni, Vidi, Velcro' - I came, I saw, I stuck around

  6. #6
    ABW Ambassador DesignerWiz's Avatar
    Join Date
    January 18th, 2005
    Location
    U.S.A
    Posts
    2,777
    We agree with you Carsten.

    Original quote:
    DesignerWiz: I do not think, that he is looking for a simple mouseover effect. By the way. HTML Pages with Image Mouseover Effects should pre-load the images, to allow dial-up users to enjoy the beauty of "real-time" mouseovers as well.
    Keyword: Image Objects during loading of the page to utilize the Browser Cache.

    We merely wanted to give some type of response. We assume we probably should have got more detailed in our response. But, we did not want people to assume we are using the forum to promote our free resource site in answers and URL's.

    On our free online image rollover code generator at our service we clearly address the pre-loading of images for instant image roll over effect.
    http://www.designerwiz.com/generator..._generator.htm

    DesignerWiz
    http://DesignerWiz.com

  7. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Problem with Rockler script
    By udpitt in forum Cusimano.com Scripts
    Replies: 1
    Last Post: June 4th, 2005, 02:28 PM
  2. linking script problem
    By kapsat in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: May 21st, 2004, 02:25 AM
  3. CSS/script menu problem
    By SpikeDo in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: September 17th, 2003, 08:00 AM

Posting Permissions

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