Добавление к коду JQuery для показа всех скрытых элементов по 1 клику
Здравствуйте!
На Сайте есть скрытые номера телефонов, которые при клике они показываются. Посетитель сайта кликает каждый номер, чтобы конверсия не удваивалась в Гугл аналитике, нужно чтобы одним кликом показали все скрытые номера.
<script>
jQuery(document).ready(function($){
$.fn.textToggle = function(cls, str) {
return this.each(function(i) {
$(this).click(function() {
var c = 0, el = $(cls).eq(i), arr = [str,el.text()];
return function() {
el.text(arr[c++ % arr.length]);
}}());
})};
$(function(){
$('.sh_nmr').textToggle(".sh_nmr","").click();
$('.sh_nmr').textToggle(".num_hide","").click();
});
});
</script>
<span>+7(727) </span><span class="num_hide">222 22 22</span><span class="sh_nmr" onClick="ga('send','event','linkscolalmaty','click',);">показать</span><br>
<span>+7 775 </span><span class="num_hide">000 00 00</span><span class="sh_nmr" onClick="ga('send','event','linkscolalmatym','click',);">показать</span>
На Сайте есть скрытые номера телефонов, которые при клике они показываются. Посетитель сайта кликает каждый номер, чтобы конверсия не удваивалась в Гугл аналитике, нужно чтобы одним кликом показали ВСЕ скрытые номера включая подвал сайта.
jQuery(document).ready(function($){
$.fn.textToggle = function(cls, str) {
return this.each(function(i) {
$(this).click(function() {
var c = 0, el = $(cls).eq(i), arr = [str,el.text()];
return function() {
el.text(arr[c++ % arr.length]);
}}());
})};
$(function(){
$('.sh_nmr').textToggle(".sh_nmr","").click();
$('.sh_nmr').textToggle(".num_hide","").click();
});
});
+7(727) 222 22 22показать
+7 775 000 00 00показать
Контент __________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
footer#____________
г.Алматы, мкр. Мамыр-2, д. 16
г.Алматы, пр. Достык 202, БЦ "Forum"
г.Алматы, ул. Курмангазы 83
+7(727) показать
г.Актобе
ул. Братьев Жубановых, 275
+7(7132) показать
г.Астана
ул. Динмухамеда Кунаева 14/3
+7(7172) показать
Рабочий скрипт можете посмотреть на сайте https://happy-travel.kz
-
184 3 0 Добрый день сделаю все в течение 1 часа готов приступить сейчас пишите
-
120 Здравствуйте
Меня зовут Денис
Я занимается полным циклом разработки и поддержки сайтов и мобильных приложений любой сложности.
Также есть опыт работы с интернет-рекламой.
В кротчайшие сроки смогу выполнить Ваш заказ.
Некоторые мои проекты
gymstyle.pro
zomro.com
prommu.com
… phone +38 (094) 7117 098
skype live:den.dev.fo
Current freelance projects in the category HTML & CSS
Web design and developmentHello! For the current project, I am looking for two separate specialists: web designer (Figma) web developer (Frontend / WordPress) The project includes tasks such as: landing pages, online store, admin panels, WordPress site, as well as small tasks on React / Next.js and… HTML & CSS, Web Design ∙ 1 day 19 hours back ∙ 98 proposals |
A modern website is needed for a stretch ceiling company in Poland.
634 USD
Need a modern premium design, mobile device adaptation, fast loading, SEO, animations, calculator, portfolio, application form. Experience in creating websites in Poland, landing pages for construction or renovation companies is preferred. Please be sure to send examples of your… HTML & CSS, Web Programming ∙ 1 day 20 hours back ∙ 153 proposals |
A Drupal developer is needed for edits on several websites.A Drupal developer is needed for edits on several websites. The site has bloated and filled up all the hosting.. HTML & CSS, Web Programming ∙ 2 days 2 hours back ∙ 37 proposals |
Optimization of WordPress site speed
113 USD
We will send full details in private messages Goal Maximize website loading speed, especially on mobile devices. KPI (mandatory) After the work is completed, the following metrics must be achieved. Mobile Performance 90+ LCP less than 2.2 sec INP less than 200 ms CLS less than… HTML & CSS, Javascript and Typescript ∙ 2 days 17 hours back ∙ 65 proposals |
Create a website and connect it to Shopifyto create a website and connect it to Shopify the main page is in the mockup there will be no product pages, there will be a modal window for selecting the size of the cream jar and its quantity after that, a delivery and payment window the order must be sent to Shopify with… HTML & CSS, Web Programming ∙ 2 days 20 hours back ∙ 76 proposals |