我有一个HTML问题。我正在使用sharepoint - 在Sharepoint Designer上工作。我正在尝试将元素组合为一个目前正在单独工作的元素。 我是html的新手,所以请原谅我在形成这个问题时缺乏凝聚力。
第一页。我正在使用一个功能来选择3个不同的图像
function changeIt(imageName,objName)
{
var obj = document.getElementById(objName);
the if statement below is just how i've been trying to toggle between visible and not based on a certain criteria:
//************
if (imageName == 'http://office-na.ms.com/ops/SecuritiesOperations/Images1/NoneSelected.JPG')
{
document.getElementById('falseyear').style.display = 'block';
}
else
{
document.getElementById('falseyear').style.display = 'none';
}
//**************
var imgTag = "<img src='"+imageName+"' border='0' />";
obj.innerHTML = imgTag;
return;
}
/script>
</head>
<body>
<a id="one" href="#" onclick="changeIt('http://office-na.com/NoneSelected.JPG','image1');">Main</a>
<a id="two" href="#" onclick="changeIt(,http://office-na.com/PlanningSelected.JPG','image1');">Planning</a>
<a id="three" href="#" onclick="changeIt('http://office-na.com/RequirementSelected.JPG','image1');">Requirement</a>
<div id="image1">
<img src="http://office-na.com/NoneSelected.JPG" border="0" alt="one" usemap="#FPMap0" />
</div>
<div id="falseyear" style="display:none"><h3>The year you entered is not valid</h3></div>
<br/><br/>
</body>
</html>
//第二部分是我为其中一个图像设置了热点(超链接),如下所示
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
</head>
<body>
<p><map name="FPMap0" id="FPMap0">
<area title="Click to follow hyperlink" href="http://office-na.ms.com/Templates/Blank%20Template.doc" shape="rect" coords="760, 490, 889, 514" />
<area title="click to follow hyperlink" href="http://office-na.ms.com/Templates/Small%20Template.ppt" shape="rect" coords="760, 512, 889, 537" />
<area title="click to follow hyperlink" href="http://office-na.ms.com/Templates/Large%20Template.ppt" shape="rect" coords="760, 536, 891, 560" />
<area title="Click to follow hyperlink" href="http://office-na.ms.com/Templates/Blank%20Template.ppt" shape="rect" coords="760, 575, 890, 598" />
</map>
<img alt="Practice" src="Best.jpg" width="960" height="720" usemap="#FPMap0" /></p>
</body>
</html>
我想将两者合并,然后根据第一部分中选择的图像添加热点。那么有没有办法根据选择的图像添加/更改地图超链接?这就是为什么我在第一部分中添加了if语句,看看我是否可以根据标准切换开关。这是可以在HTML中完成的吗?如果不是我应该研究什么语言? asp.net?的Javascript?
感谢您花时间阅读和回复,
答案 0 :(得分:0)
大家好,所以我拼凑了一个解决方案。可能不是最好但是有效
我创建了两个文档库,其中的热链接相互链接,并且还具有模板文件夹中每个唯一图像(计划和要求)所需的文件(dox,ppt etcetra)的热链接。我知道必须有一种更优雅的方式来做到这一点。但是想分享解决方案。
感谢有这么多人查看这个问题,虽然没有任何评论/建议的答案......感觉很好..
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 3</title>
</head>
<body>
<map name="FPMap0" id="FPMap0">
<area title="Click to follow hyperlink" href="http://office.com/Templates/Planning/Checklist.xlsx" shape="rect" coords="736, 487, 826, 513" />
<area title="Click to follow hyperlink" href="http://officecom/Templates/Planning/Plan.mpp" shape="rect" coords="833, 529, 897, 552" />
<area title="Click to follow hyperlink" href="http://office.com/Templates/Planning/TEMPLATE_v2.ppt" shape="rect" coords="736, 567, 826, 591" />
<area title="Click to follow hyperlink" href="http://office.com/Templates/Planning/Template.mpp" shape="rect" coords="737, 529, 826, 551" />
<area title="Go to Page 2" href="http://office.com/Require/Forms/AllItems.aspx" shape="rect" coords="256, 144, 377, 177" />
</map>
<img src="actices/Images1/Best.jpg" usemap="#FPMap0"/>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
</head>
<body>
<p><map name="FPMap0" id="FPMap0">
<area title="Click to follow hyperlink" href="http://office.com/Templates/Information.docx" shape="rect" coords="240, 448, 489, 472" />
<area title="Click to follow hyperlink" href="http://office.com/Templates/Template.doc" shape="rect" coords="760, 490, 889, 514" />
<area title="click to follow hyperlink" href="http://office.com/Templates/Example.docx" shape="rect" coords="760, 512, 889, 537" />
<area title="click to follow hyperlink" href="http://office.com/Templates/_Example.docx" shape="rect" coords="760, 536, 891, 560" />
<area title="Click to follow hyperlink" href="http://office.com/Templates/Examples.vsd" shape="rect" coords="760, 575, 890, 598" />
<area title="Go to Page 1" href="http://office.com/Plan/Forms/AllItems.aspx" shape="rect" coords="136, 144, 240, 177" />
</map>
<img src="Images1/Require.jpg" width="960" height="720" usemap="#FPMap0" /></p>
</body>
</html>