SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2012
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    shadow Box not working

    i have a site which uses shadow box to throw up additional content regarding a publication - well thats the theory at the moment it opens as a normal link in just plan text please advise below are the files.

    the css file and home page are attachedindex.txtstyles.txt js file on request as won't upload but its just the standard downloaded form http://www.shadowbox-js.com/download.html

    Any help would be much appreciated if you need anything else please let me know

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,078
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Hi,
    I had a look at the files you provided, but am a bit confused as to what you are trying to accomplish.
    If you could explain in a bit more details, I might be able to help.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2012
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi the page shows two images and on the click on these images i wish it to open up a shadow box with some more information regarding the image rather than use popups.

  4. #4
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,078
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    So, judging by your code, you are trying to open a separate page when the image is clicked and display that page in a shadow box.
    HTML Code:
    <a href="fhinfo.php" rel="shadowbox;width=500;height=350"><img src="images/fhrip.jpg" width="455" height="145" alt="Fullhouse"></a>
    Here is a quick how-to, on how to accomplish this.
    Hopefully you should be able to apply what I have done to solve your problem.
    1. Download shadowbox.js (http://www.shadowbox-js.com/download.html) making sure that you check the "External sites and pages" option
    2. Unpack the 'shadowbox-3.0.3' folder to your Desktop (for example)
    3. In the shadowbox folder you just unpacked, create two files 'a.html' and 'b.html'
    4. Copy the code listed below into the respective files
    5. Load up 'a.html' into your browser and click the link

    a.html
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>a.html</title>
        <link rel="stylesheet" type="text/css" href="shadowbox.css">
        <script type="text/javascript" src="shadowbox.js"></script>
        <script type="text/javascript">
          Shadowbox.init({});
        </script>
      </head>
      
      <body>
        <a rel="shadowbox;width=400;height=400" href="b.html">Click here to open 'b.html' in an iframe in a shadow box.</a>
      </body>
    </html>
    b.html
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>b.html</title>
        <link rel="stylesheet" type="text/css" href="shadowbox.css">
      </head>
    
      <body style="background:white; color:black; padding:0 20px;">
        <h1>My Heading</h1>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
          Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
          Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, 
          sunt in culpa qui officia deserunt mollit anim id est laborum.
        </p>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
          Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
          Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, 
          sunt in culpa qui officia deserunt mollit anim id est laborum.
        </p>
      </body>
    </html>
    You'll probably want to remove the inline CSS from the body tag. That was just for demonstration purposes.
    HTH

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2012
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks ive tried that :-


    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>PEP Publishing</title>
    
    <link href="css/styles.css" rel="stylesheet" type="text/css" />
    <!--script for popup box -->
        <link rel="stylesheet" type="text/css" href="/shadowbox/shadowbox.css">
        <script type="text/javascript" src="/shadowbox/shadowbox.js"></script>
        <script type="text/javascript">
          Shadowbox.init({});
        </script>
    </head>
    <body>
    
         <nav>
        <ul>
            <li><img src="images/logo.jpg" width="auto" height="65px"/></li>
            <li><a href="index.html">Home</a></li>
            <li><a href="contact.html" rel="shadowbow">Contact</a>
                <ul>
                    <li><a href="map.html">How To Find us</a></li>
                    <li><a href="story.html">Sell Us A Story</a></li>
                    <li><a href="contact.html">Email Us</a></li>
                    <li><a href="work.html">Work For PEP</a></li>
                </ul>
            </li>
            <li><a href="#">Magazines</a>
                <ul>
                    <li><a href="www.loveitmagazine.co.uk">LoveIt</a></li>
                    <li><a href="www.fullhousemagazine.co.uk">Full House!</a></li>
                </ul>
            </li>
            <li><a href="Advertise.html">Advertise</a></li>
        </ul>
    </nav>
    </style>
        
          <br />
          <br />
          <br />
          <br />
      <div id="main-content">
        <div id="left-column" >
          <br />
          <br />
          <br />
          <br />
          <br />
          <br />
          <br />
          <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr,  sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
          <p>At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr,  sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
        </div>
        <div id="right-column">
          <h2 id="features">Magazines</h2>
          <img src="images/magazine.jpg" width="220px" />
          
          <div class="featured">
            <div class="content">
              <a rel="shadowbox;width=500;height=350" href="loveit.html"><img src="images/loveitrip.jpg" width="455" height="145" alt="LoveIt"></a>
            </div>
          </div>
          <div class="featured">
            <div class="content">
              <a rel="shadowbox;width=500;height=350" href="fhinfo.html" ><img src="images/fhrip.jpg" width="455" height="145" alt="Fullhouse"></a>
            </div>
          </div>
        </div>
      </div>
    but still not working loads it in a new page..
    Last edited by spikeZ; Sep 18, 2012 at 03:18.

  6. #6
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,078
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Can you zip up all of the files you are using (shadowbox.js, shadowbox.css, the above file and the file you want to open in shadowbox) and put them somewhere where I can download and take a look at them.
    Then I'll be able to help you more.

  7. #7
    SitePoint Enthusiast
    Join Date
    Jul 2012
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yea you can grab them here - http://www.peppublishing.co.uk/pep.rar if you need anything else please say and thanks this has been driving me crazy

  8. #8
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,078
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Dude, that is just a folder of images.

  9. #9
    SitePoint Enthusiast
    Join Date
    Jul 2012
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its just finshed uploading sorry try again now should be the working folder (still under construction) its finished now

  10. #10
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,078
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    I had a look at your code.
    As far as I could see, there were various problems.

    1.) There were a couple of errors in the HTML
    2.) You were missing the file 'shadowbox.css'
    3.) You appear to be using an old version of shadowbox.js (from 2008)

    I have tidied up the HTML and linked it to the current shadowbox files.
    It now works how you want, namely that when you click on either of the magazine images, a page with more info opens (in an iframe) in shadowbox.

    If you send me a PM and let me know where I can mail the files to, I'll send you an email with the working example.

  11. #11
    SitePoint Enthusiast
    Join Date
    Jul 2012
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Pullo, thanks for the help ! works perfectly!


Bookmarks

Posting Permissions

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