I have:
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="/temp/css/menu.css" />
<link rel="stylesheet" type="text/css" href="/temp/css/bottomchatdiv.css" />
<link rel="stylesheet" type="text/css" href="/temp/css/centercontent.css" />
<link rel="stylesheet" type="text/css" href="/temp/css/basics.css" />
<script type="text/javascript" src="jquery-1.7.js"></script>
<script type="text/javascript" src="jquery.ba-bbq.js"></script>
<script type="text/javascript" src="jquery.ba-bbq-addtl.js"> </script>
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript">
function getusto(anchorid) {
$(anchorid).scrollTo();
}
</script>
<script type="text/javascript" src="hide&show.js">
</script>
</head>
<body >
<div class="bbq">
<div class="bbq-nav bbq-nav-top menu">
<a class="mainitem menu_links" href="">Welcome</a> <br>
<a class="menu_links" href="#" onclick="getusto('welcome'); return false;">Welcome</a><br>
<a class="menu_links" href="#" onclick="getusto('guidelines'); return false; ">Guidelines</a>
<br>
<hr style="width:48%"/>
<br>
<a class="mainitem menu_links" href="#Regular-Visitors-&-Ops.html">Regulars & Ops</a> <br>
</div>
<br>
<div class="bbq-content centercontent">
<!-- This will be shown while loading AJAX content. You'll want to get an image that suits your design at http://ajaxload.info/ -->
<div class="bbq-loading" style="display:none;">
<img src="/shell/images/ajaxload-15-white.gif" alt="Loading"/> Loading content...
</div>
<!-- This content will be shown if no path is specified in the URL fragment. -->
<div class="bbq-default bbq-item">
default welcome text here.
</div>
</div>
</div>
</body>
</html>
现在,问题是 Regular-Visitors-&-Ops.html 页面无法加载,但它正在加载!所以我修改了我的撤销,直到我发现不包含prototype.js 可以让该链接通过 jquery bbq 的方式工作。
是什么赋予了?如何让prototype.js和jquery bbq共存?我需要两者来完成不同的事情..
要启动并运行它,您需要在同一目录中添加一个附加的 Regular-Visitors-&-Ops.html 文件,例如:
<!DOCTYPE html>
<head>
</head>
</body>
this is the additional file.
</body>
</html>
还有jquery,jquery bbq的两个脚本(我自己命名了一个),&prototype.js。
现在,如果您确实进行了设置 - 外卖原型和常规访客(...)链接就可以工作。问题是,我正在使用prototype.js。所以我如何让这两个工作,或者更简单地,我如何实现一个scrollTo函数(不能使用锚点,因为jquery bbq占用了锚点/散列(例如“index.html#”中的“#welcome”)欢迎”)不使用 PROTOTYPE.JS?应该有一个吧?
通过在 jQuery 之后包含prototype.js,Prototype 将覆盖全局的值$
多变的。你只需要使用:
var $j = jQuery.noConflict();
然后您可以使用$j
代替$
在 jQuery 上下文中和$
对于原型上下文。这是文档:http://api.jquery.com/jQuery.noConflict/.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)