Horizontal expanding and collapsing navigation menu

Is there a way to modify the expand menu bar so it expands from left to right or right to left, instead of top down? Any assistance would be greatly appreciated.

Existing Expand Menu Bar

<HTML>

<HEAD>
  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  <script language="JavaScript" src="/home/common/popup/popup.js"></script>
  <TITLE>headerFrame.jsp</TITLE>
</HEAD>

<BODY>
  <form name="mainfrm" method="post">


    <table width="100%" height="50%" border="1" bordercolor="#000000" cellspacing="0" cellpadding="0">
      <div style="position:relative;top:0;left:0;z-index:2;background-color:#F0F0F0;">
        <div id="demo" class="collapse in">
          <div class="div-table">testing content</div>
          <div class="div-table-row">testing content</div>
          <div class="div-table-col">testing content</div>
        </div>
        <a data-toggle="collapse" data-target="#demo" style="margin-left:50%;">
          <img src="http://www.oneequallmusick.org/frame/images/uparrow.png" width="25px" height="20px">
        </a>
      </div>

      <tr>
        <td width="15% " align="center">TOP FRAME</td>
        <td width="40% " align="left ">TOP FRAME</td>
        <td width="45% ">TOP FRAME</td>
      </tr>
    </table>
  </form>
</BODY>

</HTML>

Is there a way to modify the expand menu bar so it expands from left to right or right to left, instead of top down? Any assistance would be greatly appreciated.

Expected Result
--
<!-- begin snippet: js hide: false -->

Desired Outcome

When collapsed https://i.stack.imgur.com/NrN0Y.png

When expanded https://i.stack.imgur.com/VkYza.png

Answer №1

Implemented z-index attribute for td element:

<table width="100%" height="50%" id="tbl" border="1" bordercolor="#000000" cellspacing="0" cellpadding="0">

  <tr>
    <td width="15% " align="center">TOP FRAME</td>
    <td width="40% " align="left ">TOP FRAME</td>
    <td width="42% ">TOP FRAME</td>
    <td width="3%">
  <div>

      <img src="http://www.oneequallmusick.org/frame/images/uparrow.png" style="display:inline;" width="25px" height="20px" id="im1" onClick="javascript:document.getElementById('demo1').style.display='inline';document.getElementById('im1').style.display='none';document.getElementById('im2').style.display='inline';">
      <img src="http://www.oneequallmusick.org/frame/images/uparrow.png" style="display:none;" width="25px" height="20px" id="im2" onClick="javascript:document.getElementById('demo1').style.display='none';document.getElementById('im2').style.display='none';document.getElementById('im1').style.display='inline';">

  </div></td>  
  <td id="demo1" style="position:relative;z-index:-1;display:none;">
    <div id="demo" style="position:relative;background-color:#F0F0F0;" class="collapse in">
      <div class="div-table">testing content</div>
      <div class="div-table-row">testing content</div>
      <div class="div-table-col">testing content</div></div>        
</td></tr>       
</table>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Achieving priority for style.php over style.css

Having trouble with theme options overriding default CSS settings in style.css. Here's what I have in my header.php: <link rel='stylesheet' type='text/css' media='all' href="<?php bloginfo( 'stylesheet_url&apo ...

Utilizing JavaScript to implement conditional if-else statements on CSS properties

I am trying to implement conditions on CSS properties in JavaScript. What is the most efficient approach to achieve this? <html> <head> <title>TOOLTIP USING JAVASCRIPT</title> <style> span{ curso ...

Centering Text and Image in React Horizontally

I'm attempting to achieve a layout similar to the one shown in the image below. Currently, my image is positioned at the top with the text below it. I would like to arrange it so that the text appears on the right side of the image. Please take a loo ...

Conflicts between characters in MySQL, HTML, and PHP

I am encountering an issue while retrieving text from a database. The data is stored as "♦" in the database without any problems. However, when I retrieve the record from the database, it appears on the page as a regular question mark instead of the bla ...

Modify a CSS style with JavaScript or jQuery

Can CSS rules be overwritten using jQuery or JavaScript? Imagine a table with rows categorized by different classes - "names" for persons and "company" for companies. How can we efficiently hide or show specific rows based on these classes? If we have a ...

How come my label and input are showing up in my navigation bar?

For my assignment, I am designing a website layout and facing an issue where the text appears behind the navigation bar instead of below it. I have tried adjusting the margin-bottom to 50px with important tags and setting the nav bar as static. Despite tr ...

Refresh in AJAX, automated loading for seamless transition to a different page

Having an issue with the page not auto-refreshing, although it loads when I manually refresh. P.S Loading the page onto another page. Below is my HTML and AJAX code along with its database: The Trigger Button <?php $data = mysqli_query ...

Is SqliteDataReader not compatible with C#?

Currently, I am facing an issue with displaying data from a SQLite database on a web page using C#. Despite my efforts to find a solution and only coming across the console.writeline method, the SqliteDataReader function is not functioning properly. Below ...

The connected callback does not trigger when custom HTML elements are being created

Attempting to craft a custom HTML tag using JavaScript, I aimed to create the custom element with ES6 JavaScript syntax. The code devised for this task reads as follows: customElements.define('neo-element', NeoElement); function NeoElement (){ ...

What is the determined method for calculating the pixel size of an SVG image?

Did you know that the Stackoverflow logo is actually an <a> element with a SVG image as its background? #hlogo a { text-indent: -999em; display: block; width: 200px; height: 50px; background-image: url("img/sprites.png?v=c4222387 ...

Implementing dynamic CSS switching for right-to-left (RTL) support in a multilingual Next.js application

As I work on my multilanguage application with Next.js, I'm encountering a challenge in dynamically importing the RTL CSS file for Arabic language support. My aim is to seamlessly switch between RTL and LTR layouts based on the selected language. M ...

Having trouble with Angular JS's ngRoute feature not functioning properly

I've been struggling with my ngRoute implementation. I seem to be unable to load the 'ngRoute' module for some reason. Whenever I run this code, I just end up with a blank page. Below is my app.js file: var app = angular.module('tutor ...

JavaScript event/Rails app encounters surprising outcome

I have encountered a strange bug in my JavaScript code. When I translate the page to another language by clicking on "English | Русский" using simple I18n translation, my menu buttons stop working until I reload the page. I suspect that the issue ...

Understanding how to activate a React navbar button is essential for creating a seamless user

How can I make my sidebar button change color when I navigate to the page it links to? ...

Encountered an issue locating the stylesheet file 'css/style.css' that is supposed to be linked from the template. This error occurred when trying to integrate Bootstrap with Angular

<link rel="stylesheet" href="plugins/bootstrap/bootstrap.min.css"> <link rel="stylesheet" href="plugins/owl-carousel/owl.carousel.css"> <link rel="stylesheet" href="plugins/magnific-pop ...

Making a CSS table fit perfectly inside a container

After reading numerous recommendations on the subject, none of them seem to be effective in my particular situation. The issue lies with a table that is nested within a container ('div' element) as shown below: <div class="container"> ...

Responsive design for iPads and smartphones is essential in ensuring a seamless user

Currently in the process of creating my own personal website, I have been diligently using Chrome Canary to ensure that all my media queries are properly set up. While everything looks great on Canary and functions well in various device modes within the b ...

The magic of CSS's 3D Transformation feature

Currently, I am working on a 'Flip' effect using the CSS3 transform Property. While everything seems to be functioning properly in recent versions of Chrome, Firefox, and Safari, I'm facing challenges when it comes to creating a fallback fo ...

Transforming the hue of a radio-button

When it comes to the default CSS code for radio buttons, they appear gray when unselected and blue when selected: https://i.stack.imgur.com/hsazr.png However, I have a specific requirement for them to be black in both states. In order to achieve this, I ...

occupying half of the screen

Having trouble displaying two videos in an ionic grid. My goal is to have both videos take up the entire screen, with each occupying 50% height and 100% width. However, when I try to achieve this, the ion-row only takes up 50% of the screen and the video i ...