Results 1 to 7 of 7

Thread: Script Conflicts - Suggestions Needed

  1. #1
    Join Date
    Sep 2008
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Script Conflicts - Suggestions Needed

    I am testing three scripts. They are:

    1. Typing Scroller
      http://www.dynamicdrive.com/dynamici...typescroll.htm

    2. Text and Image Crawler
      http://www.dynamicdrive.com/dynamici...wler/index.htm

    3. Lightbox image viewer
      http://www.dynamicdrive.com/dynamici...tbox/index.htm


    Individually they all work just fine.

    1. Text Crawler works on the same page with Typing Scroller
    2. Text Crawler works on the same page with Lightbox
    3. Typing Scroller and Lightbox don't work on the same page


    I'm looking for suggestions to resolve the conflict; specifically, what should I be looking for. I have done a quick look to see if there are any variables with the same name and don't see any.

    Also, I would consider myself a 2 on a scale from 1=newbie 5=wizard scale when it comes to JavaScript.

    Thanks for any suggestions. I'll be gone the rest of the day; so, I'm not being rude if I don't reply in the next 24 hours.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Upgrade the typing script to:

    http://www.dynamicdrive.com/dynamicindex10/text5.htm

    Or update the Lightbox script to:

    http://www.dynamicdrive.com/forums/s...70&postcount=1

    You can do either or both. The problem you have now is that each of the two conflicting scripts seek to take control of the page's onload event (window.onload, onload, or <body onLoad). Only one can, so the other will lose out and not be run. The reason that crawler works with either of these scripts is that it doesn't rely upon onload of the page in most cases, and when it needs onload of the page, it takes it in a way that never denies it to other scripts.

    Alternatively, since the lightbox script you are using attempts to see if there is already an onload, and if so tries to combine with it, you may be able to get away with simply moving the Lightbox script tag to after the typing script. But even if this works, it would leave you open to possible future onload conflicts with the typing script and perhaps the Lightbox one as well should yet other scripts requiring onload be added to the page. Best to stick with scripts that either don't require onload or if/when they do, take it in a way that doesn't deny it to other scripts that need it. The two substitute scripts I suggested do not take over onload. The newer typing script doesn't need it. The newer Lightbox one does, but does so in a way that doesn't deny it to others. The two newer scripts also have other advantages over each of their earlier counterparts.
    Last edited by jscheuer1; 03-09-2010 at 04:04 PM. Reason: accuracy, add info
    - John
    ________________________

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

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    RobertJ (03-09-2010)

  4. #3
    Join Date
    Sep 2008
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the explanation.

    I'll check out the typing script. In the case of the lightbox, it seems like over kill. What I liked about

    http://www.dynamicdrive.com/dynamici...tbox/index.htm

    was that it was simple. Popped up an overlay with transparent background with no window shade effects. I guess I'll have to look and see what it will take to dumb down

    http://www.dynamicdrive.com/forums/s...70&postcount=1

    Lot more js files - 6 versus 1.

  5. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Not sure what you mean by:

    Popped up an overlay with transparent background with no window shade effects
    But it sounds like you missed/skipped the semi-transparent .png image, changed something in the css, or have something going on with your page or browser, or perhaps something else that's removing that effect.

    If you like that Lightbox, you may use it. If you place it's script tag:

    Code:
    <script type="text/javascript" src="lightbox.js"></script>
    </body>
    as the last thing before your closing body tag as shown above, things should work out, no other changes, not even to the typing script you are using should be required. But, as I was saying, this just postpones likely future conflicts to a time when you may add more scripts that try to take sole control over the onload event.

    However, it would be a solution to the current problem.
    - John
    ________________________

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

  6. #5
    Join Date
    Sep 2008
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Popped up an overlay with transparent background with no window shade effects
    But it sounds like you missed/skipped the semi-transparent .png image,
    Actually what I called transparent background is what you are calling semi-transparent.

    Thanks again.

  7. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well you can still try the moving the Lightbox script tag as indicated in my previous post. The use or lack thereof of the semi-transparent .png makes no difference to that advice.
    - John
    ________________________

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

  8. #7
    Join Date
    Sep 2008
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I've got that on my list. In the meantime I'm exploring the more complex and feature rich script. I found the config section so I can make it as "dumb" as I want.

    So, for now I'm exploring what each of the js files do.


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
  •