久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Fancybox 不是函數

Fancybox is not a function(Fancybox 不是函數)
本文介紹了Fancybox 不是函數的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

您好,當有人在文本框中輸入地址并點擊旁邊的提交按鈕時,我正在使用 jQuery 插件 fancybox 來顯示 bing 地圖.并加載了一個fancybox,并顯示了該地址的地圖.這在我的應用程序中運行良好,但問題是,它只在一個頁面上運行良好,而在另一頁上運行良好,當我加載它時,它給我一個錯誤,說 fancybox 不是一個函數.我在錯誤控制臺和螢火蟲控制臺中看到了這個錯誤.我不確定可能是什么問題.相同的代碼可以在另一個頁面上運行,但在這個頁面上不行?

Hello I am using the jQuery plugin fancybox to display bing maps when somebody enters an address into a textbox and hits the submit button beside it. And a fancybox is loaded and a map for that address is displayed. This is working well with my application, but the problem is, it is only working well on one page and on the other one, when I load it, it is giving me an error saying fancybox is not a function. I get to see this error in the error console and in the firebug console. I am not sure what could the problem. The same code works in another page, but it doesn't on this one?

$("<a href="#showmap">Map</a>").fancybox is not a function

我很確定這不是可重用性問題.但是當我測試fancybox的原始文件是否已經加載時,它們是與dom一起加載的,所以它可能不是實際問題.但我無法理解還有什么問題.

I am pretty sure it is not re-usability issue. But when I test to see if fancybox's original files have been loaded, they are loaded with the dom, so it might not be actual problem. But I am unable to understand what else could the problem be.

這是我的代碼

abbr: 只是一個文本位.根據用戶的選擇,我有不同的 div.每個 div 都有自己的控件,這些控件以該文本開頭,并附加有自己的定義,例如 mapresults、decValLat、decValLon 等.

abbr: is just a text bit. I have different divs based on what the user selects. And each div would have its own controls, which would start with that text and are appended with their own definitions such as mapresults, decValLat, decValLon etc.

例如:縮寫>>東然后 id 將是eastmapresults、eastdecValLat、eastdecValLon 等.

ex: abbr>>east and then the ids would be eastmapresults, eastdecValLat, eastdecValLon etc.

function showMapFancybox(abbr){
    var abbr;
    $('#'+abbr+'mapresults').hide(); 
    $('<a href="#showmap">Map</a>').fancybox({
        overlayShow: true,
        onClosed: function() {
            $('#'+abbr+'mapresults').show();
            map_latdec = $('#decValLat').attr('value');
            map_longdec = $('#decValLon').attr('value');
            map_latdeg = $('#degValLat').attr('value');
            map_longdeg = $('#degValLon').attr('value');

            $('#'+abbr+'decValLatsub').val(map_latdec);
            $('#'+abbr+'decValLonsub').val(map_longdec);
            $('#'+abbr+'degValLatsub').val(map_latdeg+'N');
            $('#'+abbr+'degValLonsub').val(map_longdeg+'W');
        }
    }).click();    
};

推薦答案

我已經遇到過這種類型的錯誤,因為我在插件導入后重新加載了 jQuery,檢查你沒有錯誤地重新導入 jquery(有時包含在一個包中,比如jQuery 工具).

I already had this type of errors because i was reloading jQuery after the plugin import, check you don't reimport jquery by mistake (sometimes included in a package like jQuery tools).

這篇關于Fancybox 不是函數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

jQuery/JavaScript Library for avatar creation?(用于創建頭像的 jQuery/JavaScript 庫?)
How to do following mask input problem?(如何做以下掩碼輸入問題?)
Issues Setting Value/Label Using DropKick Javascript(使用 DropKick Javascript 設置值/標簽的問題)
how to unit-test private methods in jquery plugins?(如何對 jquery 插件中的私有方法進行單元測試?)
stellar.js - configuring offsets / aligning elements for a vertical scrolling website?(stellar.js - 為垂直滾動網站配置偏移量/對齊元素?)
jQuery masked input plugin. select all content when textbox receives focus(jQuery 屏蔽輸入插件.當文本框獲得焦點時選擇所有內容)
主站蜘蛛池模板: 日韩免费视频 | 亚洲一区二区中文字幕 | 91精品久久久久久久久久入口 | 久久机热 | 精品日韩电影 | 亚洲网址在线观看 | 精品婷婷| 欧美精品在线一区 | 欧美成人a∨高清免费观看 老司机午夜性大片 | 欧美一区二区三区视频 | 在线亚洲一区 | 国产一区二区三区四区hd | 欧美中文一区 | 久久精品欧美视频 | 日韩欧美在线观看 | 精品蜜桃一区二区三区 | 日韩福利视频 | 精品亚洲视频在线 | 国产伦精品一区二区三区精品视频 | 国产精品成人品 | 91在线精品播放 | 热99精品视频 | 免费成人高清在线视频 | 国产精品一区二区三区久久 | 国产天堂| 久久久久国产 | 国产精品久久久久久久久久妞妞 | 日日干日日色 | 在线视频 亚洲 | 国产精品久久久久久久久久软件 | 成人激情视频网 | 激情欧美一区二区三区中文字幕 | 一区二区三区久久 | 日韩欧美在线不卡 | 国产精品一区二区福利视频 | 欧美久久久久久 | 久久久国产精品 | 黄色大片网站 | 天堂视频中文在线 | 久久噜噜噜精品国产亚洲综合 | 亚洲视频在线一区 |