我有以下滚动脚本,滚动页面很好,工作正是我想要的.
$(function(){
$('a[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) {
var targetOffset = $target.offset().top;
$('html,body').animate({scrollTop: targetOffset}, 1000);
return false;
}
}
});
});
Run Code Online (Sandbox Code Playgroud)
但是,我需要它忽略顶部说200px,因为我在页面顶部有一个固定的标题,内容滚动后面.
这意味着,当我滚动到顶部时,它将内容滚动到固定标题后面,所以我看不到它,所以我需要它滚动到标题下方..所以将标题的底部视为浏览器的顶部我假设....
可以这样做,因为它会非常方便吗?
非常感谢任何帮助
是否有任何教程或插件可以在网站正确加载后将网站淡入视图,以限制任何震动等,因此内容基本上是否流畅?
我想如果它只是一个特定区域会更容易,因为页面或页脚已经被缓存,从之前的页面...
例如,具有各种缩略图的投资组合页面,它们仅在准备好时才会显得平滑.
可以这样做吗?
感谢您的任何帮助 :)
在除联系页面之外的所有页面上,我希望它在inc-header.php include中显示以下内容.
<p><a href="contact.php">Contact</a></p>
Run Code Online (Sandbox Code Playgroud)
在页面上contact.php,我希望它显示:
<p><a href="index.php">Home</a></p>
Run Code Online (Sandbox Code Playgroud)
这可能是正确的吗?
普通的懒加载插件:
$(function() {
$("img").lazyload({
placeholder : "img/grey.gif",
effect : "fadeIn"
});
});
Run Code Online (Sandbox Code Playgroud)
我可以控制方面的速度fadeIn说0.9或1秒吗?
那可能吗?
我正在进行简单的幻灯片切换以获取更多链接,然后展开一个无读取链接.
完全像这样,但需要向下滑动,而不是像这样.
无论是通过单词还是盒子高度,都需要设置初始高度.
任何想法,实现起来相当简单吗?
谢谢你的帮助 :)
jquery ×4
fade ×1
html ×1
if-statement ×1
javascript ×1
lazy-loading ×1
load ×1
php ×1
slide ×1
toggle ×1