Lightbox script breaks sites other javascript in IE only

  • Profile Image
    draggindakota
    Asked on April 26, 2011 at 01:06 PM

    I'm having an issue with my Joomla based site. I have 2 pages setup with jotforms, a contact page and a design request page. Right now the pages are coded to call on a custom html module that contains the jotform lightbox code, but I've tried also including the code directly into the pages.

    Both pages work fine in FireFox, but I keep getting javascript errors in IE and the forms no longer pop up. The site template has a js based slideshow at the top that shows on every page, and this is where the errors are occuring. The pages with jotform code both give me the following errors (I've included the specific lines of code, commented out):

    'null' is null or not an object

    script.js

    Line 5 Char 1

    Code: 0

    URI: http://bsaengineering.net/templates/afw-201101/js/script.js

    <!-- $('label[for="search label"]').hide(); -->

     

    'null' is null or not an object

    script.js

    Line 5 Char 1

    Code: 0

    URI: http://bsaengineering.net/templates/afw-201101/js/script.js

    <!-- $('label[for="search label"]').hide(); -->

     

    'null' is null or not an object

    autoadvance.js

    Line 8 Char 2

    Code: 0

    URI: http://bsaengineering.net/templates/afw-201101/js/autoadvance.js

    <!-- $('#slideshow .arrow').click(function(e,simulated){ -->

     

    'null' is null or not an object

    slide_script.js

    Line 39 Char 3

    Code: 0

    URI: http://bsaengineering.net/templates/afw-201101/js/slide_script.js

    <!-- $('#slideshow .arrow').click(function(){ -->

  • Profile Image
    NeilVicente
    Answered on April 26, 2011 at 03:33 PM

    Hi,

    The error is caused by conflicting scripts in your page, namely the slideshow jquery plugin and Jotform's own script that is responsible for the Lightbox popup.

    The easiest workaround I can advise to you is to configure your slideshow to not show up on the page that has the lightbox popup. Replace the slideshow with a static image instead. I'm sure this is pretty much doable on Joomla.

    Alternatively, you might want to use a popup window instead of a lightbox.

    Hope this post is helpful to you. Let me know if you have further questions.


    Neil

  • Profile Image
    draggindakota
    Answered on April 27, 2011 at 09:08 AM

    Hi Neil,

    Thanks for taking a look. I was able to get rid of one of the conflicts by removing the script.js call, since it was not really needed. That got rid of all of the errors except on the autoadvance.js

     

    I could disable the autoadvance script on those pages, but I was hoping to find a workaround for IE so that I didn't.

  • Profile Image
    NeilVicente
    Answered on April 27, 2011 at 02:56 PM

    Hi,

    I apologize but there is no other workaround I could think of, especially for IE. I think it's a general consensus that IE is such a pain for webmaster and web developers alike. Like I said, a really nice trick is to use a static image (snapshot) of your slideshow, in pages where you have the lightbox enabled. I'm pretty sure your average visitor wouldn't notice it one bit, and if they do I guess they wouldn't mind.

    Anyway, good luck on your project and please let us know if there's anything else we can do to help you.

    Regards,
    Neil

  • Profile Image
    draggindakota
    Answered on April 28, 2011 at 08:56 AM

    Thanks Neil,

    I think I'm going to switch out the java slideshow for a simple flash one and see how it behaves. Worst case I'll just scrap the autoadvance of the slideshow.

  • Profile Image
    NeilVicente
    Answered on April 28, 2011 at 03:54 PM

    Yes a flash slideshow would be a great alternative I can't believe I haven't thought of that. There are many neat looking flash-based slideshow plugins that could probably rival javascript-based ones.

    Feel free to post again if you have other queries. Thank you.


    Neil