- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我是这方面的新手,已经能够让我的代码在我的第一页上运行,但不能在任何其他页面上运行。我试图将它作为导出的 js 文件来做,但它不起作用,所以我将它作为 a 添加到我的 html 页面的底部。现在它只是在那个页面上不起作用!所以这个有效:
* {
font-family: Helvetica, sans-serif;
}
body {
background-position: bottom;
font-family: Arial, Helvetica, sans-serif;
background-color: #e9e9e9;
}
img.sixth {
display: block;
margin: auto;
margin-bottom: 4em;
}
h1.first {
text-align: center;
font-family: arial, helvetica, sans-serif;
padding:10px;
border: Dashed 3px;
border-color: #66CCFF;
width: 300px;
height: auto;
position: static;
margin: 30px;
margin-left: 500px;
margin-top: 40px;
}
h2 {
text-align: center;
font-family: arial, helvetica, sans-serif;
padding:10px;
border: Dashed 3px;
border-color: #66FF66;
width: 300px;
height: auto;
margin: auto;
cursor: pointer;
margin-top: 1.5em;
}
img.first {
display: block;
margin: auto;
margin-bottom: 2em;
display: none;
}
img.second {
display: block;
margin: auto;
display: none;
}
img.third {
display: block;
margin: auto;
display: none;
}
img.fourth {
display: block;
margin: auto;
margin-bottom: 1em;
display: none;
}
img.fifth {
display: block;
margin: auto;
display: none;
}
p {
text-align: center;
font-family: arial, helvetica, sans-serif;
visibility:hidden;
}
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="densi.js"></script>
<link rel="stylesheet" href="C:\Users\Hayley\Documents\Coding\DENSI\densi_home.css">
<title> DENSI 2017 </title>
</head>
<body>
<!--Navigation bar-->
<div id="nav-placeholder">
</div>
<script>
$(function(){
$("#nav-placeholder").load("nav1.htm")
;
});
</script>
<!--Finish NavBar-->
<!--Page Heading-->
<div id='heading'>
<h1 class='first' align='center'><big> DENSI 2017 </h1 class='first' align='center'></big>
</div>
<img class='sixth' src="C:\Users\Hayley\Documents\Coding\DENSI\DEN.jpg"
height="200px"
width="250px"
border="1px"
position="center"
alt=""/>
<!--Section 1-->
<div class="parent">
<h2 align='center'> What is it? </h2>
<p align='center'> DENSI stands for Discovery Education Network Summer Institute. It is a week long residential professional development that helps educators learn, share and connect with other educators about good practice; integrating technology into the classroom and to give different perspectives on strategies to engage children. </p>
<img class='second' src="C:\Users\Hayley\Documents\Coding\DENSI\DENSI.jpg" alt="DEN Group Photo"
height="150px"
width="270px"
border="1px"
style="float: left; margin-left: 30%; margin-bottom:0.5em; margin-top: 3em;"
/>
<img class='third' src="C:\Users\Hayley\Documents\Coding\DENSI\densi logo.jpg" alt="Discovery Logo"
height="250px"
width="180px"
border="1px"
style="float: right; margin-right: 30%; margin-bottom: 1em;"
/>
<p style="clear: both;"></p>
</div>
<!--Section 2-->
<div class="parent">
<h2 align='center'> Where was it held? </h2>
<p align='center'> DENSI this year was held in San Diego at the University of California San Diego. In previous years it has been held in Washington, Chicago and Montana. San Diego has been a beautiful setting for DENSI this year (although there was no air con... and the wifi was a struggle...); once we had adjusted to the heat and the time difference we were well on our way to starting our once in a lifetime professional development experience!</p>
<img class='fourth' src="C:\Users\Hayley\Documents\Coding\DENSI\15.jpg"
height="250px"
width="180px"
border="1px"
alt=""/>
</div>
<!--Section 3-->
<div class="parent">
<h2 class='third'align='center'> Who was there? </h2>
<p class='third' align='center'> There were over 150 attendees at DENSI this year, several of which travelled from Egypt, England, UAE, Dubai, Haiti, Kuwait and China. Information on attendees can be found <span style="cursor:pointer"><a href="https://docs.google.com/presentation/d/1K_mloa69fSR0ij0E7u1pjG_RkCzLxMUTk7JlLd04J2Y/edit"
target="_blank">here.</a>
<p class='fourth' align='center'>
Over the course of the week we had networked with the majority and had connected with many.</p>
<img class='first' src="C:\Users\Hayley\Documents\Coding\DENSI\Int1.jpg" alt="Internation Group Photo"
height="180px"
width="250px"
border="1px"
style="float: inherit; margin-right: 40%; margin-bottom: 5em;"
/>
</div>
<!--Footer-->
<div id="footer">
<script>
$(function(){
$("#footer").load("footer.htm")
;
});
</script>
</div>
<script>
$(".parent").children("h2").click(function(){
$(".parent").children("p", "img.first", "img.second", "img.third", "img.fourth", "img.fifth").css("visibility", "hidden");
$(this).siblings("p", "img.first", "img.second", "img.third", "img.fourth", "img.fifth").css("visibility", "visible");
$(".parent").children("img.first").css("display", "none");
$(this).siblings("img.first").css("display", "block");
$(".parent").children("img.second").css("display", "none");
$(this).siblings("img.second").css("display", "block");
$(".parent").children("img.third").css("display", "none");
$(this).siblings("img.third").css("display", "block");
$(".parent").children("img.fourth").css("display", "none");
$(this).siblings("img.fourth").css("display", "block");
$(".parent").children("img.fifth").css("display", "none");
$(this).siblings("img.fifth").css("display", "block");
});
</script>
</body
</html>
但是我尝试的这个和其他每个都不会:
body {
background-position: bottom;
font-family: Arial, Helvetica, sans-serif;
background-color: #e9e9e9;
}
h1.first {
text-align: center;
font-family: arial, helvetica, sans-serif;
padding:10px;
border: Dashed 3px;
border-color: #66CCFF;
width: 300px;
height: auto;
position: static;
margin: 30px;
margin-left: 500px;
margin-top: 40px;
}
h2 {
text-align: center;
font-family: arial, helvetica, sans-serif;
padding:10px;
border: Dashed 3px;
border-color: #66FF66;
width: 300px;
height: auto;
margin: auto;
cursor: pointer;
}
img.first {
display: none;
margin: auto;
}
img.second{
display: none;
margin: auto;
}
img.third{
display: none;
margin: auto;
}
img.fourth{
display: none;
margin: auto;
}
img.fifth{
display: none;
margin: auto;
}
img.eight{
display: none;
margin: auto;
}
img.ninth{
display: none;
margin: auto;
}
img.tenth{
display: none;
margin: auto;
}
img.eleventh{
display: none;
margin: auto;
}
p {
text-align: center;
font-family: arial, helvetica, sans-serif;
font-size: 11.8pt;
visibility: hidden;
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="C:\Users\Hayley\Documents\Coding\DENSI\day1.css">
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<title> Day One </title>
</head>
<body>
<!--Navigation bar-->
<div id="nav-placeholder">
</div>
<script>
$(function(){
$("#nav-placeholder").load("nav1.htm")
;
});
</script>
<!-- Heading-->
<h1 class='first' align='center'><big> Day One </h1></big>
<!-- Section One-->
<div class="parent">
<h2 align='center'> Small Group </h2>
<p align='center'> My small group leader was Jen Hall. She was amazing, she saved Nik and I seats so that we were able to meet our small group and made us feel welcome. Our small group were accommodating and likeable. In our small group was Dana, Cheryl, Mary, Leslie, Alexis, Nadine, Chelsea, Kimberly, Lauren, Renee and Lakesha. </p>
<img class='first' src="C:\Users\Hayley\Documents\Coding\DENSI\IMG_0088.jpg" alt="Our Small Group 1"
height="130px"
width="200px"
border="1px"
style="float: left; margin-left: 17%; margin-bottom:0.5em; margin-top: 1em;"
/>
<img class='third' src="C:\Users\Hayley\Documents\Coding\DENSI\IMG_0090.jpg" alt="Our Small Group 2"
height="130px"
width="200px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom:0.5em; margin-top: 1em;"
/>
<img class='second' src="C:\Users\Hayley\Documents\Coding\DENSI\IMG_0089.jpg" alt="Our Small Group 3"
height="130px"
width="200px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom:0.5em; margin-top: 1em;"
/>
<p style="clear: both;"></p>
</div>
<!--Section Two-->
<div id='parent'>
<h2 align='center'> What Did We Do? </h2>
<p> We started off with an opening session. In this session there was a video introducing a new country to the group made by the attendees from that country, and there were discussions about someone people had connected with the previous day as well as the timetable for the day. In the morning we had a session let by Jaime LaForgia and then it was lunch time! <br/> I didn't realise how much I was going to like American food. Turns out it is A LOT.</p>
<img class='fourth' src="C:\Users\Hayley\Documents\Coding\DENSI\14.jpg"
height="200px"
width="150px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom: 5em;"
alt="American Food"/>
<img class='fifth' src="C:\Users\Hayley\Documents\Coding\DENSI\42.jpg"
height="200px"
width="150px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom: 5em;"
alt="American Food"/>
<img class='eight' src="C:\Users\Hayley\Documents\Coding\DENSI\68.jpg"
height="200px"
width="150px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom: 5em;"
alt="American Food"/>
<img class='ninth' src="C:\Users\Hayley\Documents\Coding\DENSI\69.jpg"
height="200px"
width="150px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom: 5em;"
alt="American Food"/>
<p style="clear: both;"></p>
</div>
<!--Section 3-->
<div id='parent'>
<h2 align='center'> International Group </h2>
<p> In the afternoon we went to a different building to be part of the international group meet up. Firstly, we looked at and discussed a powerpoint led by Lance about SOS and how to improve the Discovery software and services in front of the CEO, Bill Goodwyn. While in the room we had to introduce ourselves; say our name, where we worked, discuss our school community and/or how we use Discovery software in our school. Except I didn't. I stayed quiet, sat back in my chair and took in everything everyone else was saying, listened and just did not introduce myself; because I don't enjoy big groups. Thankfully, Christine let me get away with this, saved me the embarrassment and let me stay in my comfort zone. </p>
</div>
<!--Section 4-->
<div id='parent'>
<h2 align='center'> The DEN at Night... </h2>
<p> At night, the DEN becomes a different place. It becomes less professional and more... personal and party-vibey. Alcohol is found and everyone becomes less tense, people relax, make friends, network in ways we can't during the day. During the DEN at Night I made friends with an awesome group of people, including Kelli, Heather and Kamala. These are my newest life-long friends.:)</p>
<img class='tenth' src="C:\Users\Hayley\Documents\Coding\DENSI\13.jpg"
height="150px"
width="250px"
border="1px"
style="float: left; margin-left: 30%; margin-bottom: 5em;"
alt="American Friends and I"/>
<img class='eleventh' src="C:\Users\Hayley\Documents\Coding\DENSI\72.jpg"
height="250px"
width="150px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom: 5em;"
alt="American Friends and I"/>
<p style="clear: both;"></p>
</div>
<!--Footer-->
<div id="footer">
</div>
<script>
$(function(){
$("#footer").load("footer.htm")
;
});
</script>
<script>
$(".parent").children("h2").click(function(){
$(".parent").children("p").css("visibility", "hidden");
$(this).siblings("p").css("visibility", "visible");
$(".parent").children("img.first", "img.second", "img.third").css("display", "block");
$(this).siblings("img.first", "img.second", "img.third").css("display", "block");
$(".parent").children("img.fourth", "img.fifth", "img.eight", "img.ninth").css("display", "block");
$(this).siblings("img.fourth", "img.fifth", "img.eight", "img.ninth").css("display", "block");
$(".parent").children("img.fourth", "img.fifth", "img.eight", "img.ninth").css("display", "block");
$(this).siblings("img.tenth", "img.eleventh").css("display", "block");
});
</body>
</html>
最佳答案
您缺少脚本标记的结尾,请添加 </script>
对于第二个代码或尝试下面的代码。
body {
background-position: bottom;
font-family: Arial, Helvetica, sans-serif;
background-color: #e9e9e9;
}
h1.first {
text-align: center;
font-family: arial, helvetica, sans-serif;
padding:10px;
border: Dashed 3px;
border-color: #66CCFF;
width: 300px;
height: auto;
position: static;
margin: 30px;
margin-left: 500px;
margin-top: 40px;
}
h2 {
text-align: center;
font-family: arial, helvetica, sans-serif;
padding:10px;
border: Dashed 3px;
border-color: #66FF66;
width: 300px;
height: auto;
margin: auto;
cursor: pointer;
}
img.first {
display: none;
margin: auto;
}
img.second{
display: none;
margin: auto;
}
img.third{
display: none;
margin: auto;
}
img.fourth{
display: none;
margin: auto;
}
img.fifth{
display: none;
margin: auto;
}
img.eight{
display: none;
margin: auto;
}
img.ninth{
display: none;
margin: auto;
}
img.tenth{
display: none;
margin: auto;
}
img.eleventh{
display: none;
margin: auto;
}
p {
text-align: center;
font-family: arial, helvetica, sans-serif;
font-size: 11.8pt;
visibility: hidden;
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="C:\Users\Hayley\Documents\Coding\DENSI\day1.css">
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<title> Day One </title>
</head>
<body>
<!--Navigation bar-->
<div id="nav-placeholder">
</div>
<script>
$(function(){
$("#nav-placeholder").load("nav1.htm")
;
});
</script>
<!-- Heading-->
<h1 class='first' align='center'><big> Day One </h1></big>
<!-- Section One-->
<div class="parent">
<h2 align='center'> Small Group </h2>
<p align='center'> My small group leader was Jen Hall. She was amazing, she saved Nik and I seats so that we were able to meet our small group and made us feel welcome. Our small group were accommodating and likeable. In our small group was Dana, Cheryl, Mary, Leslie, Alexis, Nadine, Chelsea, Kimberly, Lauren, Renee and Lakesha. </p>
<img class='first' src="C:\Users\Hayley\Documents\Coding\DENSI\IMG_0088.jpg" alt="Our Small Group 1"
height="130px"
width="200px"
border="1px"
style="float: left; margin-left: 17%; margin-bottom:0.5em; margin-top: 1em;"
/>
<img class='third' src="C:\Users\Hayley\Documents\Coding\DENSI\IMG_0090.jpg" alt="Our Small Group 2"
height="130px"
width="200px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom:0.5em; margin-top: 1em;"
/>
<img class='second' src="C:\Users\Hayley\Documents\Coding\DENSI\IMG_0089.jpg" alt="Our Small Group 3"
height="130px"
width="200px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom:0.5em; margin-top: 1em;"
/>
<p style="clear: both;"></p>
</div>
<!--Section Two-->
<div id='parent'>
<h2 align='center'> What Did We Do? </h2>
<p> We started off with an opening session. In this session there was a video introducing a new country to the group made by the attendees from that country, and there were discussions about someone people had connected with the previous day as well as the timetable for the day. In the morning we had a session let by Jaime LaForgia and then it was lunch time! <br/> I didn't realise how much I was going to like American food. Turns out it is A LOT.</p>
<img class='fourth' src="C:\Users\Hayley\Documents\Coding\DENSI\14.jpg"
height="200px"
width="150px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom: 5em;"
alt="American Food"/>
<img class='fifth' src="C:\Users\Hayley\Documents\Coding\DENSI\42.jpg"
height="200px"
width="150px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom: 5em;"
alt="American Food"/>
<img class='eight' src="C:\Users\Hayley\Documents\Coding\DENSI\68.jpg"
height="200px"
width="150px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom: 5em;"
alt="American Food"/>
<img class='ninth' src="C:\Users\Hayley\Documents\Coding\DENSI\69.jpg"
height="200px"
width="150px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom: 5em;"
alt="American Food"/>
<p style="clear: both;"></p>
</div>
<!--Section 3-->
<div id='parent'>
<h2 align='center'> International Group </h2>
<p> In the afternoon we went to a different building to be part of the international group meet up. Firstly, we looked at and discussed a powerpoint led by Lance about SOS and how to improve the Discovery software and services in front of the CEO, Bill Goodwyn. While in the room we had to introduce ourselves; say our name, where we worked, discuss our school community and/or how we use Discovery software in our school. Except I didn't. I stayed quiet, sat back in my chair and took in everything everyone else was saying, listened and just did not introduce myself; because I don't enjoy big groups. Thankfully, Christine let me get away with this, saved me the embarrassment and let me stay in my comfort zone. </p>
</div>
<!--Section 4-->
<div id='parent'>
<h2 align='center'> The DEN at Night... </h2>
<p> At night, the DEN becomes a different place. It becomes less professional and more... personal and party-vibey. Alcohol is found and everyone becomes less tense, people relax, make friends, network in ways we can't during the day. During the DEN at Night I made friends with an awesome group of people, including Kelli, Heather and Kamala. These are my newest life-long friends.:)</p>
<img class='tenth' src="C:\Users\Hayley\Documents\Coding\DENSI\13.jpg"
height="150px"
width="250px"
border="1px"
style="float: left; margin-left: 30%; margin-bottom: 5em;"
alt="American Friends and I"/>
<img class='eleventh' src="C:\Users\Hayley\Documents\Coding\DENSI\72.jpg"
height="250px"
width="150px"
border="1px"
style="float: left; margin-left: 10%; margin-bottom: 5em;"
alt="American Friends and I"/>
<p style="clear: both;"></p>
</div>
<!--Footer-->
<div id="footer">
</div>
<script>
$(function(){
$("#footer").load("footer.htm")
;
});
</script>
<script>
$(".parent").children("h2").click(function(){
$(".parent").children("p").css("visibility", "hidden");
$(this).siblings("p").css("visibility", "visible");
$(".parent").children("img.first", "img.second", "img.third").css("display", "block");
$(this).siblings("img.first", "img.second", "img.third").css("display", "block");
$(".parent").children("img.fourth", "img.fifth", "img.eight", "img.ninth").css("display", "block");
$(this).siblings("img.fourth", "img.fifth", "img.eight", "img.ninth").css("display", "block");
$(".parent").children("img.fourth", "img.fifth", "img.eight", "img.ninth").css("display", "block");
$(this).siblings("img.tenth", "img.eleventh").css("display", "block");
});
</script>
</body>
</html>
关于javascript - JS 编码不能在一个以上的页面上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45395151/
我在Windows 10中使用一些简单的Powershell代码遇到了这个奇怪的问题,我认为这可能是我做错了,但我不是Powershell的天才。 我有这个: $ix = [System.Net.Dn
var urlsearch = "http://192.168.10.113:8080/collective-intellegence/StoreClicks?userid=" + userId +
我有一个非常奇怪的问题,过去两天一直让我抓狂。 我有一个我试图控制的串行设备(LS 100 光度计)。使用设置了正确参数的终端(白蚁),我可以发送命令(“MES”),然后是定界符(CR LF),然后我
我目前正试图让无需注册的 COM 使用 Excel 作为客户端,使用 .NET dll 作为服务器。目前,我只是试图让概念验证工作,但遇到了麻烦。 显然,当我使用 Excel 时,我不能简单地使用与可
我开发了简单的 REST API - https://github.com/pavelpetrcz/MandaysFigu - 我的问题是在本地主机上,WildFly 16 服务器的应用程序运行正常。
我遇到了奇怪的情况 - 从 Django shell 创建一些 Mongoengine 对象是成功的,但是从 Django View 创建相同的对象看起来成功,但 MongoDB 中没有出现任何数据。
我是 flask 的新手,只编写了一个相当简单的网络应用程序——没有数据库,只是一个航类搜索 API 的前端。一切正常,但为了提高我的技能,我正在尝试使用应用程序工厂和蓝图重构我的代码。让它与 pus
我的谷歌分析 JavaScript 事件在开发者控制台中运行得很好。 但是当从外部 js 文件包含在页面上时,它们根本不起作用。由于某种原因。 例如; 下面的内容将在包含在控制台中时运行。但当包含在单
这是一本名为“Node.js 8 the Right Way”的书中的任务。你可以在下面看到它: 这是我的解决方案: 'use strict'; const zmq = require('zeromq
我正在阅读文本行,并创建其独特单词的列表(在将它们小写之后)。我可以使它与 flatMap 一起工作,但不能使它与 map 的“子”流一起工作。 flatMap 看起来更简洁和“更好”,但为什么 di
我正在编写一些 PowerShell 脚本来进行一些构建自动化。我发现 here echo $? 根据前面的语句返回真或假。我刚刚发现 echo 是 Write-Output 的别名。 写主机 $?
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 4年前关闭。 Improve thi
我将一个工作 View Controller 类从另一个项目复制到一个新项目中。我无法在新项目中加载 View 。在旧项目中我使用了presentModalViewController。在新版本中,我
我对 javascript 很陌生,所以很难看出我哪里出错了。由于某种原因,我的功能无法正常工作。任何帮助,将不胜感激。我尝试在外部 js 文件、头部/主体中使用它们,但似乎没有任何效果。错误要么出在
我正在尝试学习Flutter中的复选框。 问题是,当我想在Scaffold(body :)中使用复选框时,它正在工作。但我想在不同的地方使用它,例如ListView中的项目。 return Cente
我们当前使用的是 sleuth 2.2.3.RELEASE,我们看不到在 http header 中传递的 userId 字段没有传播。下面是我们的代码。 BaggageField REQUEST_I
我有一个组合框,其中包含一个项目,比如“a”。我想调用该组合框的 Action 监听器,仅在手动选择项目“a”完成时才调用。我也尝试过 ItemStateChanged,但它的工作原理与 Action
你能看一下照片吗?现在,一步前我执行了 this.interrupt()。您可以看到 this.isInterrupted() 为 false。我仔细观察——“这个”没有改变。它具有相同的 ID (1
我们当前使用的是 sleuth 2.2.3.RELEASE,我们看不到在 http header 中传递的 userId 字段没有传播。下面是我们的代码。 BaggageField REQUEST_I
我正在尝试在我的网站上设置一个联系表单,当有人点击发送时,就会运行一个作业,并在该作业中向所有管理员用户发送通知。不过,我在失败的工作表中不断收到此错误: Illuminate\Database\El
我是一名优秀的程序员,十分优秀!