JSFiddle - React, Tailwind, and code Playground
by Ali Uygur
HTML
<ul class="mla w100 wsrc df jc alg">
<span class="df alg jc ml pad cp searchbtn" id="openSearchBtn">
<svg xmlns="http://www.w3.org/2000/svg" class="svgh" viewBox="0 0 16 16" width="20px" height="20px" fill="currentColor">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"></path>
</svg>
</span>
<?php do_action('bp_before_blog_search_form'); ?>
<form class="search-bar pstr" role="search" method="get" id="searchform" action="<?php echo home_url(); ?>/">
<meta itemprop="potentialAction" content="http://schema.org/SearchAction">
<meta itemprop="target" content="<?php echo home_url(); ?>/?s={s}">
<input type="text" class="mtb w100 mw100 pad br brdr wsrc tac" placeholder="ARA" value="<?php the_search_query(); ?>" name="s" id="s" itemprop="query-input" />
<?php do_action('bp_blog_search_form'); ?>
<svg xmlns="http://www.w3.org/2000/svg" class="psta lft df alg jc tps mlr" viewBox="0 0 16 16" width="20px" height="20px" fill="currentColor">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"></path>
</svg>
</form>
<?php do_action('bp_after_blog_search_form'); ?>
<!-- // search -->
</ul>
JavaScript
// setInterval() fonksiyonunu kullanarak kodun her 3 saniyede bir tekrarlanmasını sağlayın
setInterval(() => {
// Tüm .id-primary-owned-pets elemanlarını seçin
const pets = document.querySelectorAll('.id-primary-owned-pets > div > div > div');
// Her bir pet elementine yeni HTML kodu ekleyin
pets.forEach(pet => {
pet.innerHTML += '<div style="display:table;width:99%;"><div style="display:table-cell;vertical-align: middle;"><p>Yeni içerik</p></div><div class="table-cell-buttons" style="width:0;padding: 0 2em;"><a class="id-buy-cancel">iptal</a></div><div class="table-cell-buttons"><a data-role="button" data-mini="true" class="id-buy-again-confirm green ui-btn ui-shadow ui-btn-corner-all ui-mini ui-btn-hover-c ui-btn-up-c" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="c"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text">Şimdi Satın Al!</span></span></a><a data-role="button" data-mini="true" class="id-buy-newPrice green ui-btn ui-btn-up-c ui-shadow ui-btn-corner-all ui-mini" style="display:none;" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="c"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text">Yeni Fiyat Al!</span></span></a></div></div>';
});
}, 1500); // 3 saniyede bir tekrarlanacak şekilde zamanlayın (ms cinsinden)