- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 fullpage.js 生成全屏滑动网站。
我有四个 sections
,其中有四个导航点作为插件生成的 li
。第一个 li a
链接到 first section
,第二个 li a
链接到 second section
,等等。
section1 li a
section2 li a
section3 li a
section4 li a
点击 section3
被移除。现在我的部分少于导航点。
section1 li a
section2 li a
section4 li a
li a
出于某种原因,我需要第四个 li a
仍然能够链接到 section4
。
虽然我想在有人点击 third li a
时触发函数 restoreSection3()
有人可以帮我解决这个问题吗?您可以查看 jsfiddle example 以便更好地理解。尝试删除 section3
并使用右侧的导航。
最佳答案
一种可能的解决方案是,不是通过切换其显示
来移除幻灯片,而是通过将其高度
设置为0 来移除幻灯片,并隐藏其内容溢出。
像这样:
function removeSection3() {
// hide it by setting a height of 0, hiding overflow, and setting display to `block`
$("#f03").css({ display:"block", height:0, overflow:"hidden"});
silentScroll($('.fp-section.active').position().top);
}
function restoreSection3() {
// resetting the display to `table` will make the overflow visible again
$("#f03").css({ display:"table"});
silentScroll($('.fp-section.active').position().top);
}
您可以在这个 JSFiddle 上看到该代码的演示:http://jsfiddle.net/97tbk/616/
现在,当您单击第 4 个链接时,它会转到第 4 部分。不利的一面是,当您单击第 3 个链接时,它也会转到第 4 部分。因此,让我们通过添加一个事件监听器来完成请求,该事件监听器将在单击第三个 li a
时触发 restoreSection3()
:
$("#fp-nav li:nth-child(3) a").on("click", function() {
// we restore section 3 by simulating clicking on the "Restore Section 3" button
$('button#first').click();
});
所以最后的代码应该是这样的:
function removeSection3() {
// hide it by setting a height of 0 and hiding the overflow
$("#f03").css({ display:"block", height:0, overflow:"hidden"});
// add an event listener, so when the third link is clicked, section 3 will be restored
$("#fp-nav li:nth-child(3) a").on("click", function() {
// we restore by simulating clicking on the "Restore Section 3" button
$('button#first').click();
});
silentScroll($('.fp-section.active').position().top);
}
function restoreSection3() {
// reset the display to table will make the overflow visible again
$("#f03").css({ display:"table"});
silentScroll($('.fp-section.active').position().top);
}
您可以看到它在另一个 JSFiddle 上工作:http://jsfiddle.net/97tbk/618/
现在,当您单击左侧的导航栏时,一切都按预期工作,尽管当您使用鼠标滚轮时它仍然看起来有点古怪:因为第 3 部分不会启用,当第三个和第四个链接处于事件状态,将显示第 4 部分。这种情况下的预期行为是什么?
不是想质疑你这样做的理由,但在可用性方面,删除第三部分和第三个导航链接可能会更好,因为如果用户看到 4 个导航链接但只有 3 个,他们可能会感到困惑滚动时的部分。
关于javascript - 将导航绑定(bind)到全屏幻灯片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30527504/
我正在尝试使用 Qt 制作游戏,因为它太棒了 ;) 而且您可以免费获得所需的所有东西。唯一的问题是更改系统分辨率和设置 QWidget(或 QGLWidget)“真正的”全屏。 你们中有人成功地做到了
有没有办法以全屏模式(没有工具栏、导航)启动 gwt-app? 我只找到了打开新窗口的提示: Window.open("SOMEURL","SOMETITLE", "fullscreen=yes
if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscr
我想解释一下我现在在做什么。我开发了一个 aar(sdk) 并且运行良好。但是,我希望我的 sdk 在被调用时占据全屏,即使调用者有一个工具栏。我尝试了此链接中的示例 [ How to set act
我是 Blazor 的新手,我正在尝试了解如何以全屏模式打开浏览器。我知道我可以执行 Javascript 中断并运行 Javascript,但这违背了 Blazor 的目的。 如何在 Blazor
我正在创建一个全屏应用程序,并且想知道是否有某种方法可以使 NSAlert 位于我创建的 CGDisplayCapture 之上。现在,NSAlert 显示在显示捕获后面。我的主窗口显示得很好(在使用
有人可以解释一下下面的代码是如何工作的吗? 元素指的是视频,全屏指的是页面上的链接。 我无法理解 if 语句 var element = document.getElementById('elemen
我想要实现的是类似于 Instagram 应用内网络浏览器,在您点击广告时使用: 我所做的是,我使用了 WebView bottomSheetDialogFragment,并覆盖了 onCreateD
第二个 ViewController 的顶部有这个空间,它几乎在手机上显示为可关闭的弹出窗口。如何使全屏显示(删除橙色箭头指向的空间)? 最佳答案 这是 iOS 13 的一项更改。用户将开始期望能够滑
我正在尝试在全屏模式下使用 emacs 并使用合适的字体。我有一台运行 Ubuntu 的基于 nvidia 的笔记本电脑。首次加载时,字体很大,认为是 16pt 字体。我使用菜单选项设置了合适的字体(
我有一个 GridView,我使用 BaseAdapter 来调整我的 GridView 中的图像和文本。我有一个问题,当我运行我的应用程序时,我的“GridView”有左、右、上和下边距。我不需要这
是否可以在全屏模式下使用 Android Studio 例如只有我们编码的那个字段应该显示在整个屏幕上。 像这样: 最佳答案 您可以使用“无干扰模式”: 关于全屏 Android Studio,我们在
我正在制作一个应用程序,当手机处于纵向时,我需要 fragment 显示菜单栏(带有设置快捷方式等),但当它处于横向时,我需要全屏。 因此,我有一个管理 2 个 fragment 的 Activity
我想知道是否可以在没有标签栏和导航栏的情况下全屏推送 NavigationController 的 ViewController。我的问题如下: 我的应用在 TabBarController 中嵌入了
我制作了一个1920 * 1048的flash(16:9的屏幕),并将其嵌入到html中喜欢: 问题是: 在 4:3 屏幕中,flash 的宽度为 100%,但顶部和底部有白色填充。看来闪光灯
我想制作一个同时包含多个文本的HTML5视频。 文本应该以不同的css布局(文本颜色、字体、阴影)显示在视频的不同位置(同时) 我试过这个教程http://www.artandlogic.com/bl
需要一些帮助。 我需要水平滑动一次长图像,然后再水平滑动回来...我在这里学习了一个教程 https://css-tricks.com/creating-a-css-sliding-backgroun
我正在制作一个简单的登录页面,并试图将以下图像作为背景全屏:image 我的 CSS 目前看起来像这样: body { background-image: url('/images/bg.jp
我想用透明色覆盖我的背景图片,但颜色没有覆盖背景图片。 这是我的演示: http://jsfiddle.net/farna/73kx2/ CSS 代码: .overlay{ backgroun
有什么方法可以隐藏状态栏并保持操作栏可见吗? 最佳答案 是的,有。您应该在 Activity 的 onCreate 方法中设置 FLAG_FULLSCREEN。 @Override public vo
我是一名优秀的程序员,十分优秀!