WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] JQuery carousel not working in Firefox (4 posts)

  1. CJSeraphin
    Member
    Posted 1 year ago #

    I have a JQuery carousel on one of my Pinboard template pages (http://catherineseraphin.com/photography/), and I just found out it's not working in Firefox (even after downloading the new version). I haven't tested it yet on IE, but I wanted to see if anyone knew if there was a way to fix the slideshow so that it works on Firefox? I have Google Chrome and have no issues going through it, but on Firefox, it's just a flat image that does nothing when you click on it. I just have the shortcode in the page editor, nothing fancy. Anyone have any idea on how to fix this? I'm very new at this, so I have no idea where to begin! Thanks in advance for your time.

  2. wpismypuppet
    Member
    Posted 1 year ago #

    There is an error is the JavaScript file. There is a file called jic.js, and on line 124 there is a called for event.preventDefault(), however event is not defined. Here is the snippet:

    $(".jic_next").click( function() {
    event.preventDefault();
    jQueryImageCarousel.next();
    });

    and it should look like this:

    $(".jic_next").click( function(event) {
    event.preventDefault();
    jQueryImageCarousel.next();
    });

    The reason it works in some browsers and not in other is in the way the browser handles JavaScript. Apparently Chrome can figure out the issue... Firefox is a little more strict. In either event, the code is wrong and should be corrected.

    Also, looking through that same JavaScript file, there are multiple occurrences of this same problem. So just fixing that one snippet isn't going to correct the error. You'll have to look for every occurrence of event.preventDefault() and make sure that the function call contains the variable event.

  3. CJSeraphin
    Member
    Posted 1 year ago #

    You, my friend, are a saint.

    Just in case anyone else looks this up, here are the three sections I had to change:

    $(".jic_next").click( function(event) {
    event.preventDefault();
    jQueryImageCarousel.next();

    $(".jic_previous").click( function(event) {
    event.preventDefault();
    jQueryImageCarousel.prev();

    $("#jquery_image_carousel li").click( function(event) {
    event.preventDefault();
    jQueryImageCarousel.next();

  4. wpismypuppet
    Member
    Posted 1 year ago #

    Glad I could help...

Topic Closed

This topic has been closed to new replies.

About this Topic