Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    Mar 2012
    Location
    Ontario, Canada
    Posts
    51
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Shadowbox load on page load

    Hello

    I have followed the instructions and can't seem to get this working on ANY brower. I have checked through firebug to find any errors and there are none. If I tried to use a hyperlink to open the shadow box - doesn't work.


    <link rel="stylesheet" type="text/css" href="shadowbox/shadowbox.css">
    <script type="text/javascript" src="shadowbox/shadowbox.js"></script>
    <script type="text/javascript">
    window.onload = function() {

    Shadowbox.init({
    player: ['HTML']
    });


    Shadowbox.open({
    content: 'images/Sympathy-card.jpg',
    player: "html",
    title: "Monsignor Raymond Hanna"

    });

    };
    </script>

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,732
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Are you sure you have spelled shadowbox correctly in your script? Javascript is case-sensitive.



    Quizmaster: Which king lost an eye at the Battle of Hastings in 1066?
    Contestant: Was it Nelson?

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New Coder
    Join Date
    Mar 2012
    Location
    Ontario, Canada
    Posts
    51
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Yep, everything is in lowercase. double and triple checked

  • #4
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    try changin

    Code:
    player: ['HTML']
    to

    Code:
    player: 'html'
    thats the only thing I don't see done the same way on http://www.shadowbox-js.com/usage.html

    also i think your images have to haev the rel='shadowbox" attribute so you could check for that as well

    alos did you chec k the net tab in firebug to make sure it's fetching the image images/Sympathy-card.jpg ? maybe it should be /images ?

    also content: looks to be literal content, so maybe

    Code:
    'images/Sympathy-card.jpg'

    should be :

    Code:
    '<img src="images/Sympathy-card.jpg" />'
    Last edited by DanInMa; 11-17-2012 at 07:23 PM.

  • #5
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Have you added rel="shadowbox" to your links and specified a height and width for non-image links?
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #6
    New Coder
    Join Date
    Mar 2012
    Location
    Ontario, Canada
    Posts
    51
    Thanks
    9
    Thanked 0 Times in 0 Posts
    I have set the parameters, unset the parameters, played with settings and the rel='shadowbox' doesn't work either.

    I followed the code the way the site states but still doesn't work

  • #7
    New Coder
    Join Date
    Mar 2012
    Location
    Ontario, Canada
    Posts
    51
    Thanks
    9
    Thanked 0 Times in 0 Posts
    if I try to do a click function and have the shadowbox appear - still doesn't work. I have checked the location of the files, spelling, etc

  • #8
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,732
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by chellert View Post
    Yep, everything is in lowercase. double and triple checked
    Well, it is obviously not.

    Shadowbox.init({
    player: ['HTML']
    });

    Shadowbox.open({

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #9
    New Coder
    Join Date
    Mar 2012
    Location
    Ontario, Canada
    Posts
    51
    Thanks
    9
    Thanked 0 Times in 0 Posts
    changed the letter S from capital to lower and back, still doesn't work

  • #10
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    "Shadowbox" is correct per the document page http://www.shadowbox-js.com/usage.html

  • #11
    New Coder
    Join Date
    Mar 2012
    Location
    Ontario, Canada
    Posts
    51
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Thanks everyone, I gave up on this - can't figure it out and decided to go another route. Thanks for your posts


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •