+ Reply to Thread
Results 1 to 4 of 4

Thread: layering issues with login box...

  1. #1
    vrufusx65v's Avatar
    vrufusx65v is offline x10Hosting Member vrufusx65v is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    Dublin, Ireland
    Posts
    74

    layering issues with login box...

    NOTE: I coded this site through Google Chrome, i have not made any additions yet to correctly view it in ANY other browser, so please use Google Chrome to view my page to understand my problem...

    SITE REFERENCE: LINK

    I have a login box that is hidden except for the login/logout button. When clicked, javascript animates the login/logout box down (or up if clicked again) with the following JS code:

    Code:
    $(document).ready(function() {
    	$("div.panel_button").click(function(){
    		$("div#panel").animate({
    			height: "180px"
    		})
    		.animate({
    			height: "180px"
    		}, "fast");
    		$("div.panel_button").toggle();
    	
    	});	
    	
       $("div#hide_button").click(function(){
    		$("div#panel").animate({
    			height: "0px"
    		}, "slow");
    		
    	
       });	
    	
    });
    the problem is that the box and button is not layering over my main content area, it pushes the whole content area down. you can see what i mean by going HERE. I want the button and the box itself to be layered over the white content area instead of it just pushing the entire white content area down...

    here's some CSS that will hopefully help, its the entire login box + button:

    Code:
    #login-container{
    	float:right;
        margin-top:-2px;
        margin-right:148px;
        width:305px;
        text-align:center;
    }
    #toppanel {
    	float:right;
        top:33px;
        width: 305px;
        z-index: 25;
        text-align: center;
        margin-right:0px;
    }
    #panel {
        width: 500px;
        position: relative;
        top: 1px;
        height: 0px;
    	float:right;
        margin-left:px;
        margin-right:px;
        z-index: 10;
        overflow: hidden;
        text-align: left;
    }
    #panel_contents {
        background: none;
        filter:alpha(opacity=80);
        -moz-opacity:0.80;
        -khtml-opacity: 0.80;
        opacity: 0.80;
        height:350px;
        width:304px;
    	float:right;
    	margin-top:px;
    	margin-right:0px;
        z-index: -1;
    }
    
    .border {
        border: 15px #1d1d1d solid;
    	-moz-border-bottom-left-radius:30px;
    	-moz-border-bottom-right-radius:30px;
    	-webkit-border-bottom-left-radius:30px;
    	-webkit-border-bottom-right-radius:30px;
    	border-bottom-left-radius:30px;
    	border-bottom-right-radius:30px;
    }
    
    div#login {
    	float:right;
        width:240px;
        height:150px;
        right:150px;
        top:110px;
        background:#46392f;
        text-align:left;
    }
    
    div#logout {
    	float:right;
        width:240px;
        height:150px;
        right:150px;
        top:110px;
        background:#46392f;
        text-align:left;
    }
    
    /*
    div#login p {
    	float:left;
    	margin-top:30px;
    	margin-left:10px;
        color: #cccccc;
        font-family: Century Gothic, Georgia, "Times New Roman", Times, serif;
        line-height: 25px;
    }
    */
    
    #login_text {
    	color:#CCC;
    	font-family: 'myriadpro', Arial, Helvetica, sans-serif;
    	font-size:18px;
    	text-align:center;
    	float:left;
    	margin-top:10px;
    	margin-left:40px;
    }
    
    #logout_text {
    	color:#CCC;
    	font-family: 'myriadpro', Arial, Helvetica, sans-serif;
    	font-size:18px;
    	text-align:center;
    	float:left;
    	margin-top:10px;
    	margin-left:10px;
    }
    
    div#login input#username {
    	float:left;
    	margin-top:8px;
    	margin-left:60px;
    	background:#ccc;
    }
    
    div#login input#password {
    	float:left;
    	margin-top:4px;
    	margin-left:60px;
    	background:#ccc;
    }
    
    div#login input#login_btn {
        /*
    	border: 1px #899690 solid;
    	*/
    	font-family: 'myriadpro-bold', Trebuchet MS, Arial, Helvetica, sans-serif;
    	color:#FFF;
    	background-color: #000;
    	border-color: #000;
    	border-radius: 5px;
    	-moz-border-radius: 5px;
    	-webkit-border-radius: 5px;
        cursor: pointer;
    	float:left;
    	margin-top:10px;
    	margin-left:95px;
        /*
    	position: relative;
        top: 20px;
        left: 86px;
    	*/
    }
    
    #logout_btn {
        /*
    	border: 1px #899690 solid;
    	
    	font-family: 'myriadpro-bold', Trebuchet MS, Arial, Helvetica, sans-serif;
    	color:#FFF;
    	background-color: #000;
    	*/
    	background-image:url(../images/logout.png);
    	width:59px;
    	height:20px;
    	/*
    	border-color: #000;
    	border-radius: 5px;
    	-moz-border-radius: 5px;
    	-webkit-border-radius: 5px;
    	*/
        cursor: pointer;
    	float:left;
    	margin-top:25px;
    	margin-left:90px;
        /*
    	position: relative;
        top: 20px;
        left: 86px;
    	*/
    }
    
    .panel_button {
    	float:right;
        margin-right:60px;
        margin-top:px;
        position: relative;
        top: 1px;
        width: 173px;
        height: 54px;
    	background-image:url(../images/panel_button.png);
        z-index: 20;
        filter:alpha(opacity=70);
        -moz-opacity:0.70;
        -khtml-opacity: 0.70;
        opacity: 0.70;
        cursor: pointer;
    }
    
    .panel_button a {
        text-decoration: none;
        color: #545454;
        font-size: 20px;
        font-weight: bold;
        position: relative;
        top: 0px;
        left: 4px;
        font-family: Arial, Helvetica, sans-serif;
    }
    
    .panel_button a:hover {
    color: #999999;
    }
    
    .panel_button img{
    position: relative;
    top: 10px;
    border: none;
    }
    
    #profile {
    	color:#CCC;
    	font-family: 'myriadpro', Arial, Helvetica, sans-serif;
    	font-size:18px;
    	text-align:center;
    	float:left;
    	margin-top:15px;
    	margin-left:25px;
    }
    
    #profile a:hover {
    	color:#FFF;
    }
    
    #notifications {
    	color:#CCC;
    	font-family: 'myriadpro', Arial, Helvetica, sans-serif;
    	font-size:18px;
    	text-align:center;
    	float:left;
    	margin-top:35px;
    	margin-left:-76px;
    }
    
    #notifications a:hover {
    	color:#FFF;
    }
    and here's the HTML for my entire login box + Button:

    Code:
    <div id="login-container">
        	<div id="toppanel">
            	<div id="panel">
                	<div id="panel_contents">
                    <?php if ($user->data['user_id'] == ANONYMOUS) { ?>
                    	<div class="border" id="login">
                        <div id="login_text">Login to SS Studios:</div>
                            <form id="login_form" action="index.php" method="post">
                            	<input type="hidden" name="remember" value="TRUE" />
                            	<input type="text" size="15" name="username" id="username" onClick="if(this.value == 'Username')
                    			this.value='';" onBlur="if(this.value.length == 0) this.value='Username';" value="Username" /><br />
                            	<input type="password" size="15" name="password" id="password" onClick="if(this.value == 'password')
                    			this.value='';" onBlur="if(this.value.length == 0) this.value='password';" value="password" /><br />
                            	<input type="submit" accesskey="1" id="login_btn" name="login" value="Login" />
                            </form>
                        </div><!-- End Login -->
                    <?php
    					}
    					else {
                    ?>
                    	<div class="border" id="logout">
    						<label id="logout_text">Welcome, <?php echo $user->data['username']; ?>!</label>
                            <a href="#" id="profile">My Profile</a>
                            <a href="#" id="notifications">Notifications</a>
                            <?php echo "<a href=\"index.php?mode=logout&redirect=\"../../index.php\"\" id=\"logout_btn\"></a>";?>
                        </div><!-- End Logout Border -->
                    <?php
    					}
    				?>
                    </div><!-- End Panel_Contents -->
                </div><!-- End Panel -->
                <div class="panel_button" style="visibility:visible">
                	<img src="images/expand.png" alt="expand"/>
                    <?php
    					if ($user->data['user_id'] == ANONYMOUS) {
    					echo('<a href="#">Login</a>');
    					}
    					else {
    					echo('<a href="#">Logout</a>');
    					}
    					?>
                    <!--<a href="#">Login Here</a>-->
                </div><!-- End Expand Button -->
                <div class="panel_button" id="hide_button" style="display:none;">
                	<img src="images/collapse.png" alt="collapse" />
                	<a href="#">Hide</a>
                </div><!-- End Collapse Button -->
            </div><!-- End toppanel -->
        </div><!-- End Login -->

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: layering issues with login box...

    The only boxes that are taken out of the normal flow are floats and absolutely and fixed positioned ones. Floats won't let you overlay, so you'll need to absolutely position the element you want to appear in front (e.g. #toppanel), and relatively position its parent.

    Safari should work as well as Chrome, since they both use the same browser engine. As long as you're coding for the standards, Opera should also work just as well, as will Firefox in almost all cases (it's Acid3 test is in the mid to high '90s, depending on whether you're using 3.6 or 4).
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: layering issues with login box...

    Your site acts the same in Safari, Chrome, Firefox and Opera (all for mac). I haven't tested IE, but I doubt it will work the same in IE because nothing ever does

    ~Callum
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

  4. #4
    vrufusx65v's Avatar
    vrufusx65v is offline x10Hosting Member vrufusx65v is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    Dublin, Ireland
    Posts
    74

    Re: layering issues with login box...

    great, i wasnt sure about browser compatibility cause last time i checked my site in firefox and safari [for windows] it wasnt the same as it was for chrome, that's the only reason why i placed the NOTE.

    I'll work on absolutely positioning the login box, but which boxes should i remove the floats on?...besides the toppanel box?

    ---------- Post added at 01:41 PM ---------- Previous post was at 01:38 PM ----------

    nevermind that last question, i got it firgured out... thanks

+ Reply to Thread

Similar Threads

  1. Login issues
    By taurus2010 in forum Free Hosting
    Replies: 2
    Last Post: 07-02-2010, 10:00 PM
  2. Login issues
    By afspadm in forum Free Hosting
    Replies: 3
    Last Post: 05-16-2010, 02:27 AM
  3. FTP Login issues
    By Marc351 in forum Free Hosting
    Replies: 2
    Last Post: 08-22-2008, 03:41 AM
  4. Login Issues
    By flippin_enry in forum Free Hosting
    Replies: 1
    Last Post: 07-08-2008, 08:15 PM
  5. Login issues...
    By Deadly.Serpent in forum Free Hosting
    Replies: 7
    Last Post: 09-27-2007, 05:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers