Safari Issue

11 messages Options
Embed this post
Permalink
quadrant

Safari Issue

Reply Threaded More More options
Print post
Permalink
Hi,

Here is the code I have in the head section.

<script type="text/javascript">
Shadowbox.init({
    // let's skip the automatic setup because we don't have any
    // properly configured link elements on the page
    skipSetup: true,
    // include the html player because we want to display some html content
    players: ["iframe"]
});

window.onload = function(){

    // open a welcome message as soon as the window loads
    Shadowbox.open({
        content:    url='menu.html',
        player:     "iframe",
        title:      "Please Select a Category",
        height:     350,
        width:      350
    });

};
</script>

Shadowbox automatically opens and loads an html page fine in IE and FF but not in Safari and I cannot work out why.

Any ideas anyone?

Thanks




Wizzud

Re: Safari Issue

Reply Threaded More More options
Print post
Permalink
Try this...
window.onload = function(){
    // open a welcome message as soon as the window loads
    window.setTimeout(function(){
      Shadowbox.open({
          content:    url='menu.html',
          player:     "iframe",
          title:      "Please Select a Category",
          height:     350,
          width:      350
        });
      }, 10);
};
Combine literacy with curiosity and a whole world of information opens up to you
quadrant

Re: Safari Issue

Reply Threaded More More options
Print post
Permalink
Hi Wizzud,

Thank you for you quick reply, but still no joy.

Any other ideas?

This is what I have in head:

<script type="text/javascript">
Shadowbox.init({
    // let's skip the automatic setup because we don't have any
    // properly configured link elements on the page
    skipSetup: true,
    // include the html player because we want to display some html content
    players: ["iframe"]
});

window.onload = function(){
    // open a welcome message as soon as the window loads
    window.setTimeout(function(){
      Shadowbox.open({
          content:    url='menu.html',
          player:     "iframe",
          title:      "Please Select a Category",
          height:     350,
          width:      350
        });
      }, 10);
};
</script>


Thanks
Wizzud

Re: Safari Issue

Reply Threaded More More options
Print post
Permalink
Sorry, I didn't look closely enough...

The 'content' property should be just the url, not "url=....", ie
content: 'menu.html',
Combine literacy with curiosity and a whole world of information opens up to you
quadrant

Re: Safari Issue

Reply Threaded More More options
Print post
Permalink
Hi Wizzud,

Unfortunately that didn't work either.

I have tried these:

<script type="text/javascript" src="shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.init({
    // let's skip the automatic setup because we don't have any
    // properly configured link elements on the page
    skipSetup: true,
    // include the html player because we want to display some html content
    players: ["iframe"]
});

window.onload = function(){

    // open a welcome message as soon as the window loads
    Shadowbox.open({
        content:    'menu.html',
        player:     "iframe",
        title:      "Please Select a Category",
        height:     350,
        width:      350
    });

};
</script>

-and this-

<script type="text/javascript" src="shadowbox.js"></script>

<script type="text/javascript">
Shadowbox.init({
    // let's skip the automatic setup because we don't have any
    // properly configured link elements on the page
    skipSetup: true,
    // include the html player because we want to display some html content
    players: ["iframe"]
});

window.onload = function(){
    // open a welcome message as soon as the window loads
    window.setTimeout(function(){
      Shadowbox.open({
          content:    'menu.html',
          player:     "iframe",
          title:      "Please Select a Category",
          height:     350,
          width:      350
        });
      }, 10);
};
</script>

Any ideas?

Thanks
Wizzud

Re: Safari Issue

Reply Threaded More More options
Print post
Permalink
Web-accessible example?
Combine literacy with curiosity and a whole world of information opens up to you
quadrant

Re: Safari Issue

Reply Threaded More More options
Print post
Permalink
Hi Wizzud,

Email of link sent.

Thanks
Wizzud

Re: Safari Issue

Reply Threaded More More options
Print post
Permalink
Okay, I don't know whether this is good news, bad news, or just no news ... because my Safari 4.0.3 on WinXP opens the welcome page fine!
Is there some different version of either Safari or Operating System that you're using that still doesn't open that welcome page?
You have a load of other problems, but opening the welcome page (currently using the setTimeout method) doesn't appear (to me) to be one of them. NB: I also tried IE 6/7/8, Chrome, Opera and Firefox (all on WinXP), and they all opened the welcome page fine.
Combine literacy with curiosity and a whole world of information opens up to you
quadrant

Re: Safari Issue

Reply Threaded More More options
Print post
Permalink
Hi Wizzud,

Thank you for taking a look.
I had a look in Safari 3.0.4 on Mac OSX 10.4.11 (which still doesn't work) but I guess if it's fine in v4 then that is good enough and anyway most people will be using IE or Firefox. I just wanted to make sure it is working OK before buying commercial license. It is strange though as the examples work on the shadowbox site when clicked. It is probably something to do with the window.onload = function(){ line but I cannot see what!

What other problems do you mean?
That page is normally a php page that sits in a different directory but it was the first page I came to so I just changed the extension to html so I could view it locally and copied the head code in so you could see it online. Hopefully this is what you mean. Perhaps you would be kind enough to let me know.

Would I be best switching back to me original code that came from the instructions? What would be most compatible across browser types?

Thanks
Wizzud

Re: Safari Issue

Reply Threaded More More options
Print post
Permalink
If it's an 'out-of-context' page then that probably explains the other problems, one of which was that clicking a menu option (on the 'welcome' page) navigated the frame content to a new page when it was possibly meant to navigate the main page to new content?

You can leave the setTimeout in place - it might prevent problems that can occur when the browser has not had sufficient time to insert Shadowbox's html into the DOM before being called upon to open something.
Combine literacy with curiosity and a whole world of information opens up to you
quadrant

Re: Safari Issue

Reply Threaded More More options
Print post
Permalink
Hi Wizzud,

Only two of the links have target="_top" set so the rest will load into the iframe. There are going to be about 40 links so I have only added a couple of working ones to test.

FYI. I have just tested in Safari 4.0.3 on Mac OSX 10.4.11 and it works fine, so it is just Safari 3 that the onload function does not work.

Thanks