Noframe.js Example
How do I make an noframe.js example?
Noframe.js is a javascript plugin that makes elements scale at a fixed ratio. https://github.com/dollarshaveclub/reframe.js. What is a noframe.js example? How do you make a noframe.js example? This script and codes were developed by Jeff Wainwright on 08 December 2022, Thursday.
Noframe.js Example - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Noframe.js Example</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <article> <header> <h1> Noframe.js </h1> <p>This page is a demo of a <a href="https://github.com/yowainwright/reframe.js">Noframe.js</a> - a very basic lightweight plugin that makes iframes or embedded content responsive.</p> <p>More deeply, this means that it makes elements scale at a fixed ratio.</p> </header> <div> <iframe width="560" height="315" src="https://www.youtube.com/embed/6FQsIfE7sZM" frameborder="0" allowfullscreen></iframe> </div> <p>This is an <code>iframe</code> that contains a video.</p> <footer> <p>~Thanks</p> </footer> </article> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Noframe.js Example - Script Codes CSS Codes
figure, p { margin: 1rem 0;
}
figcaption { margin: .5rem 0; text-align: center;
}
article { margin: 1rem; width: 100%;
}
@media screen and (min-width: 768px) { article { margin: 1rem auto; max-width: 700px; }
}
footer p, h1 { text-align: center;
}
footer, h1 { margin: 2rem auto;
}
Noframe.js Example - Script Codes JS Codes
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.noframe = factory());
}(this, (function () { 'use strict';
function noframe(target, container) { var els = typeof target === 'string' ? document.querySelectorAll(target) : target; if (!('length' in els)) { els = [els]; } for (var i = 0; i < els.length; i++) { var el = els[i]; var height = el.offsetHeight; var width = el.offsetWidth; if (typeof container !== 'undefined' && container !== 'false') { var parent = document.querySelector(container); var maxwidth = window.getComputedStyle(parent, null).getPropertyValue('max-width'); el.style.width = '100%'; el.style.maxHeight = 'calc(' + maxwidth + ' * ' + height + '/' + width + ')'; } else { var _maxwidth = width + 'px'; el.style.display = 'block'; el.style.marginLeft = el.style.marginRight = 'auto'; var fullwidth = _maxwidth + 'px'; if (width > el.parentElement.offsetWidth) { fullwidth = el.parentElement.offsetWidth; el.style.maxHeight = 'calc(' + fullwidth + 'px * ' + height + '/' + width + ')'; } else { el.style.maxHeight = 'calc(' + _maxwidth + ' * ' + height + '/' + width + ')'; } el.style.width = fullwidth + 'px'; } el.style.height = 'calc(100vw * ' + height + '/' + width + ')'; el.style.maxWidth = '100%'; }
}
var plugin = window.$ || window.jQuery || window.zepto;
if (plugin) { plugin.fn.extend({ noframe: function noframeFunc(cName) { return noframe(this, cName); } });
}
return noframe;
})));
noframe('iframe');
Developer | Jeff Wainwright |
Username | yowainwright |
Uploaded | December 08, 2022 |
Rating | 3.5 |
Size | 2,975 Kb |
Views | 8,096 |
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 |
A Pen by Jeff Wainwright | 4,864 Kb |
Stickybits Demo | 4,576 Kb |
Meeting Schedule Widget with Angular | 3,958 Kb |
ScrollDir Example | 4,194 Kb |
Shave, a javascript plugin for truncating text | 4,621 Kb |
Reframe.js Example | 3,759 Kb |
Playing with URLs and ScrollSpy | 4,377 Kb |
Trucated.js jQuery Demo | 3,109 Kb |
Full CSS Ribbon on 1 element | 2,671 Kb |
Reframe.js Demo | 3,821 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 |
Twinkling Stars | Ripley6811 | 2,750 Kb |
Large canvas mousemove experiment | Jibbon | 2,885 Kb |
JQuery exercise | Brian-baum | 3,780 Kb |
Horizontal Navigation with Floats | Gymratpacks | 5,403 Kb |
Cars going | Netoguimaraes | 1,699 Kb |
Mini Profile | Frytyler | 3,828 Kb |
Motion Lines - codevember - 02 - 2016 | Caiocares | 2,744 Kb |
Testing Portfolio Page | Sideshowli | 3,395 Kb |
Midterm dry run | Jds317 | 1,649 Kb |
A Pen by panstable | Panstable | 2,940 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!