Lightbox on top of video?

Discussion in 'JavaScript' started by papa_face, Apr 24, 2007.

Thread Status:
Not open for further replies.
  1. #1
    Hello,
    I have a script on my site at the moment.
    I have a script installed where you can click on an image and it will load the image in a lightbox.
    The problem I have is that I have flash videos on the page, and for some reason when the lightbox loads you can see them on top of it.
    How can I stop this?
     
    papa_face, Apr 24, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Probably you need to adjust the z-index of your lightbox or your flash.

    The specs define 7 painting layers. Starting from back to front, they are:

    1. The borders and background of the current stacking context
    2. Positioned descendants with negative z-index
    3. Nonpositioned block-level descendants with no z-index property defined -- paragraphs, tables, lists, and so on
    4. Floating descendants and their contents
    5. Nonpositioned inline content
    6. Positioned descendants with no z-index, z-index: auto, or z-index: 0
    7. Positioned descendants with z-index greater than 0

    Take a look at this page for more info: Overlapping and ZIndex
     
    ajsa52, Apr 24, 2007 IP
  3. papa_face

    papa_face Notable Member

    Messages:
    2,237
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    285
    #3
    I have no idea how to correct it lol. Do you think you could correct it for me?
    Or anyone for that matter.
     
    papa_face, Apr 24, 2007 IP
  4. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #4
    Try this: add the property z-index="999" to the element with your flash video (<object>, <embed>, or whatever). If that doesn't work, try with z-index="0"
     
    ajsa52, Apr 24, 2007 IP
  5. papa_face

    papa_face Notable Member

    Messages:
    2,237
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    285
    #5
    				<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>
    				<script type="text/javascript">
    				var s1 = new SWFObject("../player/flvplayer.swf","single","300","300","7");
    				s1.addParam("allowfullscreen","true");
    				s1.addVariable("file","/<?php echo $path; ?>");
    				s1.addVariable("image","preview.jpg");
    				s1.addVariable("bufferlength","15");
    				s1.write("player1");
    				</script>
    Code (markup):
    Thats the code I have for my player. Where would I put that z-index thing?
     
    papa_face, Apr 24, 2007 IP
  6. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #6
    I'm not sure because it's a dinamic object, but you can try adding a div outside your script with that z-index:

    
    <p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>
    <div z-index="0">
      <script type="text/javascript">
    	var s1 = new SWFObject("../player/flvplayer.swf","single","300","300","7");
    	s1.addParam("allowfullscreen","true");
    	s1.addVariable("file","/<?php echo $path; ?>");
    	s1.addVariable("image","preview.jpg");
    	s1.addVariable("bufferlength","15");
    	s1.write("player1");
      </script>
    </div>  
    
    Code (markup):
     
    ajsa52, Apr 24, 2007 IP
  7. papa_face

    papa_face Notable Member

    Messages:
    2,237
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    285
    #7
    Nope that didnt work :(
     
    papa_face, Apr 24, 2007 IP
  8. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #8
    Have you tried with "0" and "999" ?
     
    ajsa52, Apr 24, 2007 IP
  9. papa_face

    papa_face Notable Member

    Messages:
    2,237
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    285
    #9
    Yeah neither worked.
     
    papa_face, Apr 24, 2007 IP
  10. papa_face

    papa_face Notable Member

    Messages:
    2,237
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    285
    #10
    Not to worry anymore, i changed my lightbox script and it works now :D
     
    papa_face, Apr 24, 2007 IP
Thread Status:
Not open for further replies.