久久久久久久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 屏蔽輸入插件.當文本框獲得焦點時選擇所有內容)
主站蜘蛛池模板: 久久久精品一区二区三区 | 欧美日本精品 | 久久综合五月天 | 天堂√ | 97超碰资源站 | 国产又粗又猛视频免费 | 欧美做爰xxxⅹ性欧美大片 | 免费精品 | 性色av一区二区 | 国产中文字幕一区二区 | 97人人爱| 欧美黄色一级视频 | 欧美顶级黄色大片免费 | 久久精彩 | 高清视频一区二区 | 国产日韩欧美在线 | a级片毛片 | 成人在线视频免费观看 | 四虎久久| 天天色天天爱 | 欧美福利一区二区 | 在线色网站 | 国产在线观看一区二区三区 | 国产福利在线播放 | 中文字幕永久 | 欧美激情视频一区 | 免费黄网站在线观看 | 2021国产精品| 黄视频网站在线观看 | 欧美日韩国产一区 | 永久免费精品视频 | 国产日韩欧美日韩大片 | 久在线观看 | 99这里只有精品 | 日韩av在线免费看 | av日韩精品| www.午夜 | 精品视频在线播放 | 亚洲国产成人精品女人 | 久在线 | 一区二区三区高清 |