$(function () {
$('a[href*="#"]:not([href="#"])').click(function () {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
<a class="initialism fadeandscale_open btn btn-success" href="#fadeandscale">Fade & scale</a>
<div id="fadeandscale" class="well">
<h4>Fade & scale example</h4>
<pre class="prettyprint">
<code>$('#fadeandscale').popup({
transition: 'all 0.3s'
});</code>
</pre>
<pre class="prettyprint">
<code>#fadeandscale {
transform: scale(0.8);
}
.popup_visible #fadeandscale {
transform: scale(1);
}</code>
</pre>
<button class="fadeandscale_close slide_open btn btn-default">Next example</button>
<button class="fadeandscale_close btn btn-default">Close</button>
</div>
<script>
$(document).ready(function poppy() {
$('#fadeandscale').popup({
pagecontainer: '.butt',
transition: 'all 0.3s'
});
});
</script>