Class Div is visible only within the jQuery Tab

I have encountered a perplexing issue that has left me stumped. I recently added tabs using a jQuery plugin [Tabulous] and am in the process of transferring existing content into these tabs. However, I stumbled upon a strange problem while attempting to position an image next to a block quote of text.

As seen in the image below, the image and text are displaying correctly outside of the 'tab'. But when the same code and styling are placed inside the tab, it results in the following issue. Upon inspecting the element, I found that the image div is positioned correctly, but it seems to be hidden behind another element.

Below is the relevant HTML code - there are multiple tabs within the tabs_container div:

<div id="tabs_container">
    <div id="tabs-1">         
    jdlfgbkfdjgn
    <div class="trainer-container">
        <div id="Adrienne"></div>
            <div class="h3light">Adrienne Michowski</div>
            <div class="post-thumb"><img src="images/person3.jpg" width="200" height="200"></div>
            <blockquote class="trainer">
                An English mathematician and writer, chiefly known for her work on Charles Babbage's early mechanical general-purpose computer, the Analytical Engine. Her notes on the engine include what is recognised as the first algorithm intended to be carried out by a machine. Because of this, she is often regarded as the first computer programmer. She trains clients in programming and longevity.
            </blockquote>
        </div>
    </div>

Here is the relevant CSS used:

#tabs_container {
padding: 40px;
overflow: hidden;
position: relative;
background: white;
border-right: 5px solid #861b3f;
font-family: Tahoma, Verdana, Segoe, sans-serif;
font-size: 16px;
margin:0 auto;
z-index:0;
align: left;
/*width: 100%;*/}

.trainer-container {
overflow:hidden;
padding-bottom: 30px;}

h3 {
font-family: Tahoma,Verdana,Segoe,sans-serif;
padding: 1px 0 14px 0;
margin-bottom: 5px;
font-size: 20px;}

.h3light {
font-family: Tahoma, Verdana, Segoe, sans-serif;
padding-top: 8px;
padding-bottom: 14px;
padding-left: 20px;
font-size: 20px;
color: #000;
background: rgba(255, 255, 255, 0.4);
padding: 0.3em;
margin-bottom: 15px;
text-indent: 20px;
/* Box Shadow */
-moz-box-shadow: 2px 2px 15px #D53369;
-webkit-box-shadow: 2px 2px 15px #D53369;
/*box-shadow: 2px 2px 15px #FFF;*/}

.post-thumb {
display: block;
max-width: 200px;
max-height: 200px;
float: left;
background-color: #fff;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
margin: 1px 1px 1px 1px;
z-index: 1;
clear: both;
background: none;}

/* Blockquotes */

blockquote {
background: #fff;
padding: 15px 20px 15px 45px;
margin: 0 20px 20px 20px;
height: auto;
font-family: Georgia,serif;
font-size: 16px;
line-height: 1.2;
color: #000;
text-align: justify;
border-left: 20px solid #861b3f;
border-right: 5px solid #861b3f;
/* Box Shadow */
-moz-box-shadow: 2px 2px 15px #861b3f;
-webkit-box-shadow: 2px 2px 15px #861b3f;
box-shadow: 2px 2px 15px #861b3f;
/*opacity: 0.5;*/
background: rgba(255,255,255,0.8);}

blockquote::before {
font-family: Georgia,serif;
font-size: 60px;
font-weight: 700;
color: #999;
position: absolute;
left: 10px;
top: 5px;}

blockquote::after {
content: "";}

blockquote.trainer {
min-height: 170px;
margin: 0 0 0 220px;}

Despite trying clear: both and z-index adjustments, I'm unable to get the image to display properly to the user. Any assistance would be greatly appreciated. Thank you.

Answer №1

Include the 'tabDiv' class in the tabs-# l div,

<div id="tabs-1" class="tabDiv">
     <p class="h3light">Adrienne Michowski</p>
     <div class="post-thumb"><img src="RioOlympic.png" width="200" height="200"></div>
        <blockquote class="trainer">
        An English mathematician and writer, chiefly known for her work on Charles Babbage's early mechanical general-purpose computer, the Analytical Engine. Her notes on the engine include what is recognised as the first algorithm intended to be carried out by a machine. Because of this, she is often regarded as the first computer programmer. She trains clients in programming and longevity.
</blockquote>  

</div>

This change is necessary because the code in tabulous.Js does not support nested or multiple divs.

  if (this.options.effect == 'scale') {
        tab_content = this.$elem.find('div').not(':first').not(':nth-child(1)').addClass('hidescale');
    } else if (this.options.effect == 'slideLeft') {
        tab_content = this.$elem.find('div').not(':first').not(':nth-child(1)').addClass('hideleft');
    } else if (this.options.effect == 'scaleUp') {
        tab_content = this.$elem.find('div').not(':first').not(':nth-child(1)').addClass('hidescaleup');
    } else if (this.options.effect == 'flip') {
        tab_content = this.$elem.find('div').not(':first').not(':nth-child(1)').addClass('hideflip');
    }

Instead, use the 'tabclass' class to apply CSS styles:

  var tabclass = ".tabDiv";

 if (this.options.effect == 'scale') {
        tab_content = this.$elem.find(tabclass).not(':first').not(':nth-child(1)').addClass('hidescale');
    } else if (this.options.effect == 'slideLeft') {
        tab_content = this.$elem.find(tabclass).not(':first').not(':nth-child(1)').addClass('hideleft');
    } else if (this.options.effect == 'scaleUp') {
        tab_content = this.$elem.find(tabclass).not(':first').not(':nth-child(1)').addClass('hidescaleup');
    } else if (this.options.effect == 'flip') {
        tab_content = this.$elem.find(tabclass).not(':first').not(':nth-child(1)').addClass('hideflip');
    }
 var alldivs = $('#tabs_container').find(tabclass);

View the output screenshot here:

For more information, check @ingro's comment at: https://github.com/aarondo/tabulous.js/issues/7

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

"Exploring the possibilities of customizing Material UI tabs and implementing a tabs scroller

I'm currently trying to customize the appearance of these MUI tabs, specifically the tab color and bottom border color. Despite my attempts using makeStyles and other methods, I haven't been able to achieve the desired result. Here is an example ...

submitting two contact forms using ajax

Looking to enhance my knowledge of form design... Hello there! I'm currently working with two contact forms on the same page, both utilizing ajax for submissions. Each form functions properly when standalone, but as soon as I integrate them togethe ...

Modify the appearance of material-ui checkbox

For my project, I am utilizing React along with the styled-component package for styling. However, I am facing an issue when it comes to styling the Material-ui checkbox using styled-component. The problem lies in narrowing the border of the checkbox, as t ...

Duplicating a Bootstrap theme in Orchard CMS

Currently, I am working on creating my own theme by utilizing the Bootstrap theme from Orchard dashboard as the foundation. However, when I try to launch the site using my theme (without any modifications, simply a clone of Bootstrap), an error appears: "o ...

The fixed position setting does not anchor the elements to the bottom of a container

When applying the following styles: #fullpage-menu > .gradient { position: fixed; bottom: 0; left: 0; width: 100%; height: 0.3rem; } To the element with ID #fullpage-menu, which is styled as follows: #fullpage-menu { height: 100 ...

Slanted lines HTML CSS

I am encountering an issue with my HTML and CSS coding. The design requires a zig-zag "border" at the top and bottom of the page, creating a white paper space in between. The paper needs to be positioned underneath the zig-zag borders. Currently, this is ...

Obtain the attribute value from an HTML option element

Here is the code snippet I am working with: <select class="form-control valid"> <option isday="False" value="2">Value 1</option> <option isday="True" value="3">Value 2</option> <option isday="True" value="4"> ...

Reset the clock once the page is refreshed using jQuery Classy Countdown

I set the countdown timer to January 1, 2017. However, every time I refresh the page, the countdown resets and begins again from 24 days, 23 hours, 50 minutes ... view the image $(document).ready(function() { $('#countdown4').Class ...

Selecting an option from the knockout dropdown menu

I implemented a language dropdown in layout.chtml using knockout js. <select id="Language" class="styled-select" data-bind="value: Language,options: locale, value: selectedLocale, optionsText: 'name'"></select> var viewModel = th ...

Converting Moment JS to Carbon for Time Calculations

How can I synchronize the timestamps between MomentJS and Carbon instances in the GMT timezone? $(document).on('click', '#confirm-reservation .dropdown-menu a', function () { $('#insert_text').text($(this).text()); va ...

Troubleshooting CSS Animation Failure in Internet Explorer 11

My mouse over / mouse out animation works perfectly in Firefox and Chrome, but it's not functioning in IE. Can anyone suggest why this might be happening when it was working fine before? var actual = 1; var over = 0; var over2 = 0; function scrol ...

What is the best way to access the id attribute of a <td> element within a <tr> using jQuery?

Can someone assist me with this issue? Is there a way to get the ID of the first or second td element instead of using a loop? Here is an example: "<tr class='test_point' id="+fileName+"><td><img src='"+ROOT_PATH+"/assets/d ...

"Adding dots" in a slideshow using HTML, CSS, and JS

I'm currently working on a slideshow that includes navigation dots at the bottom. Although the slideshow is functioning properly, I am encountering an issue where only one dot appears instead of the intended three in a row. Despite my research and att ...

Nested Property Binding in CallByName

I am looking to utilize CallByName in VBA to extract specific data from various webpages with differing html structures. In my scenario, I need to reference multiple parent nodes to access an element with or tags. Here is an example of the code: The eleme ...

Struggling with establishing a connection between Jquery and a .php file

I've encountered an issue with my jquery code. I'm uncertain if it's correctly connecting to doc.php as nothing is getting inserted into the database. In doc.php, I have an insert command that I know is functioning properly. My goal is to ...

Unable to view images on Wordpress theme

I am currently facing an issue where some images in my asset folder are not displaying properly when I convert my HTML/CSS/JS template to Wordpress. The main problem is with the image that should show up when you first visit the website. Below is the CSS c ...

Is there a way to streamline the form completion process on my website by utilizing voice commands through the user's microphone?

My webpage features a web form using Flask where users manually input their information that is then added to a table upon submitting. The current setup involves an autoplay video prompting users with questions, which they answer manually and then submit t ...

Struggling to get Django and AngularJS to play nice?

After opening the file angular.html with AngularJS in Chrome, the table displays the array of information as expected. However, when attempting to use Django with the same angular.html file, the array is not showing up in the table. Unsure of how to procee ...

Troubleshooting a problem with Select Dropdown in HTML and PHP

Hello, I am encountering an issue with a dropdown box as shown below: function createDropdown( $name, array $options, $selected=null ) { /*** starting the select element ***/ $dropdown = '<select name="'.$name.'" id="'.$name.'" ...

Using jQuery to adjust the length of a string to fit within a specific width

I am working with a table and need to input strings in each cell, but they are wider than the cell width. I want to shorten the strings without breaking lines, and add '...' at the end to show that the string is long. The table consists of aroun ...