Exchange word - mobile problem
3 posters
Page 1 of 1
Exchange word - mobile problem
Technical Details
Forum version : #phpBB3
Position : Founder
Concerned browser(s) : Mozilla Firefox, Google Chrome, Other
Who the problem concerns : All members
When the problem appeared : Few days ago
Forum link : https://testyyyforum.forumpolish.com/t1-your-first-subject
Description of problem
Hello. I have problem with this code:- Code:
if(/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)){
$(function(){
$(".post-section .post-content").each(function(){
var _1=$(this).html();
var _2=_1.replace(/gazeta/gi,"<a target='blank' rel='nofollow' href='gazeta.pl'>GAZETA</a>");
$(this).html(_2);
var _1=$(this).html();
var _2=_1.replace(/Soccer/gi,"<a target='blank' rel='nofollow' href='https://www.meczyki.pl/'>Soccer</a>");
$(this).html(_2);
});
});
}
Few days ago everything was be ok, but now, when I use this code members can't see pictures on mobile phone Can you exchange me this code? This code changes the text to a link on mobile if you don't know. Thanks for help
Screen:
Last edited by tester2 on August 19th 2020, 1:19 pm; edited 1 time in total
Re: Exchange word - mobile problem
Hello @tester2,
Welcome to Forumotion Support Forum! Change your code to:
Welcome to Forumotion Support Forum! Change your code to:
- Code:
(function($) {
'use strict';
$(function() {
if (!_userdata.tpl_mobile) return;
$('.post-content').each(function() {
var $this = $(this);
$this
.html($this.html().replace(/gazeta/g, '<a target="blank" rel="nofollow" href="gazeta.pl">GAZETA</a>').replace(/soccer/g, '<a target="blank" rel="nofollow" href="https://www.meczyki.pl/">Soccer</a>'));
$('img').each(function() {
var $data = $(this);
$data
.attr('src', $data.attr('data-src'))
.css('height', 'auto');
});
});
});
})(jQuery);
TonnyKamper and tester2 like this post
Re: Exchange word - mobile problem
Problem solved & topic archived.
|
Similar topics
» Traffic Exchange Problem
» Word Censoring Problem
» Problem in Add a word counter to the editor
» Mobile version problem
» Problem with the mobile version
» Word Censoring Problem
» Problem in Add a word counter to the editor
» Mobile version problem
» Problem with the mobile version
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum