我有一个SlidingUpPanelLayout,它将图像保存为顶视图,还有一个需要滑动的视图寻呼机.它viewpager有3个片段,其中两个是列表视图.所以我希望能够在拉起时扩展视图寻呼机,一旦视图寻呼机启动,我希望能够scrollviews在片段内部滚动.但是当拉下来scrollview以防万一没有滚动时,我想开始崩溃viewpager.因此SlidingUpPanelLayout,如果没有更多要滚动的内容,请建议如何在拉动滚动视图时进行折叠?
在这里,我发布了一些代码:我尝试捕获触摸事件并onInterceptTouchEvent以下列方式覆盖SlidingUpPanel 函数:
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (isHandled) {
Log.i("interceptToch", "HEREEE");
return onTouchEvent(ev);
}
return false;
}
Run Code Online (Sandbox Code Playgroud)
所以当SlidingUpPanelLayout扩展时,我设置了isHandled = false.因此,当slidingUpPanelLayout展开时,所有触摸事件都将传递给其子视图.
而且我也放入onTouchEvent了scrollView,以便解锁SlidingUpPanelLayout.onInterceptTouchEvent:
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
if (action == MotionEvent.ACTION_DOWN) {
scroll = 0;
y = event.getY();
} else if (action == MotionEvent.ACTION_MOVE) {
if (scroll_view_summary.getScrollY() == 0 && …Run Code Online (Sandbox Code Playgroud) android slideup android-sliding android-scrollview android-event
我正在开发应该使用导航抽屉作为菜单 bur 以获得更好的用户体验的应用程序我决定用滑动面板替换导航抽屉。
我的观点在这张图片中
现在我想用圆角制作这个菜单,我使用了带有cornerRadius 属性的CardView,但没有正常工作。
这是我的向上滑动面板的 xml 代码
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:umanoPanelHeight="0dp"
sothree:umanoShadowHeight="0dp"
android:id="@+id/SlidingUpPanel">
</com.sothree.slidinguppanel.SlidingUpPanelLayout>Run Code Online (Sandbox Code Playgroud)
在 Facebook Messenger 应用程序中可以看到相同的设计:
欢迎任何想法,提前致谢...
PS:我使用的库链接:Github library
那些想要所有布局的人:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/SlidingUpPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:umanoPanelHeight="0dp"
sothree:umanoShadowHeight="0dp">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#345D7D" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="300dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.33333">
<ImageButton
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerInParent="true"
android:background="?attr/selectableItemBackgroundBorderless"
android:scaleType="fitXY"
android:src="@drawable/quran_icon" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.33333">
<ImageButton
android:layout_width="125dp"
android:layout_height="125dp" …Run Code Online (Sandbox Code Playgroud)我正在尝试使用标题和内容创建两个div,当我单击标题时,内容应该向上滑动以隐藏自身.
你可以在JSFiddle上找到我的代码.
我的HTML:
<div id="left-content">
<div class="news-block">
<div class="block-head">News membres</div>
<div class="block-content"></div>
</div>
<div class="news-block">
<div class="block-head">News premium & VIP</div>
<div class="block-content"></div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我的JavaScript:
jQuery(document).ready(function($){
$('div.news-block').on('click', '.block-head', function(){
var content = $(this).parent().find('div.block-content');
if (content.is(':visible'))
content.slideUp("slow");
else
content.slideDown("slow");
});
});
Run Code Online (Sandbox Code Playgroud)
我红了一些帖子说你不能在tbody上使用slideUp()作为例子,或者在浮动div上,但正如你所看到的,我的"内容"div不浮动,这就是为什么我不明白为什么它是不工作
你有什么主意吗 ?
谢谢.
scriptaculous wiki有一个演示(http://github.com/madrobby/scriptaculous/wikis/effect-slidedown),显示正在使用的SlideDown效果.但是,如果隐藏了某个DIV,我需要使用相同的链接向下滑动,如果显示DIV,则需要使用SlideUp.
我该如何实现这一目标?
谢谢.
我有一个关于jquery slideDown,SlideUp的简单问题.我正在使用slideDown在点击时滑动div,就像
$("#box").slideDown("slow");
Run Code Online (Sandbox Code Playgroud)
我怎么能这样做,以便如果#box已经滑落,它应该再次点击滑动?谢谢.
.slideDown工作正常.第二次单击链接时,会再次出现.slideDown动画而不是.slideUp.请帮我一把 谢谢.
$(document).ready(function() {
$('#toggleButton').click(function() {
if ($('#toggleSection').is(":hidden")) {
$('#toggleSection').slideDown("slow");
}
else {
$('#toggleSection').slideUp("slow");
}
return false;
});
});
Run Code Online (Sandbox Code Playgroud)
以下是整个模块的代码.这个php包含在主页面上,其中还包含页眉和页脚.
<?php
/*
Written by: Daniel Kassner
Website: http://www.danielkassner.com
Originally posted on: http://www.wlscripting.com
Date: 09-13-2007 and last updated: 05-21-2010
*/
if (!function_exists('format_phone_us')) {
function format_phone_us($phone = '', $convert = true, $trim = true)
{
// If we have not entered a phone number just return empty
if (empty($phone)) {
return false;
}
// Strip out any extra characters that we do …Run Code Online (Sandbox Code Playgroud) 我做了一个简单的鼠标输入和鼠标离开动画.当你鼠标输入div.比链接div更开放.当你鼠标移出时,div将关闭.我用slideUp和slideDown设置了一个动画.
我的动画有问题.页面上有很多.comment div.当我快速将鼠标悬停在物品上时.幻灯片动画很疯狂,你很多时候都会看到动画.我该如何解决这个问题?谢谢!
$("#comments .comment .links").hide();
$("#comments .comment").mouseenter(function() {
$(".links",this).slideDown(300);
}).mouseleave(function() {
$(".links",this).slideUp(300);
});
Run Code Online (Sandbox Code Playgroud) 我刚从StackExchange上读到了这个问题和答案,但解决方案对我不起作用.
这不起作用:
$("#top_slide").slideUp(5000, "easeInOutQuart");
Run Code Online (Sandbox Code Playgroud)
但这确实有效:
$("#top_container").animate({height: headerHeight}, 5000, "easeInOutQuart");
Run Code Online (Sandbox Code Playgroud)
我正在使用最新的jQuery-1.10.2.js.
有什么想法吗?
//
我添加了这样的缓动插件,它在jsfiddle中工作:
<script src="js/jquery-1.10.2.js"></script>
<script src="js/jquery.easing.1.3.js"></script>
<script src="js/jquery.easing.compatibility.js"></script>
<script src="js/jquery.easing.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
脚本代码是这样的:
$("#top_slide").slideUp({ duration: 5000, easing: "easeInOutQuart" });
Run Code Online (Sandbox Code Playgroud)
我仍然得到这个错误:
Uncaught TypeError: Object #<Object> has no method 'easeInOutQuart'
rr.run jquery.js:9216
l jquery.js:8914
x.fx.timer jquery.js:9511
er jquery.js:8981
a jquery.js:9305
x.extend.dequeue jquery.js:3948
(anonymous function) jquery.js:3991
x.extend.each jquery.js:657
x.fn.x.each jquery.js:266
x.fn.extend.queue jquery.js:3984
x.fn.extend.animate jquery.js:9316
x.fn.(anonymous function) jquery.js:9442
(anonymous function) playingWithjQuery.php:38
c jquery.js:3048
p.fireWith jquery.js:3160
x.extend.ready jquery.js:433
q
Run Code Online (Sandbox Code Playgroud)
提前致谢!
//
我把它改成了一个div,这是我的html,这里是 …
我正在尝试制作类似于Google / Apple Maps屏幕的东西。我刚刚开始在Flutter中进行实验,很难理解“可拖动小部件”。有人可以给我示例代码,让我学习他们如何制作其上推视图。我找不到。
我有一个简单的图片库,其中 figcaption 隐藏在每个图像上。这是 HTML:
<figure>
<img src="gallery/reef2.jpg" width="400" height="285" alt="Another beautiful example of the Great Barrier Reef"/>
<figcaption>Another cracking shot of the reef from Mark. <span>[Photographer: Mark Willams]</span></figcaption>
</figure>
Run Code Online (Sandbox Code Playgroud)
这是它的jQuery:
$("figcaption").hide();
$("figure").each(function() {
$(this).hover(function() {
$(this).find("figcaption").slideDown('slow');
}, function() {
$(this).find("figcaption").slideUp('slow');
});
});
Run Code Online (Sandbox Code Playgroud)
不幸的是,当我将鼠标悬停在图像上并远离图像时,什么也没有发生。当我打开 Chrome 的开发人员工具时,我可以看到在悬停时我收到以下消息:
“未捕获的类型错误:$(...).find(...).slideDown 不是函数”
当我将鼠标悬停在图像之外时,我收到以下消息:
“未捕获的类型错误:$(...).find(...).slideUp 不是函数”
我不确定为什么 slideDown 和 slideUp 不能正常工作,因为 figcaption 被隐藏了。在使用 slideDown 和 slideUp 之前,我使用了完美的显示和隐藏。请帮助我了解如何让 slideDown 和 SlideUp 正常工作。