tag:blogger.com,1999:blog-6670856475198141739.post8271025736834010656..comments2024-11-21T13:30:12.218+07:00Comments on Blog bungfrangki: Menampilkan Komentar Gambar di Blogger dengan JavaScriptBungfrangkihttp://www.blogger.com/profile/13162875744493565460noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-6670856475198141739.post-4993836857334858642024-08-31T13:16:31.324+07:002024-08-31T13:16:31.324+07:00tks sob... mantap tenan.. :Dtks sob... mantap tenan.. :DKang Ismethttps://www.blogger.com/profile/07706142952405337288noreply@blogger.comtag:blogger.com,1999:blog-6670856475198141739.post-14354478522803294462024-08-31T13:10:40.305+07:002024-08-31T13:10:40.305+07:00Atau gini aja kang, supaya nanti gak bertabrakan d...Atau gini aja kang, supaya nanti gak bertabrakan dengan JS yg lain di kemudian hari. bungkus aja JS untuk menampilkan gambar di komentar dengan ini:<br /><em>document.addEventListener(&#39;DOMContentLoaded&#39;, () =&gt; { <br /><br>// JS untuk menampilkan gambar pada komentar disini... <br><br />});</em>Bungfrangkihttps://www.blogger.com/profile/13162875744493565460noreply@blogger.comtag:blogger.com,1999:blog-6670856475198141739.post-34702410726015798112024-08-31T13:03:26.766+07:002024-08-31T13:03:26.766+07:00nah itu udah mantap sekali :Dnah itu udah mantap sekali :DBungfrangkihttps://www.blogger.com/profile/13162875744493565460noreply@blogger.comtag:blogger.com,1999:blog-6670856475198141739.post-91506114130476135202024-08-31T12:55:53.384+07:002024-08-31T12:55:53.384+07:00weleh ternyata simple cuman tukar posisi wkwkwkw.....weleh ternyata simple cuman tukar posisi wkwkwkw... udah puyeng, tks bung... btw penambahan class udah buat nambah margin cek <b>kang-ismet.com/p/demo-sisipan-komentar.html</b>Kang Ismethttps://www.blogger.com/profile/07706142952405337288noreply@blogger.comtag:blogger.com,1999:blog-6670856475198141739.post-40136542698136377102024-08-31T12:46:05.261+07:002024-08-31T12:46:05.261+07:00mungkin bisa coba dengan tukar posisi JS-nya kang,...mungkin bisa coba dengan tukar posisi JS-nya kang, yang js untuk menampilkan gambar di komentar letakkan di bawah js emoticonBungfrangkihttps://www.blogger.com/profile/13162875744493565460noreply@blogger.comtag:blogger.com,1999:blog-6670856475198141739.post-49018862711038193082024-08-31T12:44:06.117+07:002024-08-31T12:44:06.117+07:00hmmm, padahal selectornya beda kan ya kang. awalny...hmmm, padahal selectornya beda kan ya kang. awalnya saya ingin menyarankan untuk menambahkan class di img, seperti ini<br /><em>imgTag.classList.add(&#39;imageToShow&#39;);</em><br />tapi setelah cek hasilnya saat gabungkan js dari source-code kang Ismet dengan js di atas, hasilnya kok normal ya.<br /><i rel="img">https://i.ibb.co.com/Mkn8NGF/js-image-and-icon.png</i>Bungfrangkihttps://www.blogger.com/profile/13162875744493565460noreply@blogger.comtag:blogger.com,1999:blog-6670856475198141739.post-29406668121850290672024-08-31T10:36:44.376+07:002024-08-31T10:36:44.376+07:00kode di atas bentrok sama js emoticon, sebelum ada...kode di atas bentrok sama js emoticon, sebelum ada emoji di komentar js diatas jalan, tapi kalau udah muncul emote button show image ga bisa dibuka, ini js emote nya.. solusinya gimana bung? <em>a = document.getElementById(&#39;comment-holder&#39;);<br />if (a) {<br /> b = a.getElementsByTagName(&quot;p&quot;);<br /> for (i = 0; i &lt; b.length; i++) {<br /> if (b.item(i).getAttribute(&#39;CLASS&#39;) == &#39;isi-komen&#39;) {<br /> bh_b_smly = b.item(i).inner糖心vlog官方入口.replace(/&lt;\3/gi, &quot;&lt;span class=&#39;emoji-cmt-love&#39;/&gt;&quot;);<br /> bh_b_smly = bh_b_smly.replace(/:\)/gi, &quot;&lt;span class=&#39;emoji-cmt&#39;/&gt;&quot;);<br /> bh_b_smly = bh_b_smly.replace(/:\(/gi, &quot;&lt;span class=&#39;emoji-cmt-cry&#39;/&gt;&quot;);<br /> bh_b_smly = bh_b_smly.replace(/:D/gi, &quot;&lt;span class=&#39;emoji-cmt-laught&#39;/&gt;&quot;);<br /> bh_b_smly = bh_b_smly.replace(/:top/gi, &quot;&lt;span class=&#39;emoji-cmt-thumbup&#39;/&gt;&quot;);<br /> bh_b_smly = bh_b_smly.replace(/:love/gi, &quot;&lt;img src=&#39;https://tutorial.kang-ismet.com/img/heart.png&#39; alt=&#39;heart&#39; class=&#39;emoji-cmt-love&#39;/&gt;&quot;);<br /> bh_b_smly = bh_b_smly.replace(/&amp;lt;3/gi, &quot;&lt;img src=&#39;https://tutorial.kang-ismet.com/img/heart.png&#39; alt=&#39;heart&#39; class=&#39;emoji-cmt-love&#39;/&gt;&quot;);<br /> bh_b_smly = bh_b_smly.replace(/&lt;i rel=&quot;kangismet&quot;&gt;https?:\/\/www\.kang-ismet\.com\/(.*?)&lt;\/i&gt;/ig, &quot;&lt;a target=&#39;_blank&#39; href=&#39;https://www.kang-ismet.com/$1&#39;&gt;[LINK]&lt;\/a&gt;&quot;);<br /> bh_b_smly = bh_b_smly.replace(/&lt;i rel=&quot;corkismet&quot;&gt;https?:\/\/corkismet\.blogspot\.com\/(.*?)&lt;\/i&gt;/ig, &quot;&lt;a href=&#39;https://corkismet.blogspot.com/$1&#39;&gt;[LINK]&lt;\/a&gt;&quot;);<br /> b.item(i).inner糖心vlog官方入口 = bh_b_smly;<br /> }<br /> }<br />}</em>Kang Ismethttps://www.blogger.com/profile/07706142952405337288noreply@blogger.comtag:blogger.com,1999:blog-6670856475198141739.post-39513806112321039702024-08-28T11:41:16.990+07:002024-08-28T11:41:16.990+07:00hahahaha mengingatkan pada sang pencetus :Dhahahaha mengingatkan pada sang pencetus :DKang Ismethttps://www.blogger.com/profile/07706142952405337288noreply@blogger.comtag:blogger.com,1999:blog-6670856475198141739.post-53067014654341814802024-08-28T11:37:13.286+07:002024-08-28T11:37:13.286+07:00hehehe malah foto saya yang terpampang nyata disan...hehehe malah foto saya yang terpampang nyata disana :DBungfrangkihttps://www.blogger.com/profile/13162875744493565460noreply@blogger.comtag:blogger.com,1999:blog-6670856475198141739.post-20495330243054260152024-08-28T11:34:11.604+07:002024-08-28T11:34:11.604+07:00worked.. udah saya coba di tutorial.kang-ismet.com...worked.. udah saya coba di <b>tutorial.kang-ismet.com/tryit/comment-img</b> nanti saya terapkan di blog. tks bung Kang Ismethttps://www.blogger.com/profile/07706142952405337288noreply@blogger.comtag:blogger.com,1999:blog-6670856475198141739.post-5524152033038378312024-08-28T11:07:39.719+07:002024-08-28T11:07:39.719+07:00mungkin seperti ini bisa kang: const imgElements =...mungkin seperti ini bisa kang:<br /><em>const imgElements = document.querySelectorAll(&#39;i[rel=&quot;img&quot;]&#39;);<br />imgElements.forEach((element) =&gt; {<br /> const imgTag = document.createElement(&#39;img&#39;);<br /> const imgUrl = element.textContent;<br /> imgTag.src = imgUrl;<br /> element.inner糖心vlog官方入口 = &#39;&#39;;<br /> element.appendChild(imgTag);<br /> imgTag.style.display = &#39;none&#39;;<br /> imgTag.setAttribute(&#39;alt&#39;, &#39;&#39;);<br /> const button = document.createElement(&#39;button&#39;);<br /> button.textContent = &#39;Show Image&#39;;<br /> button.classList.add(&#39;ShowImageComment&#39;);<br /> element.appendChild(button);<br /> button.addEventListener(&#39;click&#39;, () =&gt; {<br /> button.remove();<br /> imgTag.style.display = &#39;block&#39;;<br /> });<br />});</em>Bungfrangkihttps://www.blogger.com/profile/13162875744493565460noreply@blogger.comtag:blogger.com,1999:blog-6670856475198141739.post-30967167859850684422024-08-28T08:53:07.048+07:002024-08-28T08:53:07.048+07:00kayaknya kalau teks URL hilang, langsung button Sh...kayaknya kalau teks URL hilang, langsung button Show Image, lebih rapi ya.. coba JS nya kaya gimana?Kang Ismethttps://www.blogger.com/profile/07706142952405337288noreply@blogger.comtag:blogger.com,1999:blog-6670856475198141739.post-68266410193237895922024-08-28T07:18:10.401+07:002024-08-28T07:18:10.401+07:00hehehe iya kang sekarang url image blogger makin p...hehehe iya kang sekarang url image blogger makin panjang ajaBungfrangkihttps://www.blogger.com/profile/13162875744493565460noreply@blogger.comtag:blogger.com,1999:blog-6670856475198141739.post-16618400028852677502024-08-27T22:44:13.764+07:002024-08-27T22:44:13.764+07:00Alhamdulillah jadi ide postingan.. kalau mastah la...Alhamdulillah jadi ide postingan.. kalau mastah langsung dapet solusi, mantab.. btw ya itu konsekwensi image blogger, panjang banget url nya :)Kang Ismethttps://www.blogger.com/profile/07706142952405337288noreply@blogger.com