Response title
This is preview!
It work's but only when all the accordion items are closed when you click on the image. If one of the accordion items is already open then the scroll function goes too far or to a random place down the page.
How can I make this scroll to anchor acurate?
Above is the full code used. Each image has the class of 'tab-trigger-mobile'.
Thank you
$(function(){ var $container = $('#container'); // add randomish size classes - $container.find('.item').each(function(){ var $this = $(this), number = parseInt( $this.find('.number').text(), 10 ); if ( number % 7 % 2 === 1 ) { $this.addClass('width2'); } if ( number % 3 === 0 ) { $this.addClass('height2'); } }); $container.isotope({ itemSelector: '.item', masonry : { columnWidth: 240 } }); });
<div id="container"> <div class="item"><p class="number">20</p></div> <div class="item"><p class="number">2</p></div> <div class="item"><p class="number">2</p></div> <div class="item"><p class="number">3</p></div> <div class="item">...</div> <div class="item">...</div> <div class="item">...</div> <div class="item">...</div> <div class="item">...</div> <div class="item">...</div> </div>
.item { width:200px; height:200px; background:#f00; margin:10px; } .width2 { width:420px; height:420px; } /**** Isotope Filtering ****/ .isotope-item { z-index: 2; } .isotope-hidden.isotope-item { pointer-events: none; z-index: 1; } /**** Isotope CSS3 transitions ****/ .isotope, .isotope .isotope-item { -webkit-transition-duration: 0.8s; -moz-transition-duration: 0.8s; -ms-transition-duration: 0.8s; -o-transition-duration: 0.8s; transition-duration: 0.8s; } .isotope { -webkit-transition-property: height, width; -moz-transition-property: height, width; -ms-transition-property: height, width; -o-transition-property: height, width; transition-property: height, width; } .isotope .isotope-item { -webkit-transition-property: -webkit-transform, opacity; -moz-transition-property: -moz-transform, opacity; -ms-transition-property: -ms-transform, opacity; -o-transition-property: -o-transform, opacity; transition-property: transform, opacity; } /**** disabling Isotope CSS3 transitions ****/ .isotope.no-transition, .isotope.no-transition .isotope-item, .isotope .isotope-item.no-transition { -webkit-transition-duration: 0s; -moz-transition-duration: 0s; -ms-transition-duration: 0s; -o-transition-duration: 0s; transition-duration: 0s; }
<script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script> <script src="js/libs/slimbox2.js"></script>
<li><a href="#" class="library" rel="#overtwo"></a></li> <div class="simple_overlay" id="overtwo"> <p>Contents of my overlay</p> </div>
$("a[rel]").overlay();
<a href="img/slideshow/slide1.png" class="gallery" rel="lightbox"></a> <a href="img/slideshow/slide2.png" class="gallery" rel="lightbox"></a>
// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED) if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) { jQuery(function($) { $("a[rel^='lightbox']").slimbox({ overlayOpacity: 0.6, loop: "true" }, null, function(el) { return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); }); }); }
© 2013 jQuery Foundation
Sponsored by and others.