- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有一个加载更多按钮,可以在单击时加载 10 个新的隐藏 div,问题是我有 40 个隐藏 div,并且按钮设置在 40's div 的末尾,即使它们是隐藏的,我只想要它的位置直接在最后显示的 div 下面,所以当你点击它时,它应该加载 10 个隐藏的 div,然后直接向下设置在最后一个新显示的 div 下面。有任何想法吗?
这里是 html 代码(不是应该在单击按钮时显示的隐藏 div's 的 div:
<html>
<head>
<script src="jquery-1.12.0.min.js"></script>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<link rel="stylesheet" type="text/css" href="leb news.css">
<title> leb news</title>
</head>
<div class="all" dir="rtl" lang="ar">
<body>
<div class="header">
<h1>
اخبار لبنان
<img src="paper.gif" alt="paper" height="115" />
LebNews
</h1>
</div>
<div class="clockall">
<div class="clock">
<div class="list">
<TABLE id="T_Menu" height="100%" cellSpacing="0" cellPadding="0" width="181" border="0" style="float: right">
<TD height="100%" vAlign="top" rowSpan="2" width="181" align="center">
<TABLE id="T_Menu" height="100%" cellSpacing="0" cellPadding="0" width="181" border="0">
<TR>
<TD style="BACKGROUND-IMAGE: url(Images/Menu/bgd.gif); BACKGROUND-ATTACHMENT: fixed; BACKGROUND-REPEAT: no-repeat; BACKGROUND-POSITION: left top"
vAlign="top" align="center" bgColor="transparent" height="100%"> <TABLE id="T_Menu" cellSpacing="0" cellPadding="0" width="80%" border="0">
<TR>
<TD vAlign="middle" align="center" height="100"><BR>
</TD>
</TR>
<TR>
<TD></TD>
</TR>
<TR>
<TD align="center"><table cellspacing="0" rules="all" border="1" id="Menu1_Ad_menu" style="border-collapse:collapse;">
<tr align="Center" style="color:#ffa500;background-color:#ffa500;border-width:0px;border-style:Groove;font-family:Trebuchet MS;font-size:12pt;font-weight:bold;">
<td>
<input type="submit" name="Menu1:Ad_menu:_ctl1:ad_button" value="الرئيسية" id="Menu1_Ad_menu__ctl1_ad_button" style="color:#2C00A8;background-color:Transparent;border-color:#2C00A8;border-width:0px;font-family:Trebuchet MS;font-size:20pt;font-weight:bold;width:150px;" />
</td>
</tr><tr style="font-family:Trebuchet MS;font-size:10pt;">
<td>
<input type="submit" name="Menu1:Ad_menu:_ctl2:ad_button" value="اخبار" id="Menu1_Ad_menu__ctl2_ad_button" style="color:#2C00A8;background-color:Transparent;border-color:#2C00A8;border-width:0px;font-family:Trebuchet MS;font-size:20pt;font-weight:bold;width:150px;" />
</td>
</tr><tr style="font-family:Trebuchet MS;font-size:10pt;">
<td>
<input type="submit" name="Menu1:Ad_menu:_ctl3:ad_button" value="فن" id="Menu1_Ad_menu__ctl3_ad_button" style="color:#2C00A8;background-color:Transparent;border-color:#2C00A8;border-width:0px;font-family:Trebuchet MS;font-size:20pt;font-weight:bold;width:150px;" />
</td>
</tr><tr style="font-family:Trebuchet MS;font-size:10pt;">
<td>
<input type="submit" name="Menu1:Ad_menu:_ctl4:ad_button" value="رياضة" id="Menu1_Ad_menu__ctl4_ad_button" style="color:#2C00A8;background-color:Transparent;border-color:#2C00A8;border-width:0px;font-family:Trebuchet MS;font-size:20pt;font-weight:bold;width:150px;" />
</td>
</tr><tr style="font-family:Trebuchet MS;font-size:10pt;">
<td>
<input type="submit" name="Menu1:Ad_menu:_ctl5:ad_button" value="أدب" id="Menu1_Ad_menu__ctl5_ad_button" style="color:#2C00A8;background-color:Transparent;border-color:#2C00A8;border-width:0px;font-family:Trebuchet MS;font-size:20pt;font-weight:bold;width:150px;" />
</td>
</tr><tr style="font-family:Trebuchet MS;font-size:10pt;">
<td>
</table>
</table>
</table>
</table>
</div>
<div class="article" align="right" style="display: inline-block;" >
<br>
<div class="27" style="display:none; border-style:solid; border-color:aqua; border-width:3px; border-height:150px">
<article>
<a href="/link-to-article/" title="article title">
<img src="paper.gif" alt="article title" align="right" border="2">
<h2>Article title</h2>
<p>Short description</p>
</a>
</article>
</div>
<br>
<br>
<br>
<div class="28" style="display:none; border-style:solid; border-color:aqua; border-width:3px; border-height:150px">
<article>
<a href="/link-to-article/" title="article title">
<img src="paper.gif" alt="article title" align="right" border="2">
<h2>Article title</h2>
<p>Short description</p>
</a>
</article>
</div>
<br>
<br>
<br>
<div class="29" style="display:none; border-style:solid; border-color:aqua; border-width:3px; border-height:150px">
<article>
<a href="/link-to-article/" title="article title">
<img src="paper.gif" alt="article title" align="right" border="2">
<h2>Article title</h2>
<p>Short description</p>
</a>
</article>
</div>
<br>
<br>
<br>
<div class="30" style="display:none; border-style:solid; border-color:aqua; border-width:3px; border-height:150px">
<article>
<a href="/link-to-article/" title="article title">
<img src="paper.gif" alt="article title" align="right" border="2">
<h2>Article title</h2>
<p>Short description</p>
</a>
</article>
</div>
<br>
<br>
<br>
<div class="31" style="display:none; border-style:solid; border-color:aqua; border-width:3px; border-height:150px">
<article>
<a href="/link-to-article/" title="article title">
<img src="paper.gif" alt="article title" align="right" border="2">
<h2>Article title</h2>
<p>Short description</p>
</a>
</article>
</div>
<br>
<br>
<br>
<div class="32" style="display:none; border-style:solid; border-color:aqua; border-width:3px; border-height:150px">
<article>
<a href="/link-to-article/" title="article title">
<img src="paper.gif" alt="article title" align="right" border="2" >
<h2>Article title</h2>
<p>Short description</p>
</a>
</article>
</div>
<br>
<br>
<br>
<div class="33" style="display:none; border-style:solid; border-color:aqua; border-width:3px; border-height:150px">
<article>
<a href="/link-to-article/" title="article title">
<img src="paper.gif" alt="article title" align="right" border="2">
<h2>Article title</h2>
<p>Short description</p>
</a>
</article>
</div>
<br>
<br>
<br>
<div class="34" style="display:none; border-style:solid; border-color:aqua; border-width:3px; border-height:150px">
<article>
<a href="/link-to-article/" title="article title">
<img src="paper.gif" alt="article title" align="right" border="2">
<h2>Article title</h2>
<p>Short description</p>
</a>
</article>
</div>
<div class="button">
<button type="button" name="more" id="load">More</button>
</div>
</body>
</html>
这里是按钮的 jquery:
$(document).ready(function(){
$("div").slice(0, 14).show(); // select the first ten
$("#load").click(function(e){ // click event for load more
e.preventDefault();
$("div:hidden").slice(0, 10).show();
// select next 10 hidden divs and show them
if($("div:hidden").length == 0){ // check if any hidden divs still exist
alert("No more divs"); // alert if there are none left
}
});
})
和CSS:
html {
background: url(32784_FLS_W01.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.header h1{
position: absolute;
/*background-color:#C63D0F; */
background-color:transparent;
padding:50px;
padding-left:250px;
padding-right:200px;
margin-left:65px;
margin-right:65px;
font-size:80px;
/* vertical-align: top; */
}
.all {
width: 1370px;
/*height: auto;*/
}
.list {
填充顶部:0px; padding-right:65px;
}
.article img{
height:150px;
width:150px;
border:"5";
}
.article p{
width:800px;
height:65px;
font-size:16pt;
color:black;
text-decoration: none;
}
.article{
padding-top:0px;
/*overflow:hidden;*/
}
ul #mylist li{ list-style-type: none;
}
#mylist li{display:none;}
ul #mylist li img{
height:150px;
width:150px;
border="5";
}
#load {
/* position: fixed; */
height: 30px;
width: 100%;
margin-top:0px;
overflow:hidden;
}
我确实在 css 中尝试了太多东西以使其工作,但它似乎应该在 jquery 或 javascript 中工作。希望有人能帮忙。
非常感谢。
最佳答案
https://jsfiddle.net/x3azn/3u46oh39/4/
工作样本,我的头脑,你的课
<div class=<missing quote>button">
<button type="button" name="more" id="load">More</button>
</div>
没有引用,但除此之外你应该发布真正的代码
关于javascript - 加载更多按钮位置总是离加载的内容太远,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35665491/
我正在开发一个带选项卡栏的 ios 应用程序。我的栏上有超过 5 个按钮,所以在 iphone 上我有更多的按钮。现在,假设我有这个按钮:Button1 Button2 Button3 Button4
我有一个带有 UITabBarController 的应用,其中有超过五个选项卡。 当我按更多选项卡时,我会转到moreNavigationController,它是一个UINavigationCon
我有一个导航 Controller 。 NAVC->MORE... 按钮,然后在“更多”下有一些额外的 VC。 如果我转到“更多...”下的 VC,然后转到不在“更多...”上的 VC,那么当我返回到
因此,我想出了这种方案,用于在多个线程同时具有读写访问权限的二叉树中旋转时锁定节点,这涉及每次旋转锁定四个节点,这似乎是一个很多吗?我想到了一种比我想出的方法更聪明的方法来减少所需的锁定,但谷歌并没有
所以我已经尝试了所有方法,但我似乎仍然无法将下拉内容与 dropbtn 对齐。我只希望内容始终位于更多菜单下方。 HTML: `
我正在尝试使用 expect 来自动接受在 --more-- 中提示的 EULA。 #!/usr/bin/expect spawn "./greenplum-perfmon-web-4.1.2.0-b
他们如何在下面提供的网站上制作“告诉我更多”效果。我读过 read more/less effect in jQuery,但我发现该站点的有趣之处在于,除非单击该按钮,否则无法滚动页面。 Effect
现在,Kim Stebel helped me understanding如何使用存在类型键入变量,我需要知道如何在继承中使用它们: 以下代码无法编译: class PagingListModel(s
在我的Cygwin中不可用。另一方面,提供了“ less”命令。也许Cygwin的制造商认为“更多”只是多余的。 我对此很好奇。 最佳答案 安装util-linux软件包,您将获得“更多”的信息 ht
基本上,我想知道是否有人有增加 DTU 与分片的经验。 DTU应该线性地提高性能。因此,如果您有 5 个 DTU,而您改为 10 个 DTU,那么(理论上)您应该获得大约两倍的性能。 因此,四个 SQ
我们使用 asp.net mvc、javascript 和 jQuery(托管在本地计算机上)创建了一个应用程序。基本设计是,当用户从一个页面导航到其他页面时,我们通过隐藏和显示 HTML 页面,将所
我想用 RMonad 做一些基本的事情。有没有办法使用“as monad”功能来 有一个身份 rmonad,可以应用 monad 转换器吗? 有诸如 StateT 变压器之类的常见东西吗? 向现有 m
我有一个 char*[] 数组。我需要能够为其分配字符串并再次删除它们,但我不知道: 如何检查一个元素中是否已经有一个字符串,这样我就不会覆盖它,如果它已经被占用,则继续处理下一个元素? 之后如何将其
基本上,我想知道是否有人有增加 DTU 与分片的经验。 DTU应该线性地提高性能。因此,如果您有 5 个 DTU,而您改为 10 个 DTU,那么(理论上)您应该获得大约两倍的性能。 因此,四个 SQ
我有一个程序可以同时吐出标准错误和标准输出,我想在标准错误上少运行寻呼机,但忽略标准输出。我该怎么做? 更新: 就是这样......我不想丢失标准输出......只是让它远离寻呼机 program 2
基本上,当单击具有类 "dropdown" 的链接时,我无法获取“更多...”链接来对下一个跨度的高度进行动画处理。它根本就没有动画。仅当更改为 Less... 链接并且单击 Less... 链接以折
我正在使用 ExtJS,并认为它是一个了不起的框架。但是,它们没有内置的状态图,这使得依赖于状态的应用程序开发非常痛苦。 我最近发现了这个: https://github.com/jakesgordo
我一直在研究数据结构和算法,遗憾的是在C中。我已经单独实现了一个双向链表,它保存整数并且工作正常,但是当节点(或pub)让它正常工作时我遇到了很多麻烦在本例中)保存多个不同类型的值。我可以创建一个列表
编辑拼写错误 你好, 这可能是一个愚蠢的问题,但如果它能帮助我遵循最佳实践,我不在乎:P 假设我想在 System.Data 命名空间...以及 System.Data.SqlClient 命名空间中
使用 bootstrap 3 CSS、font awesome CSS 和最新的 jQuery JS 文件。 我正在使用 javascript 在单击按钮时在另一个内容 div 之上隐藏/显示一个内容
我是一名优秀的程序员,十分优秀!