Javascript 调整色盒大小不起作用!
我加载了一个带有网站另一个页面内容的colorbox模式(官方演示中的AJAX示例)。此页面有一个Javascript 调整色盒大小不起作用!,javascript,jquery,colorbox,Javascript,Jquery,Colorbox,我加载了一个带有网站另一个页面内容的colorbox模式(官方演示中的AJAX示例)。此页面有一个Show more按钮,单击该按钮可显示更多内容。我还添加了其他代码,试图调整模式大小以显示所有内容 代码: $("#button_writereview").colorbox.resize(); $("#button_writereview").colorbox.resize({innerWidth:560, innerHeight:750}); $("#button_writereview"
Show more
按钮,单击该按钮可显示更多内容。我还添加了其他代码,试图调整模式大小以显示所有内容
代码:
$("#button_writereview").colorbox.resize();
$("#button_writereview").colorbox.resize({innerWidth:560, innerHeight:750});
$("#button_writereview").colorbox.resize({Width:560, Height:750});
$.colorbox.resize();
$.colorbox.resize({innerWidth:560, innerHeight:750});
$(this).colorbox.resize();
$.fn.colorbox.resize();
$('#button_writereview').css('height',500);
上述代码除了抛出一个错误之外,没有任何其他作用uncaughttypeerror:无法调用未定义的方法“resize”
我就是想不出答案!!我猜从模式中的点击事件调用父页面是个问题。这里有一些与我无关的建议,但你可以尝试一下,它们很长,不能出现在评论中,所以我做了一个答案,请大家在投票之前先想一想
$
,不管怎样,您都可以像这样使用jquery noConflict
<script type="text/javascript" src"/Scripts/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
jq = jQuery.noConflict(true);
</script>
jq=jQuery.noConflict(true);
jq
而不是$
你的网站上有其他JS框架吗?你有没有包括colorbox
JS
?你的答案可能是duh!是的,但有时也会发生这样的事情,请确保在jqueryup之后以及jquery之后都包含了colorboxjs
。在加载到模式的html文件中加载colorbox js和不加载colorbox js都存在相同的问题。