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

  • <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="qwawimqqmiuu" 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>

        動(dòng)態(tài)更改推文按鈕“數(shù)據(jù)文本"內(nèi)容

        Dynamically change Tweet Button quot;data-textquot; contents(動(dòng)態(tài)更改推文按鈕“數(shù)據(jù)文本內(nèi)容)
        <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="qwawimqqmiuu" 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>
                • 本文介紹了動(dòng)態(tài)更改推文按鈕“數(shù)據(jù)文本"內(nèi)容的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

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

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

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

                  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');
                              });
                          ...
                      }
                  

                  發(fā)生的情況是 data-text 屬性是根據(jù)先發(fā)生的情況設(shè)置的,之后不會(huì)更改.

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

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

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

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

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

                  Traits 表可以安全地忽略.我想對(duì) Sociotypes 表做的是,當(dāng)你點(diǎn)擊一個(gè)類(lèi)型時(shí),右側(cè)描述下方的 Tweet Button 的 data-text 應(yīng)該相應(yīng)更改.

                  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.

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

                  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 僅在我第一次運(yùn)行腳本時(shí)更改,但我需要根據(jù)類(lèi)型更改多次更新它.

                  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.

                  推薦答案

                  今天早上我為此苦苦掙扎了幾個(gè)小時(shí),但終于成功了!問(wèn)題本質(zhì)上是您只能在頁(yè)面中包含 twitter widgets.js 腳本 once,并且該腳本會(huì)評(píng)估 data-text 屬性負(fù)載.因此,在您的示例中,您在加載腳本之前動(dòng)態(tài)設(shè)置 data-text 屬性 ,這將按預(yù)期工作.但是,由于腳本已經(jīng)運(yùn)行,因此您無(wú)法再進(jìn)行更新.

                  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.

                  我看到這篇文章建議你可以調(diào)用twttr.widgets.load() 在運(yùn)行時(shí)再次重新評(píng)估和重新渲染按鈕,但這對(duì)我不起作用.這是因?yàn)樵摵瘮?shù)重新評(píng)估 <a> 標(biāo)簽,而不是 <iframe> 標(biāo)簽!

                  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>,然后在調(diào)用 twttr.widgets.load 之前創(chuàng)建一個(gè)具有所有適當(dāng)屬性的新 元素() 最終重新評(píng)估它并把它變成一個(gè) <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>.

                  請(qǐng)參閱 this fiddle 了解工作示例!

                  Please see this fiddle for a working example!

                  這篇關(guān)于動(dòng)態(tài)更改推文按鈕“數(shù)據(jù)文本"內(nèi)容的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                  anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項(xiàng)目中不起作用)
                  Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數(shù)據(jù)更新 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 中,如何創(chuàng)建使用 Ionic 組件的自定義指令?)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動(dòng)態(tài)元素 - 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="qwawimqqmiuu" 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>
                            主站蜘蛛池模板: 久久综合九色综合欧美狠狠 | 99爱国产| 成在线人视频免费视频 | 狠狠操电影 | 99久久99| 亚洲一二三区精品 | 精品免费视频一区二区 | 亚洲欧美日韩精品久久亚洲区 | www.久久久.com| 日韩精品a在线观看图片 | 中文字幕精品一区二区三区精品 | 国产在线观看一区二区三区 | 蜜臀av日日欢夜夜爽一区 | 在线免费小视频 | 久久亚洲国产 | 国产99久久精品一区二区永久免费 | 一区二区三区免费 | 欧美激情久久久 | 一区二区精品在线 | 成人国产精品久久久 | 国产激情视频在线免费观看 | 国产精品一区网站 | 久久久成人网 | 欧美激情久久久 | 欧美成人a∨高清免费观看 91伊人 | 逼逼网 | 一级在线毛片 | 国产精品久久久久久久久久久久午夜片 | 在线一区二区三区 | 神马久久av | 精品中文字幕一区二区三区 | 欧美一区二区三区高清视频 | 无码一区二区三区视频 | 久久99久久 | 久久黄网 | 日日夜夜天天 | 盗摄精品av一区二区三区 | 天天草夜夜骑 | 亚洲一区欧美一区 | 日韩久久久久 | 999免费观看视频 |