Table Cell Slideshow
How do I make an table cell slideshow?
Creating a slideshow with fancy effects based on table cell. Work in progress.. What is a table cell slideshow? How do you make a table cell slideshow? This script and codes were developed by Jon Christensen on 03 August 2022, Wednesday.
Table Cell Slideshow - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Table Cell Slideshow</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ #background { background-image: url(http://lorempixel.com/output/city-q-c-640-480-7.jpg); display: block; width: 640px; height: 480px; position: relative;}
#bg-table { width: 640px; height: 480px;}
#bg-overlay { position: absolute; top: 0; left: 0; width: 640px; height: 480px;}
#bg-overlay td { border: 1px solid #000;}
/* Each cell is: 160 x 120 */
#bg-table td,
#bg-overlay td { height: 120px; width: 160px;}
#bg-table td { border: 1px solid #000; background: #333; transition: opacity 1s linear; opacity: 0;} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div id="background"> <table cellpadding="0" cellspacing="0" border="0" id="bg-table" data-count="0"> <tr> <td></td><td></td><td></td><td></td> </tr> <tr> <td></td><td></td><td></td><td></td> </tr> <tr> <td></td><td></td><td></td><td></td> </tr> <tr> <td></td><td></td><td></td><td></td> </tr> </table> <table cellpadding="0" cellspacing="0" border="0" id="bg-overlay"> <tr> <td> </td><td> </td><td> </td><td> </td> </tr> <tr> <td> </td><td> </td><td> </td><td> </td> </tr> <tr> <td> </td><td> </td><td> </td><td> </td> </tr> <tr> <td> </td><td> </td><td> </td><td> </td> </tr> </table>
</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>
Table Cell Slideshow - Script Codes CSS Codes
#background { background-image: url(http://lorempixel.com/output/city-q-c-640-480-7.jpg); display: block; width: 640px; height: 480px; position: relative;}
#bg-table { width: 640px; height: 480px;}
#bg-overlay { position: absolute; top: 0; left: 0; width: 640px; height: 480px;}
#bg-overlay td { border: 1px solid #000;}
/* Each cell is: 160 x 120 */
#bg-table td,
#bg-overlay td { height: 120px; width: 160px;}
#bg-table td { border: 1px solid #000; background: #333; transition: opacity 1s linear; opacity: 0;}
Table Cell Slideshow - Script Codes JS Codes
$(document).ready(function(){ $('#bg-table td').each(function(i){ var $o = $(this), $tr = $o.closest('tr'), col = $o.index(), row = $tr.index(), xCord = col*160, yCord = row*120; $o.css({ backgroundPosition: -xCord+'px '+(-yCord)+'px'}); }); (function slide(){ var num = 0; (function animation(){ var aniTime = 125, delay = 5000, $cells = $('#bg-table td'), numCells = $cells.length, i = 0, type = 0; if (num % 2 == 0) { type = 1; delay = 0; setTimeout(function(){changeImage();}, (aniTime*numCells)); } (function animationLoop(){ setTimeout(function(){ $('#bg-table td').eq(i).css('opacity', type); i++; if(i < numCells) { animationLoop(); } }, aniTime) })(); // Loop num++; setTimeout(function(){ animation(); }, (aniTime*numCells)+delay); function changeImage(){ var image = $('#background'); if (image.hasClass('on')){ image.removeClass('on'); image.css('background-image', 'url(http://lorempixel.com/output/city-q-c-640-480-3.jpg)'); } else { image.addClass('on'); image.css('background-image', 'url(http://lorempixel.com/output/city-q-c-640-480-7.jpg)'); } } })() // Change BG
})()
});
Developer | Jon Christensen |
Username | JMChristensen |
Uploaded | August 03, 2022 |
Rating | 3 |
Size | 2,892 Kb |
Views | 44,528 |
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 |
Velocity Example | 2,150 Kb |
SVG Animated Stroke Dash | 3,623 Kb |
FitText.js Demo | 1,897 Kb |
Image Cover | 3,914 Kb |
SVG Button Animation | 4,333 Kb |
CSS Banners | 2,548 Kb |
CSS Transition End Sequence | 4,980 Kb |
SVG Text Masking | 2,141 Kb |
Vue JS Filtering | 9,746 Kb |
Responsive SVG Overlay | 2,674 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 |
Sexy Social Buttons | Ipiyale | 2,226 Kb |
Console fun | Dviate | 1,500 Kb |
Hover Animation from UNIQLO | Insprd | 3,772 Kb |
Simple animated hover effect | Pobee-norris | 3,044 Kb |
Chuck Norris Background | Manz | 1,967 Kb |
Bootstrap 4 Gridsystem Demo | Rivella50 | 1,535 Kb |
CSS Bot Confusion | Jpod | 3,456 Kb |
SVG Text Masking | JMChristensen | 2,141 Kb |
Multi column experiment. | Spylefkaditis | 2,805 Kb |
Retina canvas w. resize | Erikterwan | 1,882 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!