工具提示,JQuery的滚动条在阿贾克斯工作不加载的内容 [英] Tooltip, JQuery scrollbars not working in Ajax loaded content
问题描述
我用 .append()
从另一个PHP页面在页面加载动态数据。问题是,从另一页有jQuery的滚动条和工具提示的内容。如果包括我的jquery.js,并在该页面的JavaScript剩余code动态加载的内容以及工作与jQuery的滚动条和工具提示,但如果我删除了jQuery在页面上它得到与原窗口滚动条和工具提示更换。什么是解决方案=此?
I use .append()
to load dynamic data in a page from another PHP page. The problem is the content from the another page have jquery scrollbars and tooltips. If I include jquery.js and remaining javascript code in that page the dynamically loaded content works well with the jquery scrollbars and tooltips but if I remove the jquery in that page it gets replaced with original windows scrollbar and tooltips. What is the solutions= for this?
样滚动code,
$('div.box')滚动条(); // scrolbars
PS:在使用.load()或.append()我需要从第二页中删除脚本文件的原因是,在主机页面冻结,直到动态数据负载完全
PS: The reason I need to remove the script files from the second page is while using .load() or .append(), the host page freezes till the dynamic data loads completely.
推荐答案
这将是一个真正的坏习惯也添加脚本在外部文件中再次文件。相反,你必须添加 $('div.box')滚动条();在回调// scrolbars
It will be really a bad practice too add script files again in the external file. Instead you have to add $('div.box').scrollbars();// scrolbars
in the callback.
例如:
$("#samplediv").load('external_page.extension', function()
{
$("#samplediv").scrollbars();
});
这篇关于工具提示,JQuery的滚动条在阿贾克斯工作不加载的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!