Make Header dissapear when full screen mode is detected in browser (F11) - javascript

For this type of question i think there is no need to show you my code, but in case there is a need to do so i will show my code.
Here is my question
Is there any way to make it so a part of my page disappears or hide it when the browser (IT, Firefox, Chrome, Opera, etc) is set to Full Screen ( Pressing F11)
I have set up an internal website where i show dashboards and they are displayed on big screens.
All i want is the page to detect if the browser is in full screen, if so i want to header (includes logo + Navigation Menu) to hide and reappear when the browser is exited from full screen mode.
EDIT: here is some sample code of the picture displayed below
/*---------------- Default styles---------------- */
* {
margin: auto;
outline: 0;
padding: 0;
border: 0;
text-decoration: none;
vertical-align: baseline;
}
html {
font-size: 75%;
}
body {
font-family: Verdana, Geneva, sans-serif;
font-size: 1rem;
background-color: #f7f7f7;
width: 100%;
overflow-y: scroll;
}
/*----------------Header Styles----------------*/
header {
width: 80%;
text-align: center;
}
header img {
padding-top: 3%;
padding-bottom: 3%;
}
/*------------------SUB MENU STYLE-----------------*/
#wrapper {
width: 100%;
margin: 20% auto;
text-align: left;
}
#nav ul {
background-color: #ffd800;
list-style-type: none;
padding: 0;
margin: 0;
}
#nav ul li {
display: inline-block;
}
#nav ul li:hover {
background-color: #6FC4D5;
/*Borders*/
border-radius: 5%;
-moz-border-radius: 5%;
-webkit-border-radius: 5%;
border: 0px solid #000;
}
#nav ul li a,
visited {
display: block;
padding: 15px;
color: #000;
font-weight: bold;
text-decoration: none;
}
#nav ul li:hover > ul {
display: block;
}
#nav ul ul {
display: none;
position: absolute;
background-color: #e8e4e4;
min-width: fill-available;
}
#nav ul ul li {
display: block;
}
#nav ul ul li:hover {
background-color: #6FC4D5;
}
#nav ul li:hover ul li a,
visited {
color: Black;
font-weight: 500;
}
#nav ul ul li:hover > ul {
display: block;
}
#nav ul ul ul {
margin-top: -21%;
width: 100%;
margin-left: 100%;
background-color: #e8e4e4;
}
/* Dropdown Menu Arrow */
#nav ul li > a:after {
color: #000;
font-style: normal;
content: '▾';
}
#nav ul li > a:hover:after {
color: #444;
content: '▸';
}
#nav ul li > a:only-child:after {
content: ' ';
}
#nav ul li ul li > a:after {
color: #000;
font-style: normal;
content: '▸';
}
#nav ul li ul li > a:hover:after {
color: #444;
content: '▾';
}
#nav ul li ul li > a:only-child:after {
content: ' ';
}
/*----------------Article Style----------------*/
article {
width: 80%;
margin-top: 0%;
margin-bottom: 5%;
text-align: center;
}
#hr h1 {
padding-top: 0%;
padding-bottom: 0;
}
article h1 {
margin-top: 5%;
font-size: 2em;
text-align: center;
}
article p {
width: auto;
text-align: left;
font-size: 100%;
margin: 3% 0%;
padding: 0% 10% 0% 10%;
}
article p img {
margin: 1% 5%;
padding-left: 19.5%;
padding-right: 19.5%;
width: 50%;
}
/*----------------PDF File view----------------*/
object {
padding-top: 5%;
width: 60%;
height: 1070px;
}
#pdfsideview embed {
padding-top: 5%;
width: 65%;
height: 730px;
}
iframe {
width: 100%;
height: 1070px;
}
caption {
padding: 5% 0% 5% 0%;
font-size: 2rem;
font-weight: bold;
}
table {
width: 70%;
border-collapse: collapse;
border-spacing: 0;
}
#dialing table {
width: 100%;
}
table,
th,
td {
border-collapse: collapse;
border-spacing: 0;
}
th {
height: auto;
text-align: left;
}
th,
th:hover {
background-color: #f7f7f7;
}
td {
text-align: left;
height: auto;
}
tr:hover {
background-color: #6FC4D5;
/*Borders*/
border-radius: 3%;
-moz-border-radius: 3%;
-webkit-border-radius: 3%;
border: 0% solid #000;
width: auto;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" name="keywords" content="HTML, CSS, XML, XHTML, JavaScript" http-equiv="Content-type" content="text/html" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="../scripts/modernizr-1.5.js"></script>
</head>
<body>
<header style="width:100%; background-image: url(../../images/Header-Pic.png); background-position: right;background-repeat: no-repeat; background-size: 100% 100%">
<a href="../index.html">
<img src="../../images/wiki.png" alt="">
</a>
</header>
<div id="navWrapper">
<div id="nav">
<ul>
<!--HOME DROPDOWN MENU-->
<li>Home
</li>
<li>
<!--DIRECTORY MENU-->
Directory
<ul>
<li> Email Hierarchy
</li>
<li>Dialing Codes
</li>
<li>Phone Directory
</li>
</ul>
</li>
<li>
<!--TIPS and HINTS MENU-->
Tips and Hints
<ul>
<!-- Arrage this sub menu in alphabetical order!!-->
<li>Tips and Hints
</li>
<li>Windows Keyboard Shortcuts
</li>
</ul>
</li>
<li>
<!--HR DROPDOWN MENU-->
HR
<ul>
<!-- Arrage this sub menu in alphabetical order!!-->
<!--<li>HR</li>-->
<li>Dress Code Policy
</li>
<li>Gym Reimbursement Program
</li>
<li>Holiday Schedule
</li>
<li>Time Off Policy
</li>
</ul>
</li>
<li>
<!--TUTORIALS DROP DOWN MENU-->
TURORIALS
<ul>
<!-- Arrage this sub menu in alphabetical order!!-->
<li>About this PAGE
</li>
<li>Clean Cookies and Cache
</li>
<li>Google Drive
</li>
<li>Find Computer Name
</li>
<li>Set up Network Printer
</li>
<li>VPN
</li>
</ul>
</li>
<li>
<!--DIRECTORY MENU-->
Dashboards
<ul>
<li>Call Center Calls Week Compare
</li>
<li>Call Center Dashboard
</li>
<li>Dashboard
</li>
<li>Sales Dashboard
</li>
</ul>
</li>
</ul>
</div>
</div>
<article>
<div id="dialing">
<table class="sortable">
<caption style="padding-top: 50px;">Dialing Codes</caption>
<tr>
<th>Feature</td>
<th>Code</td>
</tr>
<tr>
<td>All: Call Flow Toggle
</td>
<td>*28</td>
</tr>
<tr>
<td>All: Time Condition Override
</td>
<td>*27</td>
</tr>
<tr>
<td>Asterisk General Call Pickup
</td>
<td>*8</td>
</tr>
<tr>
<td>Call Forward All Activate
</td>
<td>*72</td>
</tr>
<tr>
<td>Call Forward All Deactivate
</td>
<td>*73</td>
</tr>
<tr>
<td>Call Forward All Prompting Activate
</td>
<td>*720</td>
</tr>
<tr>
<td>Call Forward All Prompting Deactivate
</td>
<td>*74</td>
</tr>
<tr>
<td>Call Forward Busy Activate
</td>
<td>*90</td>
</tr>
<tr>
<td>Call Forward Busy Deactivate
</td>
<td>*91</td>
</tr>
<tr>
<td>Call Forward Busy Prompting Activate
</td>
<td>*900</td>
</tr>
<tr>
<td>Call Forward Busy Prompting Deactivate
</td>
<td>*92</td>
</tr>
<tr>
<td>Call Forward No Answer/Unavailable Activate
</td>
<td>*52</td>
</tr>
<tr>
<td>Call Forward No Answer/Unavailable Deactivate
</td>
<td>*53</td>
</tr>
<tr>
<td>Call Forward No Answer/Unavailable Prompting Activate
</td>
<td>*520</td>
</tr>
<tr>
<td>Call Forward Toggle</td>
<td>*740</td>
</tr>
<tr>
<td>Call Waiting - Activate
</td>
<td>*70</td>
</tr>
<tr>
<td>Call Waiting - Deactivate
</td>
<td>*71</td>
</tr>
<tr>
<td>Camp-On Cancel</td>
<td>*83</td>
</tr>
<tr>
<td>Camp-On Request</td>
<td>*82</td>
</tr>
<tr>
<td>Camp-On Toggle</td>
<td>*84</td>
</tr>
<tr>
<td>ChanSpy</td>
<td>555</td>
</tr>
<tr>
<td>Check Recording</td>
<td>*99</td>
</tr>
<tr>
<td>Dial Voicemail</td>
<td>*98</td>
</tr>
<tr>
<td>Direct Dial Prefix</td>
<td>*</td>
</tr>
<tr>
<td>DND Activate</td>
<td>*78</td>
</tr>
<tr>
<td>DND Deactivate</td>
<td>*79</td>
</tr>
<tr>
<td>DND Toggle</td>
<td>*76</td>
</tr>
<tr>
<td>Email completed dictation
</td>
<td>*35</td>
</tr>
<tr>
<td>Findme Follow Toggle</td>
<td>*21</td>
</tr>
<tr>
<td>In-Call Asterisk Attended Transfer
</td>
<td>*2</td>
</tr>
<tr>
<td>In-Call Asterisk Toggle Call Recording
</td>
<td>##</td>
</tr>
<tr>
<td>Intercom prefix</td>
<td>*80</td>
</tr>
<tr>
<td>My Voicemail</td>
<td>*97</td>
</tr>
<tr>
<td>Park Prefix</td>
<td>*86</td>
</tr>
<tr>
<td>Perform dictation</td>
<td>*34</td>
</tr>
<tr>
<td>Phonebook dial-by-name directory
</td>
<td>411</td>
</tr>
<tr>
<td>Pickup ParkedCall Prefix
</td>
<td>*85</td>
</tr>
<tr>
<td>Queue Callers</td>
<td>*47</td>
</tr>
<tr>
<td>Save Recording</td>
<td>*77</td>
</tr>
<tr>
<td>Set user speed dial</td>
<td>*75</td>
</tr>
<tr>
<td>Speeddial prefix</td>
<td>*0</td>
</tr>
<tr>
<td>User Intercom Allow</td>
<td>*54</td>
</tr>
<tr>
<td>User Intercom Disallow</td>
<td>*55</td>
</tr>
<tr>
<td>ZapBarge</td>
<td>888</td>
</tr>
</table>
</div>
</article>
</body>
</html>
Below is an example of my webpage.

If only you hadn't mentioned Opera in your question, you could have achieved this with pure CSS, without needing any JavaScript, by using the :fullscreen pseudo class. Unfortunately, though Opera doesn't yet support it and IE only introduced it in v11. Check the full support table at caniuse.com.
Here's how you'd do it:
header:-moz-full-screen{
display:none;
}
header:-moz-fullscreen{
display:none;
}
header:-ms-fullscreen{
display:none;
}
header:-webkit-full-screen{
display:none;
}
header:-webkit-fullscreen{
display:none;
}
header:fullscreen{
display:none;
}

Using the Fullscreen API in web browsers
The user could, for instance, exit fullscreen, something that might be
good for you to know. For that we have a fullscreenchange event, that
you can apply both to the element that requested fullscreen, but also
to the document. Then we just detect the fullscreen state and take act
accordingly, like this:
document.addEventListener("fullscreenchange", function () {
fullscreenState.innerHTML = (document.fullscreen)? "" : "not ";
}, false);
document.addEventListener("mozfullscreenchange", function () {
fullscreenState.innerHTML = (document.mozFullScreen)? "" : "not ";
}, false);
document.addEventListener("webkitfullscreenchange", function () {
fullscreenState.innerHTML = (document.webkitIsFullScreen)? "" : "not ";
}, false);
document.addEventListener("msfullscreenchange", function () {
fullscreenState.innerHTML = (document.msFullscreenElement)? "" : "not ";
}, false);
SRC: http://robertnyman.com/2012/03/08/using-the-fullscreen-api-in-web-browsers/

Related

Dropdown within table (CSS/HTML/Java)

I appear to be having an issue where I would like to place a dropdown 'expandable' option within my table. I've attempted to do this with Javascript, but it always seems to just add information to the right hand column.
I'm not great at HTML/CSS and am very open to any advice on cleaning up my webpage.
I don't want it to seem like I am just asking for someone to do it for me, I have attempted to do it many times but to no avail.
The idea is to have my table have a little 'v' in the right corner of each cell in 'My Modules' which, when clicked, displays more information about the 'module' within the table. (This is what each entry looks like in my table):
Here's some code that will get you started, you can start by adding a click event to an element with the class .expand. When this is clicked then you can toggle a hidden paragraph. I'll let you experiment with this...
I'd advise working on the user experience a little, but the basic mechanics are there.
$( document ).ready(function() {
$(".expand").click( function () {
// Show .description if hidden, hide if currently showing
$(this).closest("td").find(".description").toggle();
// A little bit of styling to show the user the content has been expanded
if ( $(this).hasClass("blue-text") ) {
$(this).removeClass("blue-text");
} else {
$(this).addClass("blue-text");
}
});
});
.description {
display:none;
}
.blue-text {
color: blue;
}
table {
font-family: arial, sans-serif;
width: 100%;
background-color: rgba(0, 0, 0, 0);
padding-top: 50px
}
td,
th {
border: 1px solid rgb(200, 200, 200);
text-align: center;
padding: 8px;
}
th {
font-weight: normal;
background-color: rgba(222, 222, 222, 0.6)
}
.modules th {}
tr:hover {
background-color: rgba(20, 91, 130, 0.3)
}
}
.collapsible {
background-color: #777;
color: white;
cursor: pointer;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: 15px;
}
.active,
.collapsible:hover {
background-color: #555;
}
.content {
padding: 0 18px;
display: none;
overflow: hidden;
background-color: #f1f1f1;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table>
<tr>
<th>Module ID</th>
<th width="70%">Module</th>
<th>Credits</th>
<th>Semester</th>
</tr>
<tr>
<td>PHIL01</td>
<td class="breakrow">
<p>Introduction to CS <span class="expand">▼</span></p>
<p class="description">
Some extra info here.
</p>
</td>
<td>20</td>
<td>Winter</td>
</tr>
<tr>
<td>PHIL01</td>
<td class="breakrow">
<p>Introduction to Uni <span class="expand">▼</span></p>
<p class="description">
Some extra info here.
</p>
</td>
<td>20</td>
<td>Winter</td>
</tr>
<tr>
<td>PHIL01</td>
<td class="breakrow">Introduction to German</td>
<td>20</td>
<td>Winter</td>
</tr>
<tr>
<td>PHIL01</td>
<td class="breakrow">Introduction to Philosophy</td>
<td>20</td>
<td>Winter</td>
</tr>
<tr>
<td>PHIL01</td>
<td class="breakrow">Introduction to Philosophy</td>
<td>20</td>
<td>Winter</td>
</tr>
<tr>
<td>PHIL01</td>
<td class="breakrow">Introduction to Philosophy</td>
<td>20</td>
<td>Winter</td>
</tr>
</table>

insert objects from a list to table with jquery

I have a list of buttons and a table with 3 columns. I want to insert the values of the buttons in table columns with JQuery when the user clicks on a button. Is there any way for doing this with JQuery?
$(document).ready(function() {
var num;
$('#selction li a').click(function() {
num = $(this).text();
$('tr > td').text(num);
});
});
#selction{list-style: none;}
#selction li {display: inline-block;}
#selction li a {
display: block;
width: 20px;
height: 20px;
line-height: 20px;
margin: 5px;
text-align: center;
background: red;
cursor: pointer
}
.table-numbers {width: 100%;border-collapse: seprate;}
.table-numbers tr td {
width: 30%;
height: 30px;
border: 1px solid #000;
}
<div class="number-list">
<ul id="selction">
<li><a id="n1" data-id="n1" onclick="ButtonSelected('n1')" role="button">1</a></li>
<li><a id="n2" data-id="n2" onclick="ButtonSelected('n2')" role="button">2</a></li>
<li><a id="n3" data-id="n3" onclick="ButtonSelected('n3')" role="button">3</a></li>
<li><a id="n4" data-id="n4" onclick="ButtonSelected('n4')" role="button">4</a></li>
</ul>
<div class="clearfix"></div>
</div>
<table class="table-numbers">
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
I'm not sure what I suggest here is what you want to do... Since your question isn't really clear.
But I suppose that you want to add the text of a clicked link in the first empty cell of the table.
$(document).ready(function() {
var num;
$('#selction li a').click(function() {
num = $(this).text();
var emptyTDFound=false;
$('td').each(function(){
if($(this).text()=="" && !emptyTDFound){
$(this).text(num);
emptyTDFound=true;
}
});
});
});
#selction{list-style: none;}
#selction li {display: inline-block;}
#selction li a {
display: block;
width: 20px;
height: 20px;
line-height: 20px;
margin: 5px;
text-align: center;
background: red;
cursor: pointer
}
.table-numbers {width: 100%;border-collapse: seprate;}
.table-numbers tr td {
width: 30%;
height: 30px;
border: 1px solid #000;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="number-list">
<ul id="selction">
<li><a id="n1" data-id="n1" role="button">1</a></li>
<li><a id="n2" data-id="n2" role="button">2</a></li>
<li><a id="n3" data-id="n3" role="button">3</a></li>
<li><a id="n4" data-id="n4" role="button">4</a></li>
</ul>
<div class="clearfix"></div>
</div>
<table class="table-numbers">
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>

Get image to overlay on top of table

I have a table of basketball stats and I have an image of a basketball court that will later contain a shot chart. It is initially hidden. I want the image to only appear when the user clicks a button. And the image should appear on top of the of table. (Most of the table will be behind the image)
I can't seem to manipulate the CSS or Jquery position to allow that to happen. Part of the problem is that I want the table itself to be centered (margin: 0px auto;)
I started a JSFiddle here: https://jsfiddle.net/Thread7/f7g9dtxt/ to work it out. If you click "Show Court" you will see what happens now. The image is at the bottom and to the left. Instead of the top and middle.
Code Below:
<button id='showimg'>
Show Court
</button>
<table class='mytable'>
<tr><th>Name</th><th>FGA</th><th>FGM</th><th>Rebounds</th><th>Fouls</th> </tr>
<tr><td>Michael Jordan</td><td>5</td><td>10</td><td>12</td><td>3</td></tr>
<tr><td>LeBron James</td><td>3</td><td>7</td><td>5</td><td>4</td></tr>
<tr><td>Kobe Bryant</td><td>1</td><td>8</td><td>7</td><td>3</td></tr>
<tr><td>Magic Johnson</td><td>6</td><td>11</td><td>3</td><td>3</td></tr>
<tr><td>Draymond Green</td><td>6</td><td>11</td><td>3</td><td>3</td></tr>
<tr><td>Zach Randolph</td><td>6</td><td>11</td><td>3</td><td>3</td></tr>
</table>
<img src='http://exchangedownloads.smarttech.com/public/content/2c/2c4cb6ee-579f-4404-b573-c554ba6bf7f4/previews/medium/0001.png' class='myimg' id='court'>
CSS:
.mytable {
margin: 0px auto;
}
.mytable td {
text-align: left;
border: solid;
padding: 5px;
margin: 0px;
}
.myimg {
display: none;
margin: 0px auto;
}
JQuery:
$("#showimg").click(function(e) {
$("#court").show();
});
You should wrap your table in element with relative position, than place the image (also in container with absolute position). That way you have better control over those elements. Check it out:
$("#showimg").click(function(e) {
$(".myimg").toggle();
});
.mytable {
margin: 0px auto;
}
.mytable td {
text-align: left;
border: solid;
padding: 5px;
margin: 0px;
}
.myimg {
display: none;
position: absolute;
top: 0;
width: 100%;
text-align: center;
}
.table_container {
position: relative;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button id='showimg'>
Show/Hide Court
</button>
<div class="table_container">
<table class='mytable'>
<tr>
<td>Michael</td>
<td>Jordan</td>
<td>5</td>
<td>10</td>
</tr>
<tr>
<td>LeBron</td>
<td>James</td>
<td>3</td>
<td>7</td>
</tr>
<tr>
<td>Kobe</td>
<td>Bryant</td>
<td>1</td>
<td>8</td>
</tr>
<tr>
<td>Magic</td>
<td>Johnson</td>
<td>6</td>
<td>11</td>
</tr>
</table>
<div class="myimg">
<img src='http://exchangedownloads.smarttech.com/public/content/2c/2c4cb6ee-579f-4404-b573-c554ba6bf7f4/previews/medium/0001.png' id='court' />
</div>
</div>
Also at updated fiddle
Try this: https://jsfiddle.net/f7g9dtxt/3/
$('.yourImage').toggle();
$("#showimg").click(function(e) {
$('.yourImage').toggle();
});
.mytable td {
text-align: left;
border: solid;
padding: 2px;
margin: 0px;
}
.mytable {
position: absolute;
z-index: 0;
}
.yourImage {
position: absolute;
z-index: 1;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button id='showimg'>
Show Court
</button>
<table class='mytable'>
<tr><td>Michael</td><td>Jordan</td><td>5</td><td>10</td></tr>
<tr><td>LeBron</td><td>James</td><td>3</td><td>7</td></tr>
<tr><td>Kobe</td><td>Bryant</td><td>1</td><td>8</td></tr>
<tr><td>Magic</td><td>Johnson</td><td>6</td><td>11</td></tr>
</table>
<span class="yourImage">
Put an img tag here!
</span>

how to give space between tr tag and divide by | in html

Hi in the below code how to give the space to two tr rows and i want to divide with this symbol.and background color should occupy the full table.first row no need this | i want to divide all the left side row with full | symbol and then right side td's
can any one help me
Expected output:
About Us | Latest News
Facilities Events
Doctors Gallery
Our Blogs Contact Us
html
<div id="slider1">
<footer>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>About Us</td>
<td>Latest News</td>
</tr>
<tr>
<td>Facilities</td>
<td>Events</td>
</tr>
<tr>
<td>Doctors</td>
<td>Gallery</td>
</tr>
<tr>
<td>Our Blogs</td>
<td>Contact Us</td>
</tr>
</table>
</footer>
</div>
css
#slider1 footer {
background-color:#00008B;
width:100%;
#footer tr {
position: relative;
list-style-type: none;
display: inline;
}
#footer tr:before {
content: " | ";
}
#footer td {
border: 1px dotted blue;
}
#footer tr.row2 td {
padding-top: 40px;
}
#footer tr:first-child:before {
content: none;
}
see this: http://jsfiddle.net/ze0587d0/
#slider1 footer {
width:100%;
}
#footer tr {
position: relative;
list-style-type: none;
display: inline;
}
#footer tr:before {
content: " | ";
}
#footer td {
border: 1px dotted blue;
}
#footer tr.row2 td {
padding-top: 40px;
}
#footer tr:first-child:before {
content: none;
}
td{
padding:5px;
}
.border-right{
border-right:1px solid #000;
}
<div id="slider1">
<footer>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class='border-right'>About Us</td>
<td>Latest News</td>
</tr>
<tr>
<td>Facilities</td>
<td>Events</td>
</tr>
<tr>
<td>Doctors</td>
<td>Gallery</td>
</tr>
<tr>
<td>Our Blogs</td>
<td>Contact Us</td>
</tr>
</table>
</footer>
</div>
just add a class for the first td, where you want | sign, and the css border-right:1px solid #000;
Edit:
According to the comment by OP,
If you want all td's having a saperation with |, see this: http://jsfiddle.net/ze0587d0/2/
you need to add a border-right to all tds which are first-child of tr,
tr td:first-child{
border-right:1px solid #000;
}
#slider1 footer {
width:100%;
}
#footer tr {
position: relative;
list-style-type: none;
display: inline;
}
#footer tr:before {
content: " | ";
}
#footer td {
border: 1px dotted blue;
}
#footer tr.row2 td {
padding-top: 40px;
}
#footer tr:first-child:before {
content: none;
}
tr td:first-child{
border-right:1px solid #000;
}
td{
padding:5px;
}
<div id="slider1">
<footer>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td >About Us</td>
<td>Latest News</td>
</tr>
<tr>
<td>Facilities</td>
<td>Events</td>
</tr>
<tr>
<td>Doctors</td>
<td>Gallery</td>
</tr>
<tr>
<td>Our Blogs</td>
<td>Contact Us</td>
</tr>
</table>
</footer>
</div>
I think this is what you are after...it uses your pseudo-element but positions it absolutely.
#slider1 footer {
background-color: #00008B;
width: 100%;
color: white;
}
#slider1 table {
table-layout: fixed;
}
#slider1 footer tr td {
padding: 0 1rem;
position: relative;
}
#slider1 footer tr:first-of-type td:first-child:after {
position: absolute;
right: 0;
content: "|";
}
<div id="slider1">
<footer>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>About Us</td>
<td>Latest News</td>
</tr>
<tr>
<td>Facilities</td>
<td>Events</td>
</tr>
<tr>
<td>Doctors</td>
<td>Gallery</td>
</tr>
<tr>
<td>Our Blogs</td>
<td>Contact Us</td>
</tr>
</table>
</footer>
</div>

Element OverLap: DropDown Menu not overlapping the contents, instead pushes them down

I have a drop Down Menu, which when clicked upon, pushes the content below it to make space for its items.
However I would like for the drop down to overlap the contents below without pushing it down.
I tried a couple of things but they didnt work including z-index:1; on the drop down list.
<td valign="top" class="navigationLink" style="width: 20%" >
<div class="reportDiv">
<h:outputLabel value="Report" rendered="#{welcomeBean.report}" class="reportMenu"/>
<ul class="reportUL" >
<li><h:link value="Project Wise Report" outcome="/webpages/ProjectWiseReport.xhtml" rendered="true" class="reportItems"/></li>
<li><h:link value="Employee Wise Report" outcome="/webpages/EmployeeWiseReport.xhtml" rendered="true" class="reportItems"/></li>
</ul>
</div>
</td>
This is the drop down. This forms one row of the table in which i have placed the contents of the webpage.
When i click on My Account label, the ul drops down and the height of the table's row increases and pushes the row below it down.
I would like for the drop down to overlap the next row contents. How should i do that?
Some more code below and above it
<div class="container">
<!-- this is where the webpages starts from. The below table is where the main contents are -->
<table border="0" cellpadding="2" style="width: 100%; ">
<tr style="background-color: #95D0CA;">
<!-- contains header of page -->
<td colspan="2">
</td>
</tr>
<tr style=" position: relative; z-index:1;">
<td colspan="2" valign="top">
<!-- THIS IS WHERE I HAVE ADDED A NEW TABLE TO CONTAIN THE MENU ITEMS. THE DROP DOWN IS A (td) OF THIS TABLE -->
<table border="0" cellspacing="2" cellpadding="2" class="templateBody" style="width: 100%;">
<tr >
<td>
<!-- other menu items -->
</td>
<!-- DROP DOWN -->
<td valign="top" class="navigationLink" style="width: 20%" >
<div class="reportDiv">
<h:outputLabel value="Report" rendered="#{welcomeBean.report}" class="reportMenu"/>
<ul class="reportUL" >
<li><h:link value="Project Wise Report" outcome="/webpages/ProjectWiseReport.xhtml" rendered="true" class="reportItems"/></li>
<li><h:link value="Employee Wise Report" outcome="/webpages/EmployeeWiseReport.xhtml" rendered="true" class="reportItems"/></li>
</ul>
</div>
</td>
</tr>
</table>
</td>
</tr>
<!-- NOW the Row which gets pushed down appears -->
<tr>
<td colspan="2" valign="top" style="width: 100%">
<div class="contentBody">
</div>
</td>
</tr>
</table>
</div>
I will show some snaps of how it looks. This might guide you guys to understand my problem.
Below an image of before drop down expands:
!(http://imgur.com/QauRGVc)
image after drop down expands:
!(http://imgur.com/VMlcCbp)
I have tried using jsFiddle as many of you suggested, but it wasnt showing my code as it is. So that was not serving the purpose. I hope this edit helps.
Please Help me. And do let me know if you need additional codes.
** Thank You in Advance :)**
**Edit**
Adding CSS and JAVA SCRIPT CODES
CSS CODE for the code i have provided
.navigationLink a
{
background-color: #95D0CA;
margin-top: 5px;
margin-bottom: 5px;
}
.navigationLink label
{
background-color: #95D0CA;
margin-top: 5px;
margin-bottom: 5px;
}
.reportMenu
{
text-decoration: none;
color: #216961;
font-weight: bold;
font-size: 15px;
display: block;
padding: 10px 5px 10px 5px;
text-align: center;
cursor: pointer;
}
.reportItems
{
color: white;
text-decoration: none;
font-weight: 400;
font-size: 15px;
padding: 10px;
background-color: #95D0CA;
text-align: center;
}
.container
{
width: 1000px;
background-color: whitesmoke;
padding: 10px;
margin: 50px auto;
position: relative;
}
.templateBody
{
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
width: auto;
}
.templateBody td
{
text-align:center;
}
.contentBody
{
background-color: whitesmoke;
margin: 10px 0px 10px 0px;
width: 100%;
position: relative;
clear: both;
}
.reportUL
{
list-style-type: none;
position: absolute;
z-index: 1;
padding: 0;
margin: 0;
text-align: left;
}
.reportUL li
{
background-color: #95D0CA;
}
JQUERY CODE
$(document).ready(function()
{
$(".img, #img").show();
$("#loginWindow").hide();
$("#loginSlide").show();
$(".reportItems").hide();
$(".reportItems1").hide();
$("#loginSlide").click(function()
{
$("#loginWindow").slideToggle(200);
});
$(".toDate").datepicker();
$(".fromDate").datepicker();
$( "#accordion" ).accordion({
collapsible: true
});
$(".reportDiv").hover(function()
{
$(".reportItems").slideToggle(150);
});
$(".accountDiv").hover(function()
{
$(".reportItems1").slideToggle(150);
});
$(".mainLinks, .reportMenu, .reportItems, .reportMenu1, .reportItems1 ").hover(function()
{
$(this).css({"text-shadow":"0px 0px 5px #FFFFFF"});
}, function(){
$(this).css("text-shadow","none");
});
});
Take a look at following fiddles.
These are some nice drop down menu's you can build
Fidde 1
Fiddle 2
I just need to add the following CSS properties to the class reportUL of the the
un-ordered list (ul) i used to add the drop down menu:
the property required to overlap the drop down on the contents below is:
position: absolute;
and to make it show above / on top of the below content i used:
z-index: 1;
the complete and correct CSS for the class is:
.reportUL
{
list-style-type: none;
position: absolute;
z-index: 1;
padding: 0;
margin: 0;
text-align: left;
}

Categories