Dear all,

I'm not sure if this is a jQuery question or not, but I got the following code to work in FF, but it fails in Safari:

$(".thumb").click(function() {
    var imgName = $(this).attr("alt");
    var el = $("#dropdown");
    if (el.is(":visible") && $("#pic").attr("name") == imgName) return;
    else {
        el.fadeOut("slow", function() {
            $("#loading").show();

            el.find("#textContent")
            .text(pix[imgName].aText);

            el.find("#pic")
            .attr({"src": pix[imgName].imgSrc, "name": imgName})
            .load(function(){
                el.fadeIn("slow");
                $("#loading").hide();
            });
        });
    }
});

The if/else test was necessitated by the fact that if the user clicked on the same thumbnail image twice, the #dropdown element faded out and didn't fade back in.

In FF clicking on the same image twice makes no change, but in Safari, clicking on the same image twice makes no change IF #dropdown is visible, if #dropdown is NOT visible and the user clicks on the same thumbnail that was last clicked on, the loading gif displays but the #dropdown does not.

I'm sure this is just my own javascript inexperience, but can anyone suggest where I'm going wrong?

Thanks,
Jon

Reply via email to