Preventing more text being entered than a contenteditable divs static size - javascript

Basically I've made in jsfiddle the kind of thing I'm looking for. But it's meant using a contenteditable div rather than textarea. I don't mind if the div is 100% width, but I'd like the height 38px (to represent 2 lines of text).
The problem I'm finding is preventing more text from being entered when the entire area is already filled. Obviously I don't want to restrict this based on number of characters (and if I did that, I may as well use a mono-spaced font).
Any thoughts?
https://jsfiddle.net/v358Lpoq/2/
HTML...
<div class="writebox">
<div class="writeboxprefix">Comments:</div>
<div class="writeboxtext" contenteditable="true">
Lorem ipsum dolor si wdq wd qwdq wqd wqddwqe dwqdwq wdq wqd
wdq wqd wqd wqd wdqt
</div>
</div>
CSS...
.writeboxprefix {
height: 16px;
float: left;
background: white;
font-style: italic;
padding-right: 6px;
}
.writeboxtext {
background-attachment: local;
background-image: repeating-linear-gradient(white, white 15px, black
15px, white 16px, white 19px);
height: 38px;
resize: none;
}
.writebox {
font-family: Arial;
font-size: 10pt;
line-height: 19px;
display: block;
overflow: hidden;
}

Related

my next "section" moves with my javascript animation

I am a junior developer and I am coding my portfolio. I have a problem which is the following:
I put an animation effect typing on a keyboard on a "p" with JS and it moves a lot of my elements.
I managed to fix some with: "position absolute" and some CSS adjustments but the second problem is that I put a JS library to put a dark mode and "position: absolute" makes that the dark mode does not take disregard color changes.
Here is the HTML5 code:
<section class="landing-page">
<p>Luck, <br> web developer <span id="monSpan">html</span> </p> **<-- animation is here**
<div>
<img src="/img/undraw_developer_activity_re_39tg.svg" alt="">
</div>
</section>
<section class="end-landing-page">
<div>
<button>En savoir plus <span class="material-symbols-outlined">
arrow_downward
</span> </button> **<-----the moving div is here**
</div>
</section>
Here is the CSS3 code:
.landing-page {
display: flex;
font-family: 'Poppins', sans-serif;
font-size: 3em;
font-weight: bold;
}
.landing-page p {
padding-left: 10%;
padding-right: 50%;
font-size: 4rem;
}
.landing-page img {
height: 10em;
padding-left: 20%;
padding-right: 9%;
}
.landing-page div {
position: absolute;
padding-left: 40%;
}
#monSpan {
transition: all 0.5s;
background-color: rgb(129, 129, 255);
}
.end-landing-page div {
padding-top: 10%;
padding-left: 8%;
}
.end-landing-page button {
display: flex;
align-items: center;
background-color: rgb(129, 129, 255);
border-radius: 30px;
padding: 10px;
}
as said before I tried with the "position" property and it works but the dark mode library no longer works on these elements
I also tried with the "z-index" property but without result
I am French and use google translation, and there may be bad translations do not hesitate to ask me to rephrase.

Select of Dropdown value display a div

I am working on a Responsive website, where I am developing a tabbed component. It works in a way that, in Desktop and Tablet, I render a menu, and on click of the menu button, I display the corresponding div like this.
Desktop and Tablet for Menu:
So when I select the different tab options, I display the corresponding tab contents. For mobile, I have to convert this menu into a Dropdown, which I was able to do. But on click of the dropdown value, I want to render the corresponding tab contents, which I am not able to do it. I want to display the corresponding tab on choosing the dropdown value. Any help is appreciated. Please find attached the JSFiddle.
function testFunction(evt, tabNumber) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(tabNumber).style.display = "block";
evt.currentTarget.className += " active";
}
$(document).ready(function() {
$('.dropdown > ul').toggleClass('no-js js');
$('.dropdown .js ul').hide();
$('.dropdown .js').click(function(e) {
$('.dropdown .js ul').slideToggle(200);
$('.dropbtn').toggleClass('active');
e.stopPropagation();
e.stopPropagation();
});
if ($('.dropdown .js ul').is(':visible')) {
$('.dropdown .js ul', this).slideUp();
$('.dropbtn').removeClass('active');
}
$("#filter-options-ul li").on("click", function() {
console.log('clicked');
var val = $(this).find('span').html();
//$('.filter-options').css('border-right', '20px solid' + col);
$('.dropbtn').html(val);
});
});
#media all and (min-width:320px) and (max-width:767px) {
.c-koh-tabbed-article .koh-article-header {
border-bottom: none;
}
.dropdown {
position: relative;
display: block;
margin-top: 30px;
margin-bottom: 30px;
}
.dropbtn {
background-color: #fff;
font-family: Helvetica Neue LT Pro Roman;
font-size: 14px;
color: #000;
width: 100%;
padding: 15px;
text-align: left;
border: 1px solid #e5e5e5;
cursor: pointer;
}
.dropbtn::after {
content: "\e600";
font-family: KohlerIcons;
font-size: 12px;
width: 16px;
height: 16px;
float: right;
margin-top: 5px;
box-sizing: border-box;
}
.dropdown ul {
position: relative;
padding-left: 0px;
font-weight: 400;
margin-bottom: 0;
font-size: 14px
}
.dropdown ul li {
position: relative;
list-style: none;
cursor: pointer;
}
.dropdown ul li ul {
position: absolute;
left: 0;
right: 0;
z-index: 9999;
}
.dropdown ul li ul {
padding-left: 0px;
}
.dropdown ul li li span {
font-family: Helvetica Neue LT Pro Roman;
font-size: 14px;
color: #000;
transition: background-color 0.2s ease-in-out;
-webkit-transition: background-color 0.2s ease-in-out;
-moz-transition: background-color 0.2s ease-in-out;
display: block;
background: #fff;
padding: 20px 15px;
border: 1px solid #e5e5e5;
}
/* Fallbacks */
.dropdown .no-js ul {
display: none;
}
}
#media all and (min-width:768px) {
.dropdown {
display: none;
}
.c-koh-tabbed-article .koh-article-header .koh-article-controls .koh-article-set {
display: table;
border: none;
box-shadow: none;
}
.c-koh-tabbed-article .koh-article-header .koh-article-controls .koh-article-set li {
display: table-cell;
border-bottom: none;
}
.button-default {
font-family: Nexa W01 Heavy !important;
font-size: 14px !important;
color: #77777A !important;
display: inline !important;
width: 100% !important;
padding: 0px 20px !important;
height: 45px !important;
margin: 0 !important;
background: #FFF !important;
border: 1px solid #77777A !important;
color: #77777A !important;
border-radius: 0px !important;
text-transform: uppercase !important;
}
.button-default:hover {
background: #77777A !important;
color: #FFF !important;
}
.button-default.active {
background: #77777A !important;
color: #FFF !important;
}
.tabcontent {
margin: 30px 0px;
text-align: left;
width: 100%;
overflow: hidden;
}
}
.c-koh-tabbed-article .koh-article-header .koh-article-title {
font-family: Nexa W01 Heavy !important;
font-size: 30px !important;
color: #000 !important;
font-weight: bold !important;
}
.c-koh-tabbed-article .koh-article-header .koh-article-controls {
height: auto !important;
}
.strong {
font-family: Nexa W01 XBold !important;
font-size: 18px !important;
color: #000 !important;
}
.article-sub-text {
font-family: Helvetica Neue LT Pro Roman !important;
font-size: 14px !important;
color: #000 !important;
font-weight: 400 !important;
}
.left-column {
width: 50%;
float: left;
padding-right: 20px;
}
.right-column {
width: 50%;
float: left;
}
.right-column img {
display: block;
width: 100%;
height: auto;
}
#media all and (min-width:980px) {
.tabcontent {
margin: 30px 0px 30px 10px;
text-align: left;
width: 100%;
overflow: hidden;
}
.button-default {
font-family: Nexa W01 Heavy !important;
font-size: 14px !important;
color: #77777A !important;
display: inline !important;
width: auto !important;
padding: 0px 45px !important;
height: 45px !important;
margin: 0px 20px 0px 0px !important;
background: #FFF !important;
border: 1px solid #77777A !important;
color: #77777A !important;
border-radius: 0px !important;
text-transform: uppercase !important;
}
.button-default:last-child {
margin: 0px !important;
}
.button-default:hover {
background: #77777A !important;
color: #FFF !important;
}
.button-default.active {
background: #77777A !important;
color: #FFF !important;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<section class="c-koh-tabbed-article">
<div class="koh-article-container">
<div class="koh-article-header">
<div class="koh-article-controls">
<ul class="koh-article-set">
<li><button onclick="testFunction(event,'tab1')" class="button-default tablinks">Blandit</button></li>
<li><button onclick="testFunction(event,'tab2')" class="button-default tablinks" href="javascript:void(0);">Aliquam</button></li>
<li><button onclick="testFunction(event,'tab3')" class="button-default tablinks" href="javascript:void(0);">Pharetra Maximus</button></li>
<li><button onclick="testFunction(event,'tab4')" class="button-default tablinks" href="javascript:void(0);">Tincidunt</button></li>
<li><button onclick="testFunction(event,'tab5')" class="button-default tablinks" href="javascript:void(0);">Condimentum</button></li>
</ul>
<div class="dropdown">
<ul class="no-js">
<li>
<button id="filter-options" class="dropbtn">Select One</button>
<ul id="filter-options-ul">
<li><span>Blandit</span></li>
<li><span>Aliquam</span></li>
<li><span>Pharetra Maximus</span></li>
<li><span>Tincidunt</span></li>
<li><span>Condimentum</span></li>
</ul>
</li>
</ul>
</div>
<div id="tab1" class="tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://kohler.scene7.com/is/image/PAWEB/zab65695_1800x800?$1800Hero$" alt="Kohler Image"></img>
</div>
</div>
<div id="tab2" class="container tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://kohler.scene7.com/is/image/PAWEB/aab27241_1800x800" alt="Kohler Image">
</div>
</div>
<div id="tab3" class="tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://kohler.scene7.com/is/image/PAWEB/zab80843_rgb?crop=(102,1521,4876,2167)$" alt="Kohler Image">
</div>
</div>
<div id="tab4" class="tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://s3.img-b.com/image/private/t_base,f_auto,c_lpad,h_800/product/Kohler/kohler-k-6331-alternate-image-4-473.jpg" alt="Kohler Image">
</div>
</div>
<div id="tab5" class="tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://kohler.scene7.com/is/image/PAWEB/zab42000_1800x800?$1800Hero$" alt="Kohler Image">
</div>
</div>
</div>
</div>
</div>
</section>
The dropdown and tabs both display, I don't know why the styles aren't picking up. May be the media queries. But the functionality works. When you click on the tab, you see the 2 div's that are getting display below the dropdown. I want to achieve the same thing when I click the dropdown value. Any help is appreciated.
You are complicating your code too much, do like below:-
function testFunction(evt, tabNumber) {
$('.tabcontent').hide();
$("#"+tabNumber).show();
}
Working example:-
function testFunction(evt, tabNumber) {
$('.tabcontent').hide();
$("#"+tabNumber).show();
}
$(document).ready(function() {
$('.dropdown > ul').toggleClass('no-js js');
$('.dropdown .js ul').hide();
$('.dropdown .js').click(function(e) {
$('.dropdown .js ul').slideToggle(200);
$('.dropbtn').toggleClass('active');
e.stopPropagation();
e.stopPropagation();
});
if ($('.dropdown .js ul').is(':visible')) {
$('.dropdown .js ul', this).slideUp();
$('.dropbtn').removeClass('active');
}
$("#filter-options-ul li").on("click", function() {
console.log('clicked');
var val = $(this).find('span').html();
//$('.filter-options').css('border-right', '20px solid' + col);
$('.dropbtn').html(val);
});
});
#media all and (min-width:320px) and (max-width:767px) {
.c-koh-tabbed-article .koh-article-header {
border-bottom: none;
}
.dropdown {
position: relative;
display: block;
margin-top: 30px;
margin-bottom: 30px;
}
.dropbtn {
background-color: #fff;
font-family: Helvetica Neue LT Pro Roman;
font-size: 14px;
color: #000;
width: 100%;
padding: 15px;
text-align: left;
border: 1px solid #e5e5e5;
cursor: pointer;
}
.dropbtn::after {
content: "\e600";
font-family: KohlerIcons;
font-size: 12px;
width: 16px;
height: 16px;
float: right;
margin-top: 5px;
box-sizing: border-box;
}
.dropdown ul {
position: relative;
padding-left: 0px;
font-weight: 400;
margin-bottom: 0;
font-size: 14px
}
.dropdown ul li {
position: relative;
list-style: none;
cursor: pointer;
}
.dropdown ul li ul {
position: absolute;
left: 0;
right: 0;
z-index: 9999;
}
.dropdown ul li ul {
padding-left: 0px;
}
.dropdown ul li li span {
font-family: Helvetica Neue LT Pro Roman;
font-size: 14px;
color: #000;
transition: background-color 0.2s ease-in-out;
-webkit-transition: background-color 0.2s ease-in-out;
-moz-transition: background-color 0.2s ease-in-out;
display: block;
background: #fff;
padding: 20px 15px;
border: 1px solid #e5e5e5;
}
/* Fallbacks */
.dropdown .no-js ul {
display: none;
}
}
#media all and (min-width:768px) {
.dropdown {
display: none;
}
.c-koh-tabbed-article .koh-article-header .koh-article-controls .koh-article-set {
display: table;
border: none;
box-shadow: none;
}
.c-koh-tabbed-article .koh-article-header .koh-article-controls .koh-article-set li {
display: table-cell;
border-bottom: none;
}
.button-default {
font-family: Nexa W01 Heavy !important;
font-size: 14px !important;
color: #77777A !important;
display: inline !important;
width: 100% !important;
padding: 0px 20px !important;
height: 45px !important;
margin: 0 !important;
background: #FFF !important;
border: 1px solid #77777A !important;
color: #77777A !important;
border-radius: 0px !important;
text-transform: uppercase !important;
}
.button-default:hover {
background: #77777A !important;
color: #FFF !important;
}
.button-default.active {
background: #77777A !important;
color: #FFF !important;
}
.tabcontent {
margin: 30px 0px;
text-align: left;
width: 100%;
overflow: hidden;
}
}
.c-koh-tabbed-article .koh-article-header .koh-article-title {
font-family: Nexa W01 Heavy !important;
font-size: 30px !important;
color: #000 !important;
font-weight: bold !important;
}
.c-koh-tabbed-article .koh-article-header .koh-article-controls {
height: auto !important;
}
.strong {
font-family: Nexa W01 XBold !important;
font-size: 18px !important;
color: #000 !important;
}
.article-sub-text {
font-family: Helvetica Neue LT Pro Roman !important;
font-size: 14px !important;
color: #000 !important;
font-weight: 400 !important;
}
.left-column {
width: 50%;
float: left;
padding-right: 20px;
}
.right-column {
width: 50%;
float: left;
}
.right-column img {
display: block;
width: 100%;
height: auto;
}
#media all and (min-width:980px) {
.tabcontent {
margin: 30px 0px 30px 10px;
text-align: left;
width: 100%;
overflow: hidden;
}
.button-default {
font-family: Nexa W01 Heavy !important;
font-size: 14px !important;
color: #77777A !important;
display: inline !important;
width: auto !important;
padding: 0px 45px !important;
height: 45px !important;
margin: 0px 20px 0px 0px !important;
background: #FFF !important;
border: 1px solid #77777A !important;
color: #77777A !important;
border-radius: 0px !important;
text-transform: uppercase !important;
}
.button-default:last-child {
margin: 0px !important;
}
.button-default:hover {
background: #77777A !important;
color: #FFF !important;
}
.button-default.active {
background: #77777A !important;
color: #FFF !important;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<section class="c-koh-tabbed-article">
<div class="koh-article-container">
<div class="koh-article-header">
<div class="koh-article-controls">
<ul class="koh-article-set">
<li><button onclick="testFunction(event,'tab1')" class="button-default tablinks">Blandit</button></li>
<li><button onclick="testFunction(event,'tab2')" class="button-default tablinks" href="javascript:void(0);">Aliquam</button></li>
<li><button onclick="testFunction(event,'tab3')" class="button-default tablinks" href="javascript:void(0);">Pharetra Maximus</button></li>
<li><button onclick="testFunction(event,'tab4')" class="button-default tablinks" href="javascript:void(0);">Tincidunt</button></li>
<li><button onclick="testFunction(event,'tab5')" class="button-default tablinks" href="javascript:void(0);">Condimentum</button></li>
</ul>
<div class="dropdown">
<ul class="no-js">
<li>
<button id="filter-options" class="dropbtn">Select One</button>
<ul id="filter-options-ul">
<li><span>Blandit</span></li>
<li><span>Aliquam</span></li>
<li><span>Pharetra Maximus</span></li>
<li><span>Tincidunt</span></li>
<li><span>Condimentum</span></li>
</ul>
</li>
</ul>
</div>
<div id="tab1" class="tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://kohler.scene7.com/is/image/PAWEB/zab65695_1800x800?$1800Hero$" alt="Kohler Image"></img>
</div>
</div>
<div id="tab2" class="container tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://kohler.scene7.com/is/image/PAWEB/aab27241_1800x800" alt="Kohler Image"></img>
</div>
</div>
<div id="tab3" class="tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://kohler.scene7.com/is/image/PAWEB/zab80843_rgb?crop=(102,1521,4876,2167)$" alt="Kohler Image"></img>
</div>
</div>
<div id="tab4" class="tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://s3.img-b.com/image/private/t_base,f_auto,c_lpad,h_800/product/Kohler/kohler-k-6331-alternate-image-4-473.jpg" alt="Kohler Image"></img>
</div>
</div>
<div id="tab5" class="tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://kohler.scene7.com/is/image/PAWEB/zab42000_1800x800?$1800Hero$" alt="Kohler Image"></img>
</div>
</div>
</div>
</div>
</div>
</section>
Note:- the same code you can use when you are on desktop view (Tabs VIEW)
you only need to use the click function like so:
$("#filter-options-ul li").on("click", function(ev) { //notice the ev parameter
console.log('clicked');
var val = $(this).find('span').html();
switch(val){
case 'Blandit':
testFunction(ev, 'tab1'); // pass the event to the click function
break;
case 'Aliquam':
testFunction(ev, 'tab2');
break;
case 'Pharetra Maximus':
testFunction(ev, 'tab3');
break;
case 'Tincidunt':
testFunction(ev, 'tab4');
break;
case 'Condimentum':
testFunction(ev, 'tab5');
break;
}
//$('.filter-options').css('border-right', '20px solid' + col);
$('.dropbtn').html(val);
});
here is a demo
function testFunction(evt, tabNumber) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(tabNumber).style.display = "block";
evt.currentTarget.className += " active";
}
$(document).ready(function() {
$('.dropdown > ul').toggleClass('no-js js');
$('.dropdown .js ul').hide();
$('.dropdown .js').click(function(e) {
$('.dropdown .js ul').slideToggle(200);
$('.dropbtn').toggleClass('active');
e.stopPropagation();
e.stopPropagation();
});
if ($('.dropdown .js ul').is(':visible')) {
$('.dropdown .js ul', this).slideUp();
$('.dropbtn').removeClass('active');
}
$("#filter-options-ul li").on("click", function(ev) {
console.log('clicked');
var val = $(this).find('span').html();
//console.log(ev);
//return;
switch(val){
case 'Blandit':
testFunction(ev, 'tab1');
break;
case 'Aliquam':
testFunction(ev, 'tab2');
break;
case 'Pharetra Maximus':
testFunction(ev, 'tab3');
break;
case 'Tincidunt':
testFunction(ev, 'tab4');
break;
case 'Condimentum':
testFunction(ev, 'tab5');
break;
}
//$('.filter-options').css('border-right', '20px solid' + col);
$('.dropbtn').html(val);
});
});
#media all and (min-width:320px) and (max-width:767px) {
.c-koh-tabbed-article .koh-article-header {
border-bottom: none;
}
.dropdown {
position: relative;
display: block;
margin-top: 30px;
margin-bottom: 30px;
}
.dropbtn {
background-color: #fff;
font-family: Helvetica Neue LT Pro Roman;
font-size: 14px;
color: #000;
width: 100%;
padding: 15px;
text-align: left;
border: 1px solid #e5e5e5;
cursor: pointer;
}
.dropbtn::after {
content: "\e600";
font-family: KohlerIcons;
font-size: 12px;
width: 16px;
height: 16px;
float: right;
margin-top: 5px;
box-sizing: border-box;
}
.dropdown ul {
position: relative;
padding-left: 0px;
font-weight: 400;
margin-bottom: 0;
font-size: 14px
}
.dropdown ul li {
position: relative;
list-style: none;
cursor: pointer;
}
.dropdown ul li ul {
position: absolute;
left: 0;
right: 0;
z-index: 9999;
}
.dropdown ul li ul {
padding-left: 0px;
}
.dropdown ul li li span {
font-family: Helvetica Neue LT Pro Roman;
font-size: 14px;
color: #000;
transition: background-color 0.2s ease-in-out;
-webkit-transition: background-color 0.2s ease-in-out;
-moz-transition: background-color 0.2s ease-in-out;
display: block;
background: #fff;
padding: 20px 15px;
border: 1px solid #e5e5e5;
}
/* Fallbacks */
.dropdown .no-js ul {
display: none;
}
}
#media all and (min-width:768px) {
.dropdown {
display: none;
}
.c-koh-tabbed-article .koh-article-header .koh-article-controls .koh-article-set {
display: table;
border: none;
box-shadow: none;
}
.c-koh-tabbed-article .koh-article-header .koh-article-controls .koh-article-set li {
display: table-cell;
border-bottom: none;
}
.button-default {
font-family: Nexa W01 Heavy !important;
font-size: 14px !important;
color: #77777A !important;
display: inline !important;
width: 100% !important;
padding: 0px 20px !important;
height: 45px !important;
margin: 0 !important;
background: #FFF !important;
border: 1px solid #77777A !important;
color: #77777A !important;
border-radius: 0px !important;
text-transform: uppercase !important;
}
.button-default:hover {
background: #77777A !important;
color: #FFF !important;
}
.button-default.active {
background: #77777A !important;
color: #FFF !important;
}
.tabcontent {
margin: 30px 0px;
text-align: left;
width: 100%;
overflow: hidden;
}
}
.c-koh-tabbed-article .koh-article-header .koh-article-title {
font-family: Nexa W01 Heavy !important;
font-size: 30px !important;
color: #000 !important;
font-weight: bold !important;
}
.c-koh-tabbed-article .koh-article-header .koh-article-controls {
height: auto !important;
}
.strong {
font-family: Nexa W01 XBold !important;
font-size: 18px !important;
color: #000 !important;
}
.article-sub-text {
font-family: Helvetica Neue LT Pro Roman !important;
font-size: 14px !important;
color: #000 !important;
font-weight: 400 !important;
}
.left-column {
width: 50%;
float: left;
padding-right: 20px;
}
.right-column {
width: 50%;
float: left;
}
.right-column img {
display: block;
width: 100%;
height: auto;
}
#media all and (min-width:980px) {
.tabcontent {
margin: 30px 0px 30px 10px;
text-align: left;
width: 100%;
overflow: hidden;
}
.button-default {
font-family: Nexa W01 Heavy !important;
font-size: 14px !important;
color: #77777A !important;
display: inline !important;
width: auto !important;
padding: 0px 45px !important;
height: 45px !important;
margin: 0px 20px 0px 0px !important;
background: #FFF !important;
border: 1px solid #77777A !important;
color: #77777A !important;
border-radius: 0px !important;
text-transform: uppercase !important;
}
.button-default:last-child {
margin: 0px !important;
}
.button-default:hover {
background: #77777A !important;
color: #FFF !important;
}
.button-default.active {
background: #77777A !important;
color: #FFF !important;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<section class="c-koh-tabbed-article">
<div class="koh-article-container">
<div class="koh-article-header">
<div class="koh-article-controls">
<ul class="koh-article-set">
<li><button onclick="testFunction(event,'tab1')" class="button-default tablinks">Blandit</button></li>
<li><button onclick="testFunction(event,'tab2')" class="button-default tablinks" href="javascript:void(0);">Aliquam</button></li>
<li><button onclick="testFunction(event,'tab3')" class="button-default tablinks" href="javascript:void(0);">Pharetra Maximus</button></li>
<li><button onclick="testFunction(event,'tab4')" class="button-default tablinks" href="javascript:void(0);">Tincidunt</button></li>
<li><button onclick="testFunction(event,'tab5')" class="button-default tablinks" href="javascript:void(0);">Condimentum</button></li>
</ul>
<div class="dropdown">
<ul class="no-js">
<li>
<button id="filter-options" class="dropbtn">Select One</button>
<ul id="filter-options-ul">
<li><span>Blandit</span></li>
<li><span>Aliquam</span></li>
<li><span>Pharetra Maximus</span></li>
<li><span>Tincidunt</span></li>
<li><span>Condimentum</span></li>
</ul>
</li>
</ul>
</div>
<div id="tab1" class="tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://kohler.scene7.com/is/image/PAWEB/zab65695_1800x800?$1800Hero$" alt="Kohler Image"></img>
</div>
</div>
<div id="tab2" class="container tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://kohler.scene7.com/is/image/PAWEB/aab27241_1800x800" alt="Kohler Image"></img>
</div>
</div>
<div id="tab3" class="tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://kohler.scene7.com/is/image/PAWEB/zab80843_rgb?crop=(102,1521,4876,2167)$" alt="Kohler Image"></img>
</div>
</div>
<div id="tab4" class="tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://s3.img-b.com/image/private/t_base,f_auto,c_lpad,h_800/product/Kohler/kohler-k-6331-alternate-image-4-473.jpg" alt="Kohler Image"></img>
</div>
</div>
<div id="tab5" class="tabcontent" style="display:none;">
<div class="left-column">
<span class="strong"> This is the heading of the tabbed component and will be in bold</span>
<p class="article-sub-text">Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero.</p>
<p class="article-sub-text">Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually
has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found
in the original.</p>
</div>
<div class="right-column"><img src="https://kohler.scene7.com/is/image/PAWEB/zab42000_1800x800?$1800Hero$" alt="Kohler Image"></img>
</div>
</div>
</div>
</div>
</div>
</section>
Well you can also use onclick event on span element inside your dropdown to achieve the same result for Mobile view.
<ul id="filter-options-ul">
<li><span onclick="testFunction(event,'tab1')>Aliquam</span></li>
. . .
</ul>

ScrollMagic: hide content when it overlaps with the pinned area

I am using ScrollMagic on my page. Here is the HTML:
<div class="container">
<div class="before-trigger">
</div>
<div class="trigger" id="trigger">
</div>
<div class="pin-area" id="pin-area">
This is a pinned area.
</div>
<div class="content">
Lorem ipsum ...
</div>
</div>
Here is my Javascript:
var controller = new ScrollMagic.Controller();
var scene1 = new ScrollMagic.Scene({triggerElement: "#trigger", triggerHook: 'onLeave'})
.setPin("#pin-area")
.addTo(controller);
Here is the jsfiddle demo: https://jsfiddle.net/gg8t714q/2/
When scrolling down the page, the content area (div.content) overlaps with the pinned area. How can I hide the content in the overlap area without hiding the background image? In another word, I am able to see the background image in the pinned area.
You can add the same background items you have in your .container rule to your .pin-area rule as a work around. So .pin-area would be:
.pin-area {
background-image: url('http://www.nationalgeographic.com/content/dam/science/photos/000/011/1106.adapt.1900.1.jpg');
background-position: right bottom;
background-attachment: fixed;
font-size: 2em;
color: #fff;
padding: 30px;
border: 2px solid #fff;
text-align: center;
}
var controller = new ScrollMagic.Controller();
var scene1 = new ScrollMagic.Scene({
triggerElement: "#trigger",
triggerHook: 'onLeave'
})
.setPin("#pin-area")
.addTo(controller);
body {
padding: 0;
}
.container {
background-image: url('http://www.nationalgeographic.com/content/dam/science/photos/000/011/1106.adapt.1900.1.jpg');
background-position: right bottom;
background-attachment: fixed;
}
.before-trigger {
height: 200px;
}
.trigger {
min-height: 1
}
.pin-area {
background-image: url('http://www.nationalgeographic.com/content/dam/science/photos/000/011/1106.adapt.1900.1.jpg');
background-position: right bottom;
background-attachment: fixed;
font-size: 2em;
color: #fff;
padding: 30px;
border: 2px solid #fff;
text-align: center;
}
.content {
;
height: 800px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.5/ScrollMagic.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.5/plugins/animation.gsap.min.js"></script>
<div class="container">
<div class="before-trigger">
</div>
<div class="trigger" id="trigger">
</div>
<div class="pin-area" id="pin-area">
This is a pinned area.
</div>
<div class="content">
Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps to outline
the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero. Its words and letters have been changed by addition or removal, so to deliberately
render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore.
</div>
</div>

HTML layout renders differently on fiddle and on browser

I have made a small web page, the source code of which is available on FIDDLE. It uses a jquery plugin which I made for autocomplete.
The plugin adds a new div (.mridautocomplete-list) after the initialized inputs, which contains the autocomplete list :
<input id="test1">
<div class="mridautocomplete-list" style="display: block; left: 8px; width: 169px; position: absolute; background-color: white; border: 1px solid rgb(221, 221, 221); max-height: 150px; overflow-x: hidden; overflow-y: scroll; font-family: Arial; font-size: 13.3333px; z-index: 8888;">
<p class="mrid-autocomplete-item" style="margin: 0px; padding-left: 2px; text-align: left; font-size: 13.3333px; cursor: default; background-color: white;"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="mridautocomplete-item-image" style="height: 11px; width: 11px;"><span style="color: #4682B4; font-weight: bold;">a</span>aa</p>
<p class="mrid-autocomplete-item" style="margin: 0px; padding-left: 2px; text-align: left; font-size: 13.3333px; cursor: default; background-color: white;"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="mridautocomplete-item-image" style="height: 11px; width: 11px;">b<span style="color: #4682B4; font-weight: bold;">a</span>b</p>
</div>
<input class="test2">
<div class="mridautocomplete-list"></div>
<input class="test3">
<div class="mridautocomplete-list"></div>
The problem is :
This web page renders perfectly as expected on fiddle
But when I run the same code on my browser ( without fiddle ), it doesn't get displayed properly, shifting all elements ( SHOWN IN SCREENSHOTS ATTACHED )
Can anyone explain what might be causing the problem ?
Your .test2 class is a width of 80%.
The other inputs have a default width of 173px.
If you resize the fiddle window to a larger width, you will see the same issue.
To fix this you could add a display: block to your .test2 class.
Have you already tried the display CSS property? Setting the second input to "display: block" forces the 3rd input to the next line.
Another option is to place the autocomplete Javascript just before the closing body tag. This also worked for me in Chrome, Firefox and Safari.

Jquery : how to use tooltip with JQuery?

I have a simple tooltip which has long JavaScript code in the divs.
I would to make it is as simple way
could any one help please
here is my code
<div onmouseover="document.getElementById('tt1DX1').style.display='block'" onmouseout="document.getElementById('tt1DX1').style.display='none'" style="position:relative;">Tool
<div id="tt1DX1" class="toolTip_new pbc11_ttpos1_1Q_di" style="display: none;">
<div class="tool_wrapper">
<div class="tooltip_top_new"></div>
<div class="tooltip_middle_new">
<div class="content">
<p>Please holder actuall text</p>
<p>Please holder actuall text</p>
</div>
</div>
<div class="tooltip_bot_new2"></div>
</div>
</div>
</div>
css
.tooltip_top_new{
background:url(../images/n_tooltip_top.png) no-repeat;
height:9px;
width:212px;
}
.tooltip_middle_new{
background:url(../images/n_tooltip_middle.png) no-repeat;
width:212px;
}
.tooltip_middle_new .content{
padding:2px 13px 1px;
}
.tooltip_middle_new .content p{
line-height: 1.3;
margin-bottom: 1em;
text-align: left;
}
.tooltip_bot_new2{
background:url(../images/n_tooltip_bot2.png) no-repeat;
height:21px;
width:212px;
}
.Question_di{
position:relative;
}
.pbc11_ttpos1_1Q_di {
border: 0 solid #FF0000;
}
.toolTip_new {
background: none repeat scroll 0 0 transparent;
color: #5C5C5C;
display: none;
font: 10px/12px Tahoma,Geneva,sans-serif;
left: -173px;
top: -90px;
position: absolute;
z-index: 1000;
}
the thing is that I have to copy & paste onmouseover="document.getElementById('tt1DX1').style.display='block'" onmouseout="document.getElementById('tt1DX1').style.display='none'" where ever using the tooltips,I would like to avoid it.
JQueryTools includes a Tooltip module which will get rid of a big chunk of your code.
http://jquerytools.org/demos/tooltip/index.html
It's also possible to create tooltips with no JavaScript at all, using HTML and CSS along these lines:
<div class="has-tooltip">
<button class="huge red">You Know You Wanna...</button>
<div class="tooltip">Do NOT Press This Button.</div>
</div>
And in CSS:
.has-tooltip .tooltip {
position: absolute;
display: none;
<style code to position (with margin-left and margin-top)
and make the tooltip box look how you want>
}
.has-tooltip:hover .tooltip {
display: block;
}
Google "CSS Tooltips" to see lots of examples.

Categories

Resources