Tooltip/Accordion
How do I make an tooltip/accordion?
What is a tooltip/accordion? How do you make a tooltip/accordion? This script and codes were developed by Alex Rodrigues on 13 August 2022, Saturday.
Tooltip/Accordion - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Tooltip/Accordion</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script>
<meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="wrap"> <p class="heading">Easy tooltip that changes to an accordion on touch devices</p> <ul class="info"> <li class="info-item">I'm a list Item 1 <div class="tooltip"> <p></p> </div> </li> <li class="info-item">I'm a list Item 2 <div class="tooltip"> <p></p> </div> </li> <li class="info-item">I'm a list Item 3 <div class="tooltip"> <p></p> </div> </li> <li class="info-item">I'm a list Item 4 <div class="tooltip"> <p></p> </div> </li> </ul>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Tooltip/Accordion - Script Codes CSS Codes
@import url(http://fonts.googleapis.com/css?family=Droid+Serif:400,400italic|Montserrat:400,700);
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video { margin: 0; padding: 0; border: 0; font: inherit; font-size: 100%; vertical-align: baseline;
}
html { line-height: 1;
}
ol, ul { list-style: none;
}
table { border-collapse: collapse; border-spacing: 0;
}
caption, th, td { text-align: left; font-weight: normal; vertical-align: middle;
}
q, blockquote { quotes: none;
}
q:before, q:after, blockquote:before, blockquote:after { content: ""; content: none;
}
a img { border: none;
}
article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block;
}
* { box-sizing: border-box;
}
/* VARIABLES & MIXINS */
body { font-family: "Droid Serif", serif; line-height: 1.5;
}
.wrap { width: 100%; margin: 5% auto; text-align: right; max-width: 400px;
}
.heading { padding: 1em; text-align: center; font-size: 1.25em;
}
.info-item { padding: 1em; position: relative;
}
.info-item:before { content: "?"; float: right; margin-left: .5em; border: 1px solid; font-size: 85%; border-radius: 1em; padding: 0 0.25em; font-weight: bold;
}
.tooltip { background: #fff; border: 2px solid blue; padding: 1em; top: 0; right: 2em; display: none;
}
.active-tooltip .tooltip { position: absolute; display: block; top: 0; right: 2em;
}
.active-accordion .tooltip { display: block;
}
.tooltip p:before { font-family: "Montserrat", sans-serif; content: "I'm A tooltip"; display: block;
}
@media screen and (max-width: 600px) { .tooltip p:before { content: "I'm An Accordion"; }
}
Tooltip/Accordion - Script Codes JS Codes
if(!Modernizr.touch) { $('.info-item').hover(function() { $(this).toggleClass('active-tooltip'); });
}
else{ $('.info-item').click(function() { $(this).toggleClass('active-accordion'); });
}
Developer | Alex Rodrigues |
Username | alex_rodrigues |
Uploaded | August 13, 2022 |
Rating | 3 |
Size | 3,467 Kb |
Views | 26,312 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Animate delay Sass Mixin | 3,050 Kb |
Jquery Scroll test | 3,879 Kb |
Playing with Grid | 2,224 Kb |
Responsive Checkout Concept WIP | 6,323 Kb |
Mobile Menu Concept WIP | 4,592 Kb |
Toying With Flexslider | 5,052 Kb |
Transition Demo | 2,823 Kb |
Learning FlexBox | 2,821 Kb |
Front End Age Gate | 5,806 Kb |
Responsive Table-less Shopping Cart | 6,637 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Mini Profile | Frytyler | 3,828 Kb |
Simple Accordion | Wearebold | 3,683 Kb |
Disable JavaScript execution from console | Ludviglindblom | 2,534 Kb |
Responsive slide | Thorien | 2,400 Kb |
Zip Button test | Lje7462 | 1,932 Kb |
Example SVGZ Data URI | Joeyhoer | 2,981 Kb |
Retina canvas w. resize | Erikterwan | 1,882 Kb |
JQuery Validate checkbox group | Lunaman | 2,466 Kb |
Christ the Redeemer | Prashantsani | 2,208 Kb |
Headroom.js demo | WickyNilliams | 3,982 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!