简体   繁体   English

AddThis插件在模式窗口中不起作用

[英]AddThis plugin doesn't work in modal window

My task was to create modal window with content (some details about game) which will be opened on row click (on Search page : 1 row - 1 game). 我的任务是创建包含内容(有关游戏的一些详细信息)的模式窗口,该窗口将在单击行时打开(在“搜索”页面上:1行-1个游戏)。 Content i try to get from aspx page. 我尝试从aspx页面获取的内容。 Cause this page are inherited from Master page where all scripts are attached (when i open this modal all scripts were loaded again and this broke page layout) i create second Master page only for this modal window where are included just necessary file, scripts etc. 因为此页面是从附加了所有脚本的母版页继承的(当我打开此模式时,所有脚本都被再次加载,这破坏了页面的布局),我仅为此模态窗口创建了第二个母版页,其中仅包含必需的文件,脚本等。

Problem : everything is fine exept one thing : on Page Searcg.aspx and in modal window i use addThis plugin . 问题:一切都很好,只有一件事:在Page Searcg.aspx和模态窗口中,我使用addThis插件 On Search page everything is initialized, but when i open modal - addThis plugin doesn't loaded needed icons etc. 在搜索页面上,所有内容均已初始化,但是当我打开模式时-addThis插件未加载所需的图标等。

How i use plugin : 我如何使用插件:

                    <!-- AddThis Button BEGIN -->
                    <div class="addthis_toolbox addthis_default_style">
                        <a class="addthis_button_facebook"></a>
                        <a class="addthis_button_email"></a>
                        <a class="addthis_button_twitter"></a>
                        <a class="addthis_button_print"></a>
                        <a class="addthis_button_compact"></a>
                        <script type="text/javascript">var addthis_config = { "data_track_clickback": true };</script>
                        <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=username"></script>
                    </div>
                    <!-- AddThis Button END -->

If you're dynamically loading the buttons within the modal window, you'll need to call addthis.init() and/or addthis.toolbox() to render the div. 如果要在模式窗口中动态加载按钮,则需要调用addthis.init()和/或addthis.toolbox()来渲染div。 Here's some more information from the AddThis website: 这是来自AddThis网站的更多信息:

http://support.addthis.com/customer/portal/articles/1293805-using-addthis-asynchronously http://support.addthis.com/customer/portal/articles/1293805-using-addthis-asynchronouslyly

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM