Continuous News Ticker jQuery
How do I make an continuous news ticker jquery?
News Ticker with stop on hover and is continuous.. What is a continuous news ticker jquery? How do you make a continuous news ticker jquery? This script and codes were developed by Hemant Aggarwal on 09 January 2023, Monday.
Continuous News Ticker jQuery - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Continuous News Ticker jQuery</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="outer"> <div id ="tick"> <li><a href="#">I am First</a></li> <li><a href="#">I am Second</a></li> <li><a href="#">I am Third</a></li> <li><a href="#">I am Fourth</a></li> <li><a href="#">I am Fifth</a></li> </div> <div id="tick2"></div>
</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>
Continuous News Ticker jQuery - Script Codes CSS Codes
#tick li, #tick2 li { list-style-type:none; float:left; padding-right:20px; position:absolute; left:0px;}
#tick, #tick2 { position:relative; display:block; width:5000px; margin:0; content=""; display:table; height:0px; }
#outer{width:300px;height:25px; overflow:hidden; background:#EEEEEE;}
#outer a {text-decoration:none; color:#333; font-family:Calibri; font-size:18px;}
#outer a:hover {border-bottom:2px solid #777;}
Continuous News Ticker jQuery - Script Codes JS Codes
$('#tick2').html($('#tick').html());
//alert($('#tick2').offset.left);
var temp=0,intervalId=0;
$('#tick li').each(function(){ var offset=$(this).offset(); var offsetLeft=offset.left; $(this).css({'left':offsetLeft+temp}); temp=$(this).width()+temp+10;
});
$('#tick').css({'width':temp+40, 'margin-left':'20px'});
temp=0;
$('#tick2 li').each(function(){ var offset=$(this).offset(); var offsetLeft=offset.left; $(this).css({'left':offsetLeft+temp}); temp=$(this).width()+temp+10;
});
$('#tick2').css({'width':temp+40,'margin-left':temp+40});
function abc(a,b) { var marginLefta=(parseInt($("#"+a).css('marginLeft'))); var marginLeftb=(parseInt($("#"+b).css('marginLeft'))); if((-marginLefta<=$("#"+a).width())&&(-marginLefta<=$("#"+a).width())){ $("#"+a).css({'margin-left':(marginLefta-1)+'px'}); } else { $("#"+a).css({'margin-left':temp}); } if((-marginLeftb<=$("#"+b).width())){ $("#"+b).css({'margin-left':(marginLeftb-1)+'px'}); } else { $("#"+b).css({'margin-left':temp}); }
} function start() { intervalId = window.setInterval(function() { abc('tick','tick2'); }, 50) } $(function(){ $('#outer').mouseenter(function() { window.clearInterval(intervalId); }); $('#outer').mouseleave(function() { start(); }) start(); });
Developer | Hemant Aggarwal |
Username | mstoic |
Uploaded | January 09, 2023 |
Rating | 3 |
Size | 2,279 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 |
Theme HTML OLD | 6,722 Kb |
Images For ThemeForest - Envato | 7,100 Kb |
Adsense Code Converter - Mstoic.com | 2,017 Kb |
Social Share Count With JS | 2,515 Kb |
Amazing Hover Effect for Categories WP | 2,224 Kb |
Working Ticker | 2,051 Kb |
A Pen by Hemant Aggarwal | 3,716 Kb |
BreadCrumb Design | 1,913 Kb |
Navigation for Touch | 2,305 Kb |
DEL - SIP Calculator | 1,569 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 |
Pure CSS Dial | Lukewatts | 3,018 Kb |
Canvas Fireworks | Jackrugile | 6,200 Kb |
CSS3 Snow Animation | NickyCDK | 1,695 Kb |
Cloud upload | Jaflo | 2,774 Kb |
Import shader in three.js | Khangeldy | 2,636 Kb |
Birthday Party Starter | Aussieyang | 1,629 Kb |
Mondrian | Chrisarmstrong | 2,787 Kb |
Savemedia1.1 | EdsonAlcala | 2,148 Kb |
3D-box | Parthviroja | 2,346 Kb |
Wip elementary os navbar | Nickcolley | 2,993 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!