jCarousel 图像不显示在 jQuery 滑块中
我有一个 jQuery 滑动面板,其中未显示 jQuery 轮播。
示例:http://www.warface.co.uk/clients/warface。 co.uk/
单击显示仪表板以显示滑动面板。
我显示了按钮(上一个/下一个),但没有显示轮播。例如,我也添加了下面的轮播。
我有滑动面板的 CSS
#panel {
width: 100%;
height: 500px;
color: #999999;
background: #272727;
overflow: hidden;
position: relative;
z-index: 3;
display: none;
}
,似乎删除了 display: none;
修复了它,但在页面加载时使滑块向下。
I have a jQuery sliding panel that is not displaying a jQuery carousel within it.
Example: http://www.warface.co.uk/clients/warface.co.uk/
Click Show Dashboard to display the Sliding Panel.
I have the buttons (previous/next) displaying but not the carousel. I have added the carousel below also for example.
I have the CSS for the sliding panel
#panel {
width: 100%;
height: 500px;
color: #999999;
background: #272727;
overflow: hidden;
position: relative;
z-index: 3;
display: none;
}
and it seems removing display: none;
fixes it but leaves the slider down on page load.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
破解它:
您需要使用高度而不是显示来隐藏面板,如下所示:
然后通过将高度更改为 500 使您的 JS 在 js 中显示它,使您的 JS 如下:
注意附加的 PreventDefault() ,它可以防止页面跳转到顶部,当我在 jsfiddle 中尝试它时,这是必要的,但在实时应用程序中可能不需要,尽管如此,这通常是很好的做法。如果您想查看它的实际效果,可以在这里进行:http://jsfiddle.net/LiamBailey/ ERQzd/87/ 注意:由于 jsfiddle 中的窗口大小有限,您必须向下滚动才能到达关闭面板链接,从而导致您无法看到面板向上滑动,因为 PreventDefault,为了解决此问题,我添加了向上滚动一点
$("html,body").animate({scrollTop: target},"fast");
但是您不需要这些,因为关闭面板链接在没有向下滚动。Cracked it:
You need to hide your panel using height instead of display, like so:
Then show it in js by changing height to 500 making your JS this:
Note the additon of preventDefault() which prevents the page from jumping to the top, which was neccesary when I was trying it in jsfiddle, but prob won't be needed in live application, none the less it is generally good practice. If you want to see it in action you can do so here: http://jsfiddle.net/LiamBailey/ERQzd/87/ note: because of the limited window size in jsfiddle, you have to scroll down to get to the close panel link leaving you unable to see the panel sliding back up because of preventDefault, to fix this I added a little scroll up
$("html,body").animate({scrollTop: target},"fast");
But none of that will be needed for you as the close panel link is visible without scrolling down.