Jump to content

lightbox z-index not fully working...


Go to solution Solved by Guber-X,

Recommended Posts

okay, so I have gotten a lightbox effect working for when pictures are uploaded for a news post. the lightbox works and goes over the content from the main news DIV it is in, but if there are other news DIVs posted, they show up over the lightbox... it does the same thing between Chrome and FF. i have attached a PIC of the issue.post-59210-0-35778300-1364767229_thumb.png

 

here is the code that is involved with all of this...

 

CSS:

// This is the style script for the NEWS DIV
.main {
	display: block;
	min-height: 100%;
	width: 680px;
	font-size: 13px;
	text-indent: 1em;
	text-shadow: #000 1px 1px 3px;
	
	background: #494949; /* Background for Internet Explorer 9 and older browsers */
	background: -webkit-linear-gradient(bottom, #444, #555); /* Background for Chrome & Safari */
	background: -moz-linear-gradient(bottom, #444, #555); /* Background for Firefox */
	background: -o-linear-gradient(bottom, #444, #555); /* Background for Opera */
	background: -ms-linear-gradient(bottom, #444, #555); /* Background for Internet Explore 10+ */
	box-shadow: 5px 5px 5px #000;
	border: 2px solid #996600;
	border-radius: 15px;
	-moz-border-radius: 15px; /* FireFox */
	padding: 0 6px 6px 6px;
	margin: 0 0 20px 0;
	
	transition: 0.5s ease-in-out;
	-moz-transition: 0.5s ease-in-out; /* Firefox 4 */
	-webkit-transition: 0.5s ease-in-out; /* Safari and Chrome */
	-o-transition: 0.5s ease-in-out; /* Opera */
	position:relative;
	z-index:10;
}

// This is the style script for the LIGHTBOX
.black_overlay{ //the black transparent background
	display: none;
	position: fixed;
	top: 0%;
	left: 0%;
	width: 100%;
	height: 100%;
	background-color: black;
	z-index:998;
	-moz-opacity: 0.8;
	opacity: 0.8;
	filter: alpha(opacity=80);
}
.white_content { //the content to the lightbox
	display: none;
	position: fixed;
	border-radius: 6px;
	top: 50%;
	left: 50%;
	width: 800px;
	height: 800px;
	;
	margin-top: -400px;
	z-index:999;
}

 

 

heres the HTML/PHP involved:

$query = mysql_query('SELECT * FROM news ORDER BY id DESC LIMIT 10')
    or die('Query Failed: '.mysql_error());
while($row = mysql_fetch_array($query)){
	extract($row);
	$date = date('D M j, Y',strtotime($date));
	$new_id = $id;

	if($registered == 'yes' && $active == 'admin'){
		echo '<div class="panel right theme">';
		echo '<img src="images/gears.png" style="vertical-align: middle;"> Settings<br>';
		echo '<div class="admin_indent"><a href="#">Edit</a></div><div class="admin_indent"><a href="#">Delete</a></div>';
		echo '</div>';
	}
	echo '<div class="main">';
	echo '<div class="main-head"><a href="home.php?feed='.$id.'" target="_self">';
	echo $header .'</a> » <div class="ndate">'. $date .'</div>';
	echo '</div>';
	echo $news;
	if($upload=='true'){
		echo '<br />';
		echo '<div class="pic_slider">';
	        $photo_upload = mysql_query('SELECT * FROM m_photos WHERE post_id="'.$id.'"')
			or die('photo upload query failed: '.mysql_error());
		while($row = mysql_fetch_array($photo_upload)){
			extract($row);
			echo '<div class="inline" onclick="document.getElementById(\'light'.$id.'\').style.display=\'block\';document.getElementById(\'fade\').style.display=\'block\'"><img src="../ffyv2/files/thumb/'.$pic.'" height="200"/></div>';
			echo '<div id="light'.$id.'" class="white_content"><img class="images" src="../ffyv2/files/'.$pic.'" width="500" onclick="document.getElementById(\'light'.$id.'\').style.display=\'none\';document.getElementById(\'fade\').style.display=\'none\'"/></div>';
		}
		echo '<div id="fade" class="black_overlay"></div>';
		echo '</div>';
	}
Edited by Guber-X
Link to comment
https://forums.phpfreaks.com/topic/276360-lightbox-z-index-not-fully-working/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.