在我的HTML頁面中,我包含了一個Jquery的fancybox,它運行良好。但是,當我添加jQueryUI的腳本太,我得到一個:解決JS jqueryui/fancybox的衝突
Uncaught TypeError: Object [object Object] has no method 'fancybox'
(從login.js,它使用一個電話的fancybox,這的確工程W/O違規新行)我的腳本夾雜物如下:
<link rel="stylesheet" type="text/css" href="./fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<link rel="stylesheet" href="style.css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="login.js"> </script>
<script type="text/javascript" src="./fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="./fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<link type="text/css" href="./jqueryui/css/ui-lightness/jquery-ui-1.8.17.custom.css" rel="Stylesheet" />
<!-- <script type="text/javascript" src="./jqueryui/js/jquery-1.7.1.min.js"></script> -->
<!-- the above commented out line is the offending one; once removed, page works well -->
<script type="text/javascript" src="./jqueryui/js/jquery-ui-1.8.17.custom.min.js"></script>
任何想法?
您還沒有提到它,所以它必須問:你可以在jq-ui後加入fancybox,看看會發生什麼? – Kato 2012-01-13 15:06:28
是的,我剛剛嘗試過,看起來確實解決了問題。任何想法爲什麼? (有沒有一種方法可以將您的評論上傳/標記爲解決方案?) – sellarafaeli 2012-01-13 15:10:09