pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <small id='fIEOI'></small><noframes id='fIEOI'>

    <i id='fIEOI'><tr id='fIEOI'><dt id='fIEOI'><q id='fIEOI'><span id='fIEOI'><b id='fIEOI'><form id='fIEOI'><ins id='fIEOI'></ins><ul id='fIEOI'></ul><sub id='fIEOI'></sub></form><legend id='fIEOI'></legend><bdo id='fIEOI'><pre id='fIEOI'><center id='fIEOI'></center></pre></bdo></b><th id='fIEOI'></th></span></q></dt></tr></i><div class="z9zplpv" id='fIEOI'><tfoot id='fIEOI'></tfoot><dl id='fIEOI'><fieldset id='fIEOI'></fieldset></dl></div>
    <tfoot id='fIEOI'></tfoot>
    • <bdo id='fIEOI'></bdo><ul id='fIEOI'></ul>

      1. <legend id='fIEOI'><style id='fIEOI'><dir id='fIEOI'><q id='fIEOI'></q></dir></style></legend>

        動態更改推文按鈕“數據文本"內容

        Dynamically change Tweet Button quot;data-textquot; contents(動態更改推文按鈕“數據文本內容)
        <tfoot id='lrU14'></tfoot>

            <i id='lrU14'><tr id='lrU14'><dt id='lrU14'><q id='lrU14'><span id='lrU14'><b id='lrU14'><form id='lrU14'><ins id='lrU14'></ins><ul id='lrU14'></ul><sub id='lrU14'></sub></form><legend id='lrU14'></legend><bdo id='lrU14'><pre id='lrU14'><center id='lrU14'></center></pre></bdo></b><th id='lrU14'></th></span></q></dt></tr></i><div class="dd7ljnv" id='lrU14'><tfoot id='lrU14'></tfoot><dl id='lrU14'><fieldset id='lrU14'></fieldset></dl></div>
              <legend id='lrU14'><style id='lrU14'><dir id='lrU14'><q id='lrU14'></q></dir></style></legend>

                <small id='lrU14'></small><noframes id='lrU14'>

                  <tbody id='lrU14'></tbody>
                • <bdo id='lrU14'></bdo><ul id='lrU14'></ul>
                • 本文介紹了動態更改推文按鈕“數據文本"內容的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  這個問題與我所追求的非常接近:用 Jquery 替換 Tweet 按鈕中的屬性

                  This question comes very closely to what I'm after: Replace an Attribute in the Tweet Button with Jquery

                  但是,建議的解決方案 只工作一次.也就是說,我不能像這樣在我的 switch 語句中使用它:

                  However, the suggested solution works just once. That is, I cannot use it in my switch statement like this:

                      switch(element.id)
                      {
                          case "t1":
                              $(document).ready(function(){
                                  $('a[data-text]').each(function(){
                                      $(this).attr('data-text', Text_Variant_1);
                                  });
                                  $.getScript('http://platform.twitter.com/widgets.js');
                              });
                              break;
                          case "t2":
                              $(document).ready(function(){
                                  $('a[data-text]').each(function(){
                                      $(this).attr('data-text', Text_Variant_2);
                                  });
                                  $.getScript('http://platform.twitter.com/widgets.js');
                              });
                          ...
                      }
                  

                  發生的情況是 data-text 屬性是根據先發生的情況設置的,之后不會更改.

                  What happens is that the data-text attribute is set according to whichever case happens first and doesn't change afterwards.

                  如何根據需要多次更改推文按鈕的 data-text 屬性?

                  How can I change data-text attribute of a Tweet Button as many times as I need?

                  更新:這是我正在處理的頁面:http://zhilkin.com/socio/en/

                  Update: here's the page I'm working on: http://zhilkin.com/socio/en/

                  Traits 表可以安全地忽略.我想對 Sociotypes 表做的是,當你點擊一個類型時,右側描述下方的 Tweet Button 的 data-text 應該相應更改.

                  The Traits table can be safely ignored. What I want to do with the Sociotypes table is that when you click on a type, the data-text of the Tweet Button below the description on the right should be changed accordingly.

                  現在它的工作原理是這樣的:如果我將鼠標懸停在或單擊堂吉訶德",那么 data-text 將設置為...堂吉訶德 ...",并且它保持如果我稍后單擊Dumas",則相同.反之亦然:如果我將鼠標懸停在或單擊Dumas",則 data-text 將設置為... Dumas ...",并且在單擊Don Quixote"時不會更改.(其他類型暫時為空.)

                  Right now it works like this: if I hover on or click "Don Quixote", then data-text is set to "... Don Quixote ...", and it stays the same if I click "Dumas" later. And vice versa: if I hover on or click "Dumas", then data-text is set to "... Dumas ..." and doesn't change if I click "Don Quixote". (Other types are empty at the moment.)

                  因此,Tweet Button 僅在我第一次運行腳本時更改,但我需要根據類型更改多次更新它.

                  So, the Tweet Button is only changed the first time I run the script, but I need it to be updated as many times as the type changes.

                  推薦答案

                  今天早上我為此苦苦掙扎了幾個小時,但終于成功了!問題本質上是您只能在頁面中包含 twitter widgets.js 腳本 once,并且該腳本會評估 data-text 屬性負載.因此,在您的示例中,您在加載腳本之前動態設置 data-text 屬性 ,這將按預期工作.但是,由于腳本已經運行,因此您無法再進行更新.

                  I struggled with this for a couple of hours this morning, but finally got it working! The problem is essentially that you can only include the twitter widgets.js script once in the page, and that script evaluates the data-text attribute on load. Therefore, in your example, you dynamically set the data-text attribute before loading the script, which will work as expected. However, you can then make no further updates as the script has already run.

                  我看到這篇文章建議你可以調用twttr.widgets.load() 在運行時再次重新評估和重新渲染按鈕,但這對我不起作用.這是因為該函數重新評估 <a> 標簽,而不是 <iframe> 標簽!

                  I saw this article suggesting you can call twttr.widgets.load() again at runtime to re-evaluate and re-render the buttons, however that didn't work for me. This is because that function re-evaluates <a> tags, not <iframe> tags!

                  因此,正如 此處指出,解決方案是從 DOM 中完全移除渲染的 <iframe>,然后在調用 twttr.widgets.load 之前創建一個具有所有適當屬性的新 元素() 最終重新評估它并把它變成一個 <iframe>.

                  So the solution, as pointed out here, is to completely remove the rendered <iframe> from the DOM, then make a new <a> element with all the appropriate attributes before calling twttr.widgets.load() to finally re-evaluate it and turn it into an <iframe>.

                  請參閱 this fiddle 了解工作示例!

                  Please see this fiddle for a working example!

                  這篇關于動態更改推文按鈕“數據文本"內容的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                  anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                  Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數據更新 Observable)
                  Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                  In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何創建使用 Ionic 組件的自定義指令?)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態元素 - Angular 2 amp;離子2)

                  1. <tfoot id='As2g8'></tfoot>

                      <bdo id='As2g8'></bdo><ul id='As2g8'></ul>

                        <tbody id='As2g8'></tbody>

                        <small id='As2g8'></small><noframes id='As2g8'>

                        <i id='As2g8'><tr id='As2g8'><dt id='As2g8'><q id='As2g8'><span id='As2g8'><b id='As2g8'><form id='As2g8'><ins id='As2g8'></ins><ul id='As2g8'></ul><sub id='As2g8'></sub></form><legend id='As2g8'></legend><bdo id='As2g8'><pre id='As2g8'><center id='As2g8'></center></pre></bdo></b><th id='As2g8'></th></span></q></dt></tr></i><div class="rfvfhv7" id='As2g8'><tfoot id='As2g8'></tfoot><dl id='As2g8'><fieldset id='As2g8'></fieldset></dl></div>
                            <legend id='As2g8'><style id='As2g8'><dir id='As2g8'><q id='As2g8'></q></dir></style></legend>
                            主站蜘蛛池模板: 蓝莓施肥机,智能施肥机,自动施肥机,水肥一体化项目,水肥一体机厂家,小型施肥机,圣大节水,滴灌施工方案,山东圣大节水科技有限公司官网17864474793 | 自动记录数据电子台秤,记忆储存重量电子桌称,设定时间记录电子秤-昆山巨天 | 上海律师事务所_上海刑事律师免费咨询平台-煊宏律师事务所 | 冷柜风机-冰柜电机-罩极电机-外转子风机-EC直流电机厂家-杭州金久电器有限公司 | 双能x射线骨密度检测仪_dxa骨密度仪_双能x线骨密度仪_品牌厂家【品源医疗】 | 北京森语科技有限公司-模型制作专家-展览展示-沙盘模型设计制作-多媒体模型软硬件开发-三维地理信息交互沙盘 | 刮板输送机,粉尘加湿搅拌机,螺旋输送机,布袋除尘器 | 湖南档案密集架,智能,物证,移动,价格-湖南档案密集架厂家 | 烟台条码打印机_烟台条码扫描器_烟台碳带_烟台数据采集终端_烟台斑马打印机-金鹏电子-金鹏电子 | CTP磁天平|小电容测量仪|阴阳极极化_双液系沸点测定仪|dsj电渗实验装置-南京桑力电子设备厂 | 兰州牛肉面加盟,兰州牛肉拉面加盟-京穆兰牛肉面 | 全自动翻转振荡器-浸出式水平振荡器厂家-土壤干燥箱价格-常州普天仪器 | 软文发布-新闻发布推广平台-代写文章-网络广告营销-自助发稿公司媒介星 | 谈股票-今日股票行情走势分析-牛股推荐排行榜 | 钢骨架轻型板_膨石轻型板_钢骨架轻型板价格_恒道新材料 | 派克防爆伺服电机品牌|国产防爆伺服电机|高低温伺服电机|杭州摩森机电科技有限公司 | 潍坊青州古城旅游景点攻略_青州酒店美食推荐-青州旅游网 | 临朐空调移机_空调维修「空调回收」临朐二手空调 | 对夹式止回阀_对夹式蝶形止回阀_对夹式软密封止回阀_超薄型止回阀_不锈钢底阀-温州上炬阀门科技有限公司 | 微波萃取合成仪-电热消解器价格-北京安合美诚科学仪器有限公司 | 定时排水阀/排气阀-仪表三通旋塞阀-直角式脉冲电磁阀-永嘉良科阀门有限公司 | 企业管理培训,企业培训公开课,企业内训课程,企业培训师 - 名课堂企业管理培训网 | 环保袋,无纺布袋,无纺布打孔袋,保温袋,环保袋定制,环保袋厂家,环雅包装-十七年环保袋定制厂家 | 快速卷帘门_硬质快速卷帘门-西朗门业| 热回收盐水机组-反应釜冷水机组-高低温冷水机组-北京蓝海神骏科技有限公司 | 真石漆,山东真石漆,真石漆厂家,真石漆价格-山东新佳涂料有限公司 | 山东集装箱活动房|济南集装箱活动房-济南利森集装箱有限公司 | 巨野电机维修-水泵维修-巨野县飞宇机电维修有限公司 | 重庆小面培训_重庆小面技术培训学习班哪家好【终身免费复学】 | 天津拓展_天津团建_天津趣味运动会_天津活动策划公司-天津华天拓展培训中心 | 【MBA备考网】-2024年工商管理硕士MBA院校/报考条件/培训/考试科目/提前面试/考试/学费-MBA备考网 | 深圳公司注册-工商注册公司-千百顺代理记账公司 | 世界箱包品牌十大排名,女包小众轻奢品牌推荐200元左右,男包十大奢侈品牌排行榜双肩,学生拉杆箱什么品牌好质量好 - Gouwu3.com | 气动隔膜泵-电动隔膜泵-循环热水泵-液下排污/螺杆/管道/化工泵「厂家」浙江绿邦 | b2b网站大全,b2b网站排名,找b2b网站就上地球网 | 花纹铝板,合金铝卷板,阴极铝板-济南恒诚铝业有限公司 | 东莞猎头公司_深圳猎头公司_广州猎头公司-广东万诚猎头提供企业中高端人才招聘服务 | 我爱古诗词_古诗词名句赏析学习平台| 领先的大模型技术与应用公司-中关村科金 | 领先的大模型技术与应用公司-中关村科金| 本安接线盒-本安电路用接线盒-本安分线盒-矿用电话接线盒-JHH生产厂家-宁波龙亿电子科技有限公司 |