Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Phone Number

 
  • fevzi
  • Junior Member
  • Members
  • Join Date: 11-Nov 10
  • 258 posts

Posted 08 April 2015 - 01:17 PM #1

Need the company phone number in the header

 
  • antev
  • Architect
  • Twigmo team
  • Join Date: 07-Oct 10
  • 110 posts

Posted 09 April 2015 - 08:41 AM #2

Hello,

It is possible to add some content to the page by using Java Script code. Please enter the code below to the "Custom JavaScript" section in the Twigmo Visual Editor:

(function() {
  var contentElement;
  var addPhoneNumber = function() {
	var newElement = document.createElement('div');
	newElement.innerHTML = '<p style="text-align: center; margin: 2px;"><a href="tel:18475555555">Click Here To Call Support 1-847-555-5555</a></p>';
	contentElement.insertBefore(newElement, contentElement.firstChild);
  }
  var initContent = function() {
	contentElement = document.getElementById('all_content');
	if (!contentElement) {
	  window.setTimeout(initContent, 100);
	} else {
	  addPhoneNumber();
	}
  }
  initContent();
})();

You can modify html code in this line:

newElement.innerHTML = '<p style="text-align: center; margin: 2px;"><a href="tel:18475555555">Click Here To Call Support 1-847-555-5555</a></p>';

Here you can see it in action: http://antev3.mymerchium.ru/?mobile .
Evgeniy Antonov,
Twigmo team

 
  • stasok
  • Advanced Member
  • Members
  • Join Date: 12-Mar 12
  • 60 posts

Posted 27 October 2015 - 09:32 AM #3

Hello,

It is possible to add some content to the page by using Java Script code. Please enter the code below to the "Custom JavaScript" section in the Twigmo Visual Editor:
 

(function() {
  var contentElement;
  var addPhoneNumber = function() {
	var newElement = document.createElement('div');
	newElement.innerHTML = '<p style="text-align: center; margin: 2px;"><a href="tel:18475555555">Click Here To Call Support 1-847-555-5555</a></p>';
	contentElement.insertBefore(newElement, contentElement.firstChild);
  }
  var initContent = function() {
	contentElement = document.getElementById('all_content');
	if (!contentElement) {
	  window.setTimeout(initContent, 100);
	} else {
	  addPhoneNumber();
	}
  }
  initContent();
})();
You can modify html code in this line:

newElement.innerHTML = '<p style="text-align: center; margin: 2px;"><a href="tel:18475555555">Click Here To Call Support 1-847-555-5555</a></p>';
Here you can see it in action: http://antev3.mymerchium.ru/?mobile .

 

 

Pleas help, My code work, but partly.

 

Added code below. But working(rendering) only if i press "F5" on keyboard. What i can do? how to fix it's code?
 
(function() {
  var contentElement;
  var addPhoneNumber = function() {
var newElement = document.createElement('div');
newElement.innerHTML = '<div><h4 style="text-align:center;margin-top:15px">Остались вопросы? Позвоните Нам!</h4></div>';
contentElement.appendChild(newElement, contentElement);
  }
  var initContent = function() {
contentElement = document.getElementById('content');
if (!contentElement) {
  window.setTimeout(initContent, 100);
} else {
  addPhoneNumber();
}
  }
  initContent();
})();
 

Best cs cart theme UniTheme and YoupiTheme!
Want discount? Write me In private.
Cs-cart customisation services.

 
  • xmaster007
  • Junior Member
  • Members
  • Join Date: 20-Nov 09
  • 89 posts

Posted 23 December 2017 - 11:26 PM #4

Have you figured out the issue with F5 Refresh? I have the same problem. Please help.



 
  • xmaster007
  • Junior Member
  • Members
  • Join Date: 20-Nov 09
  • 89 posts

Posted 25 December 2017 - 06:15 AM #5

It took a while, but now all works good!