Paging
How do I make an paging?
Image paging, just like acrobat pdf reader. What is a paging? How do you make a paging? This script and codes were developed by Krishna Babu on 11 January 2023, Wednesday.
Paging - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Paging</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <header> <div class="toolbar"> <a href="#" id="first"><img src="http://www.flashaddicts.com/clientdisplay/images/paging/first.png"/></a> <a href="#" id="prev"><img src="http://www.flashaddicts.com/clientdisplay/images/paging/prev.png"/></a> <input type="textbox" id="page_number" placeholder="page"/> <a href="#" id="go"><img src="http://www.flashaddicts.com/clientdisplay/images/paging/go.png"/></a> <a href="#" id="next"><img src="http://www.flashaddicts.com/clientdisplay/images/paging/next.png"/></a> <a href="#" id="last"><img src="http://www.flashaddicts.com/clientdisplay/images/paging/last.png"/></a> </div> </header> <div class="container" align="center"> <div class="loader">Loading..</div> <img src=""/> </div> <footer> <div class="pages"> <span class="image_number">3</span> of <span class="total_images"></span> </div> </footer> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Paging - Script Codes CSS Codes
*{margin:0px; padding:0px;}
body{ font-family: Arial, sans-serif; background-color:#ccc; overflow:hidden; float:left;
}
img{border:0px;max-width:100%}
header, footer{ background-color:#fff; height:50px; width:100%; position:absolute;
}
.loader{z-index:2;text-align:center;position:absolute;margin:0 auto;left:50%;top:200px;font-weight:bold;}
.container{width:100%;background-color:#000;position:absolute;top:50px;overflow-x:hidden;}
.container img{margin:0 auto;}
.pages{background-color:#ccc;float:right;padding:3px 5px;font-size:0.7em;font-weight:bold;margin:5px;}
footer{bottom:0;height:30px;}
.toolbar{width:285px;position:relative;margin:0 auto;padding-top:10px;}
.toolbar a{float:left;margin-left:5px;}
.toolbar input{float:left;margin-top:5px;margin-left:10px;margin-right:5px;width:80px;border:none;background-color:#ccc;text-align:center;padding:2px;}
Paging - Script Codes JS Codes
$( document ).ready(function() { $('.container').height(($( window ).height()-$('header').height()-$('footer').height())+'px'); var imgPath = ["learning_from_jquery-1","learning_from_jquery-2","learning_from_jquery-3","learning_from_jquery-4","learning_from_jquery-5","learning_from_jquery-6","learning_from_jquery-7","learning_from_jquery-8","learning_from_jquery-9","learning_from_jquery-10"]; var firstBtn = $('#first'); var prevBtn = $('#prev'); var nextBtn = $('#next'); var lastBtn = $('#last'); var goBtn = $('#go'); var counter=0; firstBtn.click(function(){ counter = 0; loadImage(); }); prevBtn.click(function(){ counter--; loadImage(); }); nextBtn.click(function(){ counter++; loadImage(); }); lastBtn.click(function(){ counter = (imgPath.length-1); loadImage(); }); goBtn.click(function(){ if(!isNaN($('#page_number').val())){ counter = $('#page_number').val()-1; loadImage(); } }); $('#page_number').bind({ 'keyup':function(e){ if(e.keyCode==13){ goBtn.trigger('click'); } } }); $('html').bind({ 'keyup':function(e){ if(e.keyCode==37){ prevBtn.trigger('click'); } if(e.keyCode==39){ nextBtn.trigger('click'); } } }); function loadImage(){ counter=(counter<0)?0:counter; counter=(counter>(imgPath.length-1))?(imgPath.length-1):counter; $('.container img').attr('src','http://www.flashaddicts.com/clientdisplay/images/paging/'+imgPath[counter]+'.jpg'); $('.image_number').text(counter+1); $('.container .loader').css('opacity','1'); $('.container').scrollTop(0); $('.container img').load(function(){ $('.container .loader').css('opacity','0'); }); } loadImage(); $('.total_images').text(imgPath.length); $( window ).resize(function() { $('.container').height(($( window ).height()-$('header').height()-$('footer').height())+'px'); });
});
Developer | Krishna Babu |
Username | krishnab |
Uploaded | January 11, 2023 |
Rating | 3 |
Size | 2,753 Kb |
Views | 4,048 |
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 |
CSS3 Timeline | 3,032 Kb |
Image Swaping | 2,316 Kb |
Slide Transition | 2,236 Kb |
Customize Selector with Google Font | 2,448 Kb |
Floating menu | 2,077 Kb |
Fade out slideshow | 2,082 Kb |
Flat UI Color Gradients | 1,821 Kb |
Justify Horizontal Menu | 2,589 Kb |
Css3 shapes | 2,518 Kb |
Simple css3 loader | 1,624 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 |
CSSOff 2013 Submission | Codewunder | 14,766 Kb |
Scroll to top button | DominicFrancois | 3,743 Kb |
Fluid Layout with Float | Jxqr97 | 1,785 Kb |
Slider for stackoverflow | KKOKU | 3,222 Kb |
Login-ng-modal | Heedoo | 3,566 Kb |
Animated Logo | Shakdaniel | 2,672 Kb |
Exploring css spinners | Akagr | 3,569 Kb |
Expandable Left Side Bar with jQuery animate | Retrofuturistic | 2,483 Kb |
Flex layout example | Mofny | 1,663 Kb |
Falling Down the Rabbit Hole | Rachelnabors | 4,578 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!