admin管理员组

文章数量:1428467

I cant make the shadowbox work...I have a static html page which has an image that acts as a link to open a swf in the shadowbox. however when I click on the image it opens the swf like any other image file in the browser. The Shadow box doesn't seem to work at all.

This is my html page. I am using shadowbox-build-3.0b. Its strange that this editor doesnt allow new users to use image tag in the html code in the editor. So i have changed mine to image.

<html>
  <head>   
 <script type="text/javascript" src="js/jquery.js"></script>
 <script type="text/javascript" src="shadowbox-build-3.0b/adapters/shadowbox-jquery.js"></script>
 <script type="text/javascript" src="shadowbox-build-3.0b/shadowbox.js"></script>
 <link   type="text/css"    href="shadowbox-build-3.0b/shadowbox.css" rel="stylesheet" media="screen">
 <script type="text/javascript" src="shadowbox-build-3.0b/languages/shadowbox-en.js"></script>
 <!-- Begin Shadowbox JS -->
 <script type="text/javascript">
  jQuery(document).ready(function () {
   Shadowbox.init({
    language:   "en",
    players:    ["image"]
   });

  });
 </script>
 <!-- End Shadowbox JS -->

  </head>
  <body>
  <a href="LightBoxFiller.swf" rel="shadowbox[Mixed];width: 800;height: 600;"><image src="imagewithplaybutton.jpg" ></a> 

  </body>
</html>

I cant make the shadowbox work...I have a static html page which has an image that acts as a link to open a swf in the shadowbox. however when I click on the image it opens the swf like any other image file in the browser. The Shadow box doesn't seem to work at all.

This is my html page. I am using shadowbox-build-3.0b. Its strange that this editor doesnt allow new users to use image tag in the html code in the editor. So i have changed mine to image.

<html>
  <head>   
 <script type="text/javascript" src="js/jquery.js"></script>
 <script type="text/javascript" src="shadowbox-build-3.0b/adapters/shadowbox-jquery.js"></script>
 <script type="text/javascript" src="shadowbox-build-3.0b/shadowbox.js"></script>
 <link   type="text/css"    href="shadowbox-build-3.0b/shadowbox.css" rel="stylesheet" media="screen">
 <script type="text/javascript" src="shadowbox-build-3.0b/languages/shadowbox-en.js"></script>
 <!-- Begin Shadowbox JS -->
 <script type="text/javascript">
  jQuery(document).ready(function () {
   Shadowbox.init({
    language:   "en",
    players:    ["image"]
   });

  });
 </script>
 <!-- End Shadowbox JS -->

  </head>
  <body>
  <a href="LightBoxFiller.swf" rel="shadowbox[Mixed];width: 800;height: 600;"><image src="imagewithplaybutton.jpg" ></a> 

  </body>
</html>
Share Improve this question edited Oct 2, 2013 at 11:20 Harry 89.9k26 gold badges214 silver badges223 bronze badges asked Sep 15, 2009 at 16:14 sdhjoshsdhjosh
Add a ment  | 

2 Answers 2

Reset to default 3

Hmm. I have not used shadowbox myself, but if you look at the way how the page suggests you set shadowbox up, there seems to be things that are wrong.

As i understand you want swf file to open when clicking on image; Shouldn't you set players: to swf then?

Your code also does not show if your img has link around it and if that link has rel="shadowbox" attribute.

I guess it should be set up something like this:

<script type="text/javascript">
Shadowbox.init({
    language:   "en",
    players:    ["swf"]
});
</script>
<a href="myflashfile.swf" rel="shadowbox"><img alrt="click here to open swf file" src="imgofflash.jpg"/></a>

Shadowbox.init() shouldn't be in the document.ready(). It should execute as the page loads.

本文标签: javascriptJquery and ShadowBoxStack Overflow