Fórumok

How to Increase and Decrease the Textsize in Portal pages

Ravi Teja, módosítva 11 év-val korábban

How to Increase and Decrease the Textsize in Portal pages

New Member Bejegyzések: 21 Csatlakozás dátuma: 2012.07.09. Legújabb bejegyzések
Hi,

I want to Increase and Decrease the Text size(Font) of a Portal pages.
My Requirement is like this Please check this URL https://www.bcs.org/
is it possible to do with life ray?

Could someone Please help me out.
gordon daniels, módosítva 11 év-val korábban

RE: How to Increase and Decrease the Textsize in Portal pages

Liferay Master Bejegyzések: 797 Csatlakozás dátuma: 2008.08.24. Legújabb bejegyzések
Ravi: there are several ways you can do that. You can create a theme and include how you want fonts and layout to be. You can use the Web Content Portlet and add different size fonts, banners, images and other widgets.

But there is a learning curve :-)
Ravi Teja, módosítva 11 év-val korábban

RE: How to Increase and Decrease the Textsize in Portal pages

New Member Bejegyzések: 21 Csatlakozás dátuma: 2012.07.09. Legújabb bejegyzések
Hey Daniel,

Thanks for such quick reply ..

I am Implementing the same thing.

Here i used Jquery Plugin to Increase & Decrease the Font Size.
I am integratiating the the required Script in Theam. It is working For only <body> Tag (the content which is placed in inside <body> tag).
if i did't take <body> tag (OR) if i Declare the other Html Tags i.e outside the <body> Tag. The Font Size functionality is won't Effected for Other HtmlTags.
In this case I need to Write Jquery Code For All HTML Tags ?

(OR)

Any Other Solution is there to Overcome this?

Here i am Attaching my code. can u plz take a look at this.

main.js File


addDOMLoadEvent=(function(){var e=[],t,s,n,i,o,d=document,w=window,r='readyState',c='onreadystatechange',x=function(){n=1;clearInterval(t);while(i=e.shift())i();if(s)s[c]=''};return function(f){if(n)return f();if(!e[0]){d.addEventListener&amp;&amp;d.addEventListener("DOMContentLoaded",x,false);/*@cc_on@*//*@if(@_win32)d.write("<script id="__ie_onload" defer src="//0"><\/scr"+"ipt>");s=d.getElementById("__ie_onload");s[c]=function(){s[r]=="complete"&&x()};/*@end@*/if(/WebKit/i.test(navigator.userAgent))t=setInterval(function(){/loaded|complete/.test(d[r])&&x()},10);o=w.onload;w.onload=function(){x();o&&o()}}e.push(f)}})();
var fS={
  iFS:null,
  cFS:null,
  init: function (fC) {
    if (!document.getElementById || !document.createTextNode) { return; }
    if (UBCookie.read("fS")) {
      var sizes = UBCookie.read("fS").split(",");
      fS.iFS = sizes[0]*1; 
      fS.cFS = sizes[1]*1;
      fS.setBodySize();
    } else {
      var el = document.createElement('span');
      el.innerHTML = "&nbsp;";
      el.style.position = "absolute";
      el.style.left = "-9999px";
      el.style.lineHeight = "1em";
      document.body.insertBefore(el,document.body.firstChild);
      fS.iFS = el.offsetHeight/16;
      fS.cFS = fS.iFS;
      UBCookie.create("fS",fS.iFS+","+fS.cFS,30);
    }
    fS.addJSLink(fC,fS.incFS,"A+","increaseSize");
    fS.addJSLink(fC,fS.rFS,"R","resetSize");
    fS.addJSLink(fC,fS.decFS,"A-","decreaseSize");
  },
  incFS: function () {
    fS.cFS = fS.cFS*1.25;
    fS.setBodySize();
    return false;
  },
  decFS: function () {
    fS.cFS = fS.cFS*0.8;
    fS.setBodySize();
    return false;
  },
  rFS: function () {
    fS.cFS = fS.iFS;
    fS.setBodySize();
    return false;
  },
  setBodySize: function() {
		document.body.style.fontSize = fS.cFS + 'em';
    UBCookie.create("fS",fS.iFS+","+fS.cFS,30);
  },
  addJSLink: function (elementId, onClickFunction, linkText, className) {
	var element = document.getElementById(elementId);
	var link = document.createElement("a");
	link.className = className;
	var linkText = document.createTextNode(linkText);
	link.appendChild(linkText);
	link.onclick = onClickFunction;
	link.href="#"+elementId;
	element.appendChild(link);
  }
}

var UBCookie={
  create: function (name,value,days) {
	if (days) {
	  var date = new Date();
	  date.setTime(date.getTime()+(days*24*60*60*1000));
	  var expires = "; expires="+date.toGMTString();
	} else { var expires = ""; }
	document.cookie = name+"="+value+expires+"; path=/";
  },
  read: function (name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
	  var c = ca[i];
	  while (c.charAt(0)==' ') c = c.substring(1,c.length);
	  if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
  },
  erase: function(name) { createCookie(name,"",-1); }
}

addDOMLoadEvent(function() {fS.init("fontControls")});
</code></pre><br /><br /><strong>And in Theam  i included this</strong><br /><br />&lt;style type=&#34;text/css&#34;&gt;<br />body { font-size:62.5%; }<br /><br /> #fontControls a{margin:0 10px; border:1px solid #ccc; padding:3px; background<img alt="emoticon" src="@theme_images_path@/emoticons/kiss.gif" >f3f3f3 } <br />&lt;/style&gt;<br /><br />&lt;div id=&#34;fontControls&#34;&gt;&lt;/div&gt;</script>
gordon daniels, módosítva 11 év-val korábban

RE: How to Increase and Decrease the Textsize in Portal pages

Liferay Master Bejegyzések: 797 Csatlakozás dátuma: 2008.08.24. Legújabb bejegyzések
Ravi: sorry - I don't know the answers. You can 'bump' this posting again and I am sure someone will be able to help.
Ravi Teja, módosítva 11 év-val korábban

RE: How to Increase and Decrease the Textsize in Portal pages

New Member Bejegyzések: 21 Csatlakozás dátuma: 2012.07.09. Legújabb bejegyzések
hai daniels,
thanks for your help.
Finally i got the solution .here....

i think This code will help to some one like me emoticon

Thanks&regards
Ravi
thumbnail
Hitoshi Ozawa, módosítva 11 év-val korábban

RE: How to Increase and Decrease the Textsize in Portal pages

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
Are you sure you got an answer? The link to the thread seems to go unanswered.
Ravi Teja, módosítva 11 év-val korábban

RE: How to Increase and Decrease the Textsize in Portal pages

New Member Bejegyzések: 21 Csatlakozás dátuma: 2012.07.09. Legújabb bejegyzések
Hitoshi Ozawa:
Are you sure you got an answer? The link to the thread seems to go unanswered.



Hi Hitoshi,
Actually i got solution & posted a thread with example (peace of code). but it is showing this message.

Status: Denied
Your message has been flagged as spam. An administrator will review your message as soon as possible.


weather my post is successfully posted or not?


Thanks
Ravi
thumbnail
Hitoshi Ozawa, módosítva 11 év-val korábban

RE: How to Increase and Decrease the Textsize in Portal pages

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
Saw your other thread. Seems like you got it. emoticon