Hi,
I am new to jquery, experts please solve this issue and post me a reply.
I created a textsizer in css and jquery. The purpose of this is,
1) on webpage there is a link called "textsize", when you click a popup is shown and it contains 3options (increase font, decrease font and reset font).
2) The web page is designed with three column layout, when i click on text sizer only the contents in the second column increases remaining column-1 and column-3 will remain the same as default.
Now the problem is,
--> I had contents,headin gs and links inside the column-2 layout, but when i click on text sizer(increase font, decrease font and reset font), only the content is increasing, the heading and the links are not increasing. I want the headings and links inside the column-2 also to be increased, decreased and reset.
[code=css]
/* starting of textsize */
li a.textTool:hove r, li a.textToolActiv e {
background:#006 3be url('../Images/tools/text-on.gif') -1px 0px no-repeat;
color:#ffffff;
text-decoration:none ;
height:25px;
/* width:55px; */
margin-top:0px;
background-color:#0063be;
}
.text-tool {
position:absolu te;
left:704px;
width:125px;
top:228px;
right:260px;
-moz-box-shadow: 3px 3px 4px #000;
-webkit-box-shadow: 3px 3px 4px #000;
box-shadow: 3px 3px 4px #000;
/* For IE 8 */
-ms-filter: "progid:DXImage Transform.Micro soft.Shadow(Str ength=4, Direction=135, Color='#000000' )";
/* For IE 5.5 - 7 */
filter: progid:DXImageT ransform.Micros oft.Shadow(Stre ngth=4, Direction=135, Color='#000000' );
}
.text-tool .header {
background:#006 3be;
width:125px;
height:25px;
position:relati ve;
}
.text-tool .header h5 {
color:#fff;
padding:5px 0 12px 2px;
font-size:1.1em;
font-weight:bold;
}
.text-tool .header .close {
position:absolu te;
top:10px;
right:10px;
cursor:pointer;
}
.text-tool .body {
background:#fff ;
border-bottom:#ccc solid 1px;
border-right:#ccc solid 1px;
border-left:#ccc solid 1px;
padding:5px 15px 0 0px;
height:25px;
width:125px;
position:relati ve;
}
.text-tool .body .a1{
display:inline;
}
/* End of textsize section */
[/code]
[code=javascript]
/*************** *****/
$("#content-top a.textTool").cl ick(function () {
$('a.textTool') .removeClass("t extTool").addCl ass('textToolAc tive');
$('#content-top a.textTool').re moveClass("text Tool").addClass ('textToolActiv e');
var offset = $(this).offset( );
var tLeft = offset.left;
var tTop = offset.top;
var topOffset = $(this).height( );
var tWidth = $(this).width() ;
var xTip = (tLeft-tWidth+6)+"px";
var yTip = (tTop+topOffset +12)+"px";
$('#content-top .text-tool').css({'to p' : yTip, 'left' : xTip});
$('#content-top .text-tool').removeCl ass("hide");
});
$("#content-top .text-tool .close").click( function () {
$('#content-top a.textToolActiv e').removeClass ("textToolActiv e").addClass('t extTool');
$('#content-top .text-tool').addClass ("hide");
$('#content-top .text-tool .body .page-tools-email').css({ 'display': 'none' });
$('#content-top .text-tool .body').css({ 'height': '25px' });
});
/*************** *****/
//Font sizer starts here
$(" a.textTool").cl ick(function () {
$('a.textTool') .removeClass("t extTool").addCl ass('textToolAc tive');
$('.page-tool').removeCl ass("hide");
});
$(document).rea dy(function(){
//$(document).hei ght(".page-tool .body"); // returns height of HTML document
var MaximumFontSize = 15;
var MinimumFontSize = 6;
var $currentObject = $(".threecoloum layout") .children(".col umn-2");
// Reset Font Size
var originalFontSiz e = $currentObject. css('font-size');
$("#resetFont") .click(function (event){
event.preventDe fault();
$currentObject. css('font-size', originalFontSiz e);
});
// Increase Font Size
$("#increaseTex t").click(funct ion(){
var currentFontSize = $currentObject. css('font-size');
var currentFontSize Num = parseFloat(curr entFontSize, 10);
var newFontSize = currentFontSize Num+1;
if (newFontSize < MaximumFontSize ) {
$currentObject. css('font-size', newFontSize);
}
return false;
});
// Decrease Font Size
$("#DecreaseTex t").click(funct ion(){
var currentFontSize = $currentObject. css('font-size');
var currentFontSize Num = parseFloat(curr entFontSize, 10);
var newFontSize = currentFontSize Num-3;
//alert('currentF ontSizeNum');
if (newFontSize > MinimumFontSize ) {
$currentObject. css('font-size', newFontSize);
}
return false;
});
});
//Font sizer Ends here
[/code]
[code=HTML]
<div class="text-tool hide">
<div class="header">
<h5>Text sizer</h5>
<div class="close">< img src="http://bytes.com/submit/images/tools/close.gif" width="10" height="10" alt="Close" title="Close" /></div>
</div>
<div class="body">
<div class="a1">
<a href="#" id="increaseTex t"><img src="http://bytes.com/submit/images/tools/BigA.jpg"/></a>
<a href="#" id="resetFont"> <img src="http://bytes.com/submit/images/tools/textreset.jpg"/></a>
<a href="#" id="DecreaseTex t"><img src="http://bytes.com/submit/images/tools/smallA.jpg"/></a>
</div>
</div>
</div>
</div>
[/code]
Appreciate your replies.
Thanks,
Jai
I am new to jquery, experts please solve this issue and post me a reply.
I created a textsizer in css and jquery. The purpose of this is,
1) on webpage there is a link called "textsize", when you click a popup is shown and it contains 3options (increase font, decrease font and reset font).
2) The web page is designed with three column layout, when i click on text sizer only the contents in the second column increases remaining column-1 and column-3 will remain the same as default.
Now the problem is,
--> I had contents,headin gs and links inside the column-2 layout, but when i click on text sizer(increase font, decrease font and reset font), only the content is increasing, the heading and the links are not increasing. I want the headings and links inside the column-2 also to be increased, decreased and reset.
[code=css]
/* starting of textsize */
li a.textTool:hove r, li a.textToolActiv e {
background:#006 3be url('../Images/tools/text-on.gif') -1px 0px no-repeat;
color:#ffffff;
text-decoration:none ;
height:25px;
/* width:55px; */
margin-top:0px;
background-color:#0063be;
}
.text-tool {
position:absolu te;
left:704px;
width:125px;
top:228px;
right:260px;
-moz-box-shadow: 3px 3px 4px #000;
-webkit-box-shadow: 3px 3px 4px #000;
box-shadow: 3px 3px 4px #000;
/* For IE 8 */
-ms-filter: "progid:DXImage Transform.Micro soft.Shadow(Str ength=4, Direction=135, Color='#000000' )";
/* For IE 5.5 - 7 */
filter: progid:DXImageT ransform.Micros oft.Shadow(Stre ngth=4, Direction=135, Color='#000000' );
}
.text-tool .header {
background:#006 3be;
width:125px;
height:25px;
position:relati ve;
}
.text-tool .header h5 {
color:#fff;
padding:5px 0 12px 2px;
font-size:1.1em;
font-weight:bold;
}
.text-tool .header .close {
position:absolu te;
top:10px;
right:10px;
cursor:pointer;
}
.text-tool .body {
background:#fff ;
border-bottom:#ccc solid 1px;
border-right:#ccc solid 1px;
border-left:#ccc solid 1px;
padding:5px 15px 0 0px;
height:25px;
width:125px;
position:relati ve;
}
.text-tool .body .a1{
display:inline;
}
/* End of textsize section */
[/code]
[code=javascript]
/*************** *****/
$("#content-top a.textTool").cl ick(function () {
$('a.textTool') .removeClass("t extTool").addCl ass('textToolAc tive');
$('#content-top a.textTool').re moveClass("text Tool").addClass ('textToolActiv e');
var offset = $(this).offset( );
var tLeft = offset.left;
var tTop = offset.top;
var topOffset = $(this).height( );
var tWidth = $(this).width() ;
var xTip = (tLeft-tWidth+6)+"px";
var yTip = (tTop+topOffset +12)+"px";
$('#content-top .text-tool').css({'to p' : yTip, 'left' : xTip});
$('#content-top .text-tool').removeCl ass("hide");
});
$("#content-top .text-tool .close").click( function () {
$('#content-top a.textToolActiv e').removeClass ("textToolActiv e").addClass('t extTool');
$('#content-top .text-tool').addClass ("hide");
$('#content-top .text-tool .body .page-tools-email').css({ 'display': 'none' });
$('#content-top .text-tool .body').css({ 'height': '25px' });
});
/*************** *****/
//Font sizer starts here
$(" a.textTool").cl ick(function () {
$('a.textTool') .removeClass("t extTool").addCl ass('textToolAc tive');
$('.page-tool').removeCl ass("hide");
});
$(document).rea dy(function(){
//$(document).hei ght(".page-tool .body"); // returns height of HTML document
var MaximumFontSize = 15;
var MinimumFontSize = 6;
var $currentObject = $(".threecoloum layout") .children(".col umn-2");
// Reset Font Size
var originalFontSiz e = $currentObject. css('font-size');
$("#resetFont") .click(function (event){
event.preventDe fault();
$currentObject. css('font-size', originalFontSiz e);
});
// Increase Font Size
$("#increaseTex t").click(funct ion(){
var currentFontSize = $currentObject. css('font-size');
var currentFontSize Num = parseFloat(curr entFontSize, 10);
var newFontSize = currentFontSize Num+1;
if (newFontSize < MaximumFontSize ) {
$currentObject. css('font-size', newFontSize);
}
return false;
});
// Decrease Font Size
$("#DecreaseTex t").click(funct ion(){
var currentFontSize = $currentObject. css('font-size');
var currentFontSize Num = parseFloat(curr entFontSize, 10);
var newFontSize = currentFontSize Num-3;
//alert('currentF ontSizeNum');
if (newFontSize > MinimumFontSize ) {
$currentObject. css('font-size', newFontSize);
}
return false;
});
});
//Font sizer Ends here
[/code]
[code=HTML]
<div class="text-tool hide">
<div class="header">
<h5>Text sizer</h5>
<div class="close">< img src="http://bytes.com/submit/images/tools/close.gif" width="10" height="10" alt="Close" title="Close" /></div>
</div>
<div class="body">
<div class="a1">
<a href="#" id="increaseTex t"><img src="http://bytes.com/submit/images/tools/BigA.jpg"/></a>
<a href="#" id="resetFont"> <img src="http://bytes.com/submit/images/tools/textreset.jpg"/></a>
<a href="#" id="DecreaseTex t"><img src="http://bytes.com/submit/images/tools/smallA.jpg"/></a>
</div>
</div>
</div>
</div>
[/code]
Appreciate your replies.
Thanks,
Jai
Comment