【发布时间】:2010-10-31 21:38:57
【问题描述】:
我正在学习如何将 jquery 与 SharePoint 一起使用。我的示例在选择链接时在内容编辑器 Web 部件内绘制了一个红色框。我的代码在 SharePoint 页面处于编辑模式时有效,但在我离开页面并以非编辑模式返回后无效。 jquery 函数由于某种原因没有触发......我错过了一些简单但不确定是什么。
感谢您的帮助。
凯文
我的站点母版页以这种方式连接到 jquery-1.3.2.min.js 文件:
<SharePoint:ScriptLink language="javascript" name="jquery-1.3.2.min.js"
Defer="true" runat="server"/>
我的内容编辑器 Web 部件代码如下所示:
<style type="text/css">
#box
{
background: red;
width: 300px;
height: 300px;
display: none;
}
</style>
<script type ="text/javascript">
$(function() {
$('a').click(function() {
$('#box').slideDown(2000);
});
})
</script>
<div id="box">
<h1>This is text in the box</h1>
</div>
<a href="#">Display Box</a><br />
【问题讨论】:
标签: jquery sharepoint web-parts