Shadowbox not working in FF or Chrome, but works fine in IE.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Shadowbox not working in FF or Chrome, but works fine in IE.

fujibob
Hello All,

I have the exact same code in my <HEAD> being rendered in IE, Chrome, and FF (all the lastest versions). However, IE is the only one that works, ironically.

Here is the code taken from each web browser's rendered markup at the client level:
    <script src="Scripts/jquery-1.9.0.min.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="include/shadowbox/shadowbox.css" />
    <script type="text/javascript" src="include/shadowbox/shadowbox.js"></script>

    <script type="text/javascript">
        Shadowbox.init({ skipSetup: true });
        window.onload = function () {
            Shadowbox.open({
                content: 'https://www.youtube.com/v/oFR4L6GegXA&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;autoplay=1&amp;modestbranding=1&amp;showinfo=0&amp;autohide=1&amp;color=white&amp;hd=1&amp;version=3',
                player: 'swf',
                title: 'Welcome to Our Website! Here is a video',
                width: 500
            });
        }
    </script>


As you can see, the code is very straight forward and nothing fancy. It looks great on IE. Nothing shows up at all in Chrome or FF although the exact same markup was rendered in each of those browsers (in regards to this snippet anyway). I even got nitty gritty and compared all three snippets in a compare tool and they are the same.

Does anyone have any idea as to why FF or Chrome would simply not show anything at all on their pages?
Reply | Threaded
Open this post in threaded view
|

Re: Shadowbox not working in FF or Chrome, but works fine in IE.

fujibob
Well hello there again everyone.

I found the issue! Like many things, it was my mistake.

I had inherited this code at this job and still am not 100% familiar with it. As it turns out, I looked further down in the page's markup and there was some conditional stuff that did an IE check and, if it was IE, it did "this".. anything else it did "that". One of the things it did in the case for anything other than IE was perform an onload() function which, seemingly, overwrites the shadowbox's onload() functionality. I am writing code now to take this into account. Hope it helps someone out there. Remember to look further down the page to see if anything takes over the onload() part of the page as was in my case.

Take care.