inherit
27465
0
Jun 21, 2023 15:12:16 GMT -8
VanillaOrchids
10,120
July 2004
vanillaorchids
|
Post by VanillaOrchids on Sept 2, 2008 15:10:17 GMT -8
OK, there is a text resizer script on Dynamic Drive ... here is the link: www.dynamicdrive.com/dynamicindex9/textsizer.htmI am trying to figure out how I can use this code (or a different one that does the same thing) but also have it so that a cookie is used to remember each persons font size preference. Is that possible? If it is possible, any chance I could get some help to get it working?
|
|
inherit
Don't click here.
23409
0
Jul 19, 2016 11:37:12 GMT -8
Ðravu
✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖
3,309
April 2004
dravu2000
|
Post by Ðravu on Sept 2, 2008 16:58:28 GMT -8
This is the code I made for Enchant's forum Enchanted Element (look in the sidebar; meant as an example, not advertising): <script type="text/javascript"> <!-- // "Change font-size" by Dravu function changesize(change){ if(change == "normal"){ document.cookie="size=;expires="+new Date().toGMTString()+";"; window.location.reload(); } else { var tags = new Array('font','div','td'); if(document.cookie.match(/size/)){ var size = document.cookie.split('size=')[1]; size = size.split(';')[0]; } else { size = 12; } if(change == '0' && !document.cookie.match(/size=/)){} else { change = Math.round(change); size = Math.round(size); size = size+change; if(size>0){ var date = new Date(); date.setTime(date.getTime()+(365*24*60*60*1000)); document.cookie='size='+size+';expires='+date.toGMTString()+';'; for(a=0;a<tags.length;a++){ var tag_num = document.getElementsByTagName(tags[a]); for(b=0;b<tag_num.length;b++){ tag_num[b].style.fontSize=size+'px'; } } } } } } changesize('0'); //--> </script> Put that in your global footers and then use the changesize function to make your links. Example: <a href="javascript:changesize('+2')">Larger</a> | <a href="javascript:changesize('normal')">Normal</a> | <a href="javascript:changesize('-2')">Smaller</a> It increases/decreases by pixel amount instead of font size. If you want it to increase/decrease by 1px at a time instead of two, change the "+2" and "-2" in the links to "+1" and "-1".
|
|
inherit
27465
0
Jun 21, 2023 15:12:16 GMT -8
VanillaOrchids
10,120
July 2004
vanillaorchids
|
Post by VanillaOrchids on Sept 2, 2008 19:04:37 GMT -8
First off, thank you Dravu. I checked out the script on Enchant's site and it works well. For some reason though, I can't get it to change the size where I placed the code. It's probably due to the coding that I already have in place. If it's not too much trouble, would you mind if I PM'd the link to you to check it out? Maybe you can tell me what might be conflicting.
|
|
inherit
Don't click here.
23409
0
Jul 19, 2016 11:37:12 GMT -8
Ðravu
✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖
3,309
April 2004
dravu2000
|
Post by Ðravu on Sept 2, 2008 20:17:18 GMT -8
First off, thank you Dravu. I checked out the script on Enchant's site and it works well. For some reason though, I can't get it to change the size where I placed the code. It's probably due to the coding that I already have in place. If it's not too much trouble, would you mind if I PM'd the link to you to check it out? Maybe you can tell me what might be conflicting. Sure. Go ahead an PM me the URL. ^^
|
|
inherit
27465
0
Jun 21, 2023 15:12:16 GMT -8
VanillaOrchids
10,120
July 2004
vanillaorchids
|
Post by VanillaOrchids on Sept 3, 2008 9:13:41 GMT -8
Thanks! I've sent the PM.
|
|
inherit
Don't click here.
23409
0
Jul 19, 2016 11:37:12 GMT -8
Ðravu
✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖
3,309
April 2004
dravu2000
|
Post by Ðravu on Sept 3, 2008 12:17:40 GMT -8
Whoops. I made an error when I did a few quick updates when pulling it over. Fixed the code. ^^
|
|
inherit
27465
0
Jun 21, 2023 15:12:16 GMT -8
VanillaOrchids
10,120
July 2004
vanillaorchids
|
Post by VanillaOrchids on Sept 3, 2008 13:44:29 GMT -8
Thank you so much Ðravu! It works like a charm.
|
|
inherit
131232
0
Jan 22, 2009 23:31:25 GMT -8
weimaranerlovers
23
September 2008
weimaranerlovers
|
Post by weimaranerlovers on Dec 1, 2008 6:25:16 GMT -8
This is something i've been looking for, but i'm failing to understand how to use the stuff in the second box.
Can you help me with this as well please?
|
|
inherit
Don't click here.
23409
0
Jul 19, 2016 11:37:12 GMT -8
Ðravu
✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖
3,309
April 2004
dravu2000
|
Post by Ðravu on Dec 1, 2008 12:56:46 GMT -8
This is something i've been looking for, but i'm failing to understand how to use the stuff in the second box. Can you help me with this as well please? In the second box are links. You can edit the text inside them if you want (such as changing "Larger" to "Bigger" or changing it to an image).
|
|
inherit
131232
0
Jan 22, 2009 23:31:25 GMT -8
weimaranerlovers
23
September 2008
weimaranerlovers
|
Post by weimaranerlovers on Dec 1, 2008 16:32:40 GMT -8
Ok thanks.
But where do I put the links into the code about?
|
|
inherit
Don't click here.
23409
0
Jul 19, 2016 11:37:12 GMT -8
Ðravu
✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖
3,309
April 2004
dravu2000
|
Post by Ðravu on Dec 2, 2008 1:58:39 GMT -8
Ok thanks. But where do I put the links into the code about? Put the first code in your global footers. Put this in your global headers: <center><a href="javascript:changesize('+2')">Larger</a> | <a href="javascript:changesize('normal')">Normal</a> | <a href="javascript:changesize('-2')">Smaller</a></center>
|
|
inherit
130228
GamingMedley charles.stover
0
Nov 18, 2012 0:12:30 GMT -8
Charles Stover
PM me for Arcade or ShoutBox support
1,731
August 2008
gamechief
|
Post by Charles Stover on Dec 2, 2008 11:22:14 GMT -8
Shouldn't the changesize function be defined above the links? If someone were to click them before the footer loaded, they'd get an error.
|
|
inherit
Don't click here.
23409
0
Jul 19, 2016 11:37:12 GMT -8
Ðravu
✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖
3,309
April 2004
dravu2000
|
Post by Ðravu on Dec 3, 2008 20:49:57 GMT -8
Shouldn't the changesize function be defined above the links? If someone were to click them before the footer loaded, they'd get an error. I wouldn't think they'd click it that fast. o.0 But if it's a problem, they could move the links to the footer. I just found them more convenient in the header. *shrugs*
|
|
inherit
130228
GamingMedley charles.stover
0
Nov 18, 2012 0:12:30 GMT -8
Charles Stover
PM me for Arcade or ShoutBox support
1,731
August 2008
gamechief
|
Post by Charles Stover on Dec 4, 2008 10:06:16 GMT -8
Some people still have slow Internet nowadays. It might take a while before the footer loads. Instead of putting the links in the footer, they could put the script in the header.
|
|
inherit
Don't click here.
23409
0
Jul 19, 2016 11:37:12 GMT -8
Ðravu
✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖
3,309
April 2004
dravu2000
|
Post by Ðravu on Dec 4, 2008 12:48:23 GMT -8
Some people still have slow Internet nowadays. It might take a while before the footer loads. Instead of putting the links in the footer, they could put the script in the header. But then it'd only change the font sizes of the things in the header. I'd have to load the function into the onLoad event for the body, but I've had bad times doing that in the past with other scripts conflicting with it, so I prefer to stay away from that. >>
|
|