Tickets counter

Developer
Size
2,076 Kb
Views
40,480

How do I make an tickets counter?

What is a tickets counter? How do you make a tickets counter? This script and codes were developed by Robic on 11 August 2022, Thursday.

Tickets counter Previews

Tickets counter - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Tickets counter</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> <div class="count">	<button class="more">More</button>	<p>12</p>	<button class="less">Less</button>	<p><span class="total-ticket">0</span> Tickets</p>
</div>
<div class="count">	<button class="more">More</button>	<p>15</p>	<button class="less">Less</button>	<p><span class="total-ticket">0</span> Tickets</p>
</div>
<div class="count">	<button class="more">More</button>	<p>18</p>	<button class="less">Less</button>	<p><span class="total-ticket">0</span> Tickets</p>
</div>
<p class="total"><span class="total-number">0</span> €</p> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Tickets counter - Script Codes CSS Codes

.count { float: left; margin-right: 20px;
}

Tickets counter - Script Codes JS Codes

total = 0;
var count = $('.count')
$('.count').each(function(totalPush){	totalPush = 0;	$(this).children('.more').on('click', function(){	that = $(this).parent('.count').find('p');	parent = $(this).parent('.count');	val = that.html();	total += parseInt(val);	$('.total-number').html(total);	totalPush++;	parent.find('.total-ticket').html(totalPush)	})	$(this).children('.less').on('click', function(){	if(totalPush > 0){	that = $(this).parent('.count').find('p');	parent = $(this).parent('.count');	val = that.html();	total -= parseInt(val);	$('.total-number').html(total);	totalPush--;	parent.find('.total-ticket').html(totalPush)	}	})
})
Tickets counter - Script Codes
Tickets counter - Script Codes
Home Page Home
Developer Robic
Username AudreyRBC
Uploaded August 11, 2022
Rating 3
Size 2,076 Kb
Views 40,480
Do you need developer help for Tickets counter?

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!

Robic (AudreyRBC) Script Codes
Create amazing love letters 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!