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

重新定位 Jquery UI 自動完成結果框

Re-positioning Jquery UI Autocomplete Results Box(重新定位 Jquery UI 自動完成結果框)
本文介紹了重新定位 Jquery UI 自動完成結果框的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在使用 Jquery UI 自動完成插件作為直接搜索詞建議工具.除了我無法移動結果框外,它已啟動并運行,沒有任何問題.我基本上需要將它向左移動 20 像素,向下移動 4 像素.我試圖覆蓋 Jquery UI CSS,但無法重新定位框.

I am using the Jquery UI Autocomplete plugin for a straight forward search term suggestion tool. It is up and running with no problems except that I cannot move the results box. I basically need to move it 20 pixels to the left and 4 pixels down. I have attempted to overwrite the Jquery UI CSS, but have not been able to reposition the box.

非常感謝有此問題經驗的人提供任何幫助.

Any help from someone experienced with this issue would be greatly appreciated.

推薦答案

這里有一種方法可以做到這一點,點擊 open 事件并在該事件發生時更改菜單的位置:

Here's one way you could do it, tapping into the open event and changing the position of the menu when that event occurs:

$("#autocomplete").autocomplete({
    appendTo: "#results",
    open: function() {
        var position = $("#results").position(),
            left = position.left, top = position.top;

        $("#results > ul").css({left: left + 20 + "px",
                                top: top + 4 + "px" });

    }
});

我還使用 appendTo 選項來輕松查找包含菜單的 ul.不過,您可以在沒有此選項的情況下執行此操作.

I'm also using the appendTo option to make finding the ul that contains the menu easily. You could do it without this option though.

這是一個工作示例:http://jsfiddle.net/9QmPr/

這篇關于重新定位 Jquery UI 自動完成結果框的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 屏蔽輸入插件.當文本框獲得焦點時選擇所有內容)
主站蜘蛛池模板: 欧美一级片 | 一级黄色片免费在线观看 | 九色在线观看 | 99国产精品视频免费观看一公开 | 日韩中文字幕在线视频 | 久久精品视频网站 | 国产高清视频 | 九九热精品在线 | 91精品国产91久久久久久吃药 | 日韩一区二区免费视频 | 久草影视在线 | 91精品久久久 | 在线欧美小视频 | 1级毛片| 在线视频一区二区 | 日韩不卡视频在线观看 | 国产一区二区在线免费观看 | 国产小视频精品 | 日韩精品一二三 | 国产精品乱码一区二三区小蝌蚪 | 99亚洲| 欧洲一区二区三区 | 亚洲欧美精品久久 | 日本精品裸体写真集在线观看 | 日韩精品免费一区 | 日韩精品久久久久久 | 国产欧美一区二区三区在线看蜜臀 | 91麻豆精品国产91久久久更新资源速度超快 | 成人亚洲网 | 天堂一区| 亚洲欧洲视频 | 日日摸夜夜添夜夜添精品视频 | 国产成人久久精品一区二区三区 | 久草视频在线播放 | 国产精品久久久久久吹潮日韩动画 | 91久久精品一区 | av网站免费在线观看 | 综合久久99 | 久久久久国产精品 | 久久久亚洲 | 亚洲国产aⅴ成人精品无吗 欧美激情欧美激情在线五月 |