我基本上是试图遵循http://www.building58.com/examples/tabSlideOut.html教程,我有这个错误,有什么问题吗?
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
<script src="http://tab-slide-out.googlecode.com/files/jquery.tabSlideOut.v1.3.js"></script> <script>
$(function(){
$('.slide-out-div').tabSlideOut({
tabHandle: '.handle', //class of the element that will be your tab
pathToTabImage: 'images/contact_tab.gif', //path to the image for the tab (optionaly can be set using css)
imageHeight: '122px', //height of tab image
imageWidth: '40px', //width of tab image
tabLocation: 'left', //side of screen where tab lives, top, right, bottom, or left
speed: 300, //speed of animation
action: 'click', //options: 'click' or 'hover', action to trigger animation
topPos: '200px', //position from the top
fixedPosition: false //options: true makes it stick(fixed position) on scroll
});
});
</script>
<div class="slide-out-div">
<a class="handle" href="http://link-for-non-js-users.html">Content</a>
<h3>Contact me</h3>
<p>Thanks for checking out my jQuery plugin, I hope you find this useful.
</p>
<p>This can be a form to submit feedback, or contact info</p>
</div>04:54:57.945 TypeError:$(“.幻灯片-out-div”).tabSlideOut不是一个函数@
发布于 2012-09-13 11:14:25
如果浏览器中有调试器,大多数现代的调试器都会按F12来检查它,然后可以查看是否正确加载了所有脚本,使用typeof函数可以检查tabSlideOut是什么(未定义的或函数)。
我想你是从这里复制过来的:http://www.building58.com/examples/tabSlideOut.html。你能再检查一下,如果你复制了一切,包括css,正确吗?
发布于 2012-09-13 11:07:04
试着使用
jQuery(function() {
});而不是$
https://stackoverflow.com/questions/12404821
复制相似问题