Table Cell Slideshow

Size
2,892 Kb
Views
44,528

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 Previews

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>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</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
})()
});
Table Cell Slideshow - Script Codes
Table Cell Slideshow - Script Codes
Home Page Home
Developer Jon Christensen
Username JMChristensen
Uploaded August 03, 2022
Rating 3
Size 2,892 Kb
Views 44,528
Do you need developer help for Table Cell Slideshow?

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!

Jon Christensen (JMChristensen) Script Codes
Create amazing video scripts with AI!

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!