【发布时间】:2015-04-20 22:51:14
【问题描述】:
我是编码的初学者,我一直在尝试在互联网上搜索不同的方法来做到这一点,它们似乎无处不在。我有一个带有“关于我”链接和“联系”链接的简单页面。我希望默认信息是关于我的信息,然后如果您单击页面上的内容的联系人以切换到我的联系信息,然后如果您再次单击关于我以切换回来。
是否可以只使用 HTML 或我需要使用 jQuery?我正在尝试建立一个适当的 Div 结构并找出必要的 jQuery 函数,但我正在经历一个看似非常简单的问题。
感谢您的帮助。
谢谢!
更新 #1:这是我现在正在写的内容
<link rel="stylesheet" type="text/css" href="css.css">
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.2.min.js"></script>
</head>
<header>
<img src="header.jpg" style="border:3px solid black; border-radius:10px">
<p>the only way to predict the future, is to create it...</p>
<div>
<ul>
<li><a href="#" class="aboutme">About Me</a></li>
<li><a href="#" class="contact">Contact</a></li>
</ul>
</div>
</header>
<body>
<div class="aboutme" id="about me" >
<p>This is about me</p>
</div>
<div class="contact" id="contact" style="display:none">
<p>This is my contact into </p>
</div>
</body>
</html>
我尝试过使用这些不同的技术,但无法理解它们
http://jsfiddle.net/mA8hj/ Change content of div - jQuery Hiding table data using <div style="display:none"> http://jsbin.com/ivenik/2/edit?html,css,js,output
【问题讨论】:
-
显示一些代码并解释您到底遇到了什么问题。目前您的问题还不清楚。
-
通过简单的超链接点击更改 iframe 的内容是否容易?
标签: javascript jquery html css