Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Demo ISOTOPE</title>
- <style type="text/css">
- body {
- margin: 0;
- padding: 0;
- }
- .wraper {
- width: 90%;
- margin: 10px auto;
- }
- /****** Navigation styling *******/
- .iso-nav {
- text-align: center;
- }
- ul li {
- list-style: none;
- margin: 0;
- padding: 0;
- display: inline-block;
- padding: 10px 15px;
- border: 1px solid #5274a9;
- cursor: pointer;
- -webkit-transition: all .5s ease;
- -moz-transition: all .5s ease;
- -ms-transition: all .5s ease;
- transition: all .5s ease;
- }
- ul li:hover {
- background: #5274a9;
- color: #fff;
- }
- /****** Main portfilio styling ********/
- .main-iso {
- width: 100%;
- }
- .main-iso .item {
- width: 303px;
- float: left;
- margin-bottom: 10px;
- }
- .active {
- background: #5274a9;
- color: #fff;
- }
- </style>
- </head>
- <body>
- <div class="wraper">
- <div class="iso-nav">
- <ul>
- <li class="active" data-filter="*">All Items</li>
- <li data-filter=".web">Web Design</li>
- <li data-filter=".graphic">Graphic Design</li>
- <li data-filter=".photo">Photography</li>
- </ul>
- </div>
- <div class="main-iso">
- <div class="item web">
- <img src="img/image_1.jpg" alt="">
- </div>
- <div class="item graphic">
- <img src="img/image_2.jpg" alt="">
- </div>
- <div class="item photo">
- <img src="img/image_1.jpg" alt="">
- </div>
- <div class="item">
- <img src="img/image_2.jpg" alt="">
- </div>
- <div class="item web">
- <img src="img/image_1.jpg" alt="">
- </div>
- <div class="item web">
- <img src="img/image_2.jpg" alt="">
- </div>
- <div class="item graphic">
- <img src="img/image_1.jpg" alt="">
- </div>
- <div class="item photo">
- <img src="img/image_2.jpg" alt="">
- </div>
- </div>
- </div>
- <!-- Javascript files are here... -->
- <!--Jquery CDN -->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
- <!--isotope here...-->
- <script src="'//cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.6/isotope.pkgd.min.js"></script>
- <!--isotope image messedup...
- <script src="//unpkg.com/imagesloaded@4/imagesloaded.pkgd.min.js"></script>-->
- <!--Custom Js file here ... -->
- <script type="text/javascript">
- //Isotope active js code:
- //************************
- // Active isotope with jQuery code:
- $('.main-iso').isotope({
- itemSelector: '.item',
- layoutMode: 'fitRows'
- });
- <!--If isotope image messedup...-->
- /*$('.container').imagesLoaded( function() {
- $('.main-iso').isotope({
- itemSelector: '.item',
- layoutMode: 'fitRows'
- });
- });*/
- // Isotope click function
- $('.iso-nav ul li').click(function(){
- $('.iso-nav ul li').removeClass('active');
- $(this).addClass('active');
- var selector = $(this).attr('data-filter');
- $('.main-iso').isotope({
- filter: selector
- });
- return false;
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment