Fancybox:TypeError:$(...)。Fancybox不是一个函数 [英] Fancybox :TypeError: $(...).Fancybox is not a function

查看:119
本文介绍了Fancybox:TypeError:$(...)。Fancybox不是一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打开一个花哨的盒子,但它给出了一个Type错误,请你帮我解决这个问题

I want to open a fancy box, But it give a Type error, can you please help me to solve this problem

查看页面包含以下代码

<script type="text/java script">
$(document).ready(function() {
$('.fancybox').fancybox();
});
</script>

HTML code

HTML code

<a class="fancybox" href="#inline1" title="Add New Vessel">
    <div class="right-head-buton" style="color:#fff">Add New Vessel</div>
    </a>

我想在花式框中打开内联id div

I want to open inline id div in fancy box

<div id="inline1" style="width:800px;display: none;">
    <div class="lightbox">
    <?php echo $this->action('add', 'agency', NULL); ?>
    </div>
    </div>

在Bootstrap中我包含两个文件

In Bootstrap I include two files

$view->headScript()->appendFile($view->baseUrl('/public/js/jquery-1.10.1.min.js'));
$view->headScript()->appendFile($view->baseUrl('/public/js/jquery.fancybox.js?v=2.1.5'));


推荐答案

<script type="text/javascript">
var $= jQuery.noConflict();

单个页面中jQuery中的noconflict
可能是这个答案对你有帮助。
还有一件事使用最高版本的javascript文件,比如在jquery 1.3.min.js和jquery 1.3.5.min.js之间使用
jquery 1.3.min.js

noconflict in your jQuery in a single page may be this answer will help you. and one more thing use highest version of a javascript file like only use jquery 1.3.min.js between jquery 1.3.min.js and jquery 1.3.5.min.js

这篇关于Fancybox:TypeError:$(...)。Fancybox不是一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆