0

我有一个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?

感谢您花时间阅读和回复,

4

1 回答 1

0

大家好,所以我拼凑了一个解决方案。可能不是最好的,但它有效

我创建了两个文档库,其中包含相互链接的热链接,并且还具有模板文件夹中每个唯一图像(计划和要求)所需的文件(dox、ppt 等)的热链接。我知道必须有一种更优雅的方式来做到这一点。但想分享解决方案。

感谢这么多人查看这个问题,尽管没有任何评论/建议的答案..tumbleweed..

<!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>
于 2012-06-13T14:20:14.553 回答