Turfimage
asked on
Iframe Font Size Change
You know how a user can change the size of the fonts on an html page by using (+/-)? I want to do this on three iframes at the same time. I can do it on the main page and it works but the iframe (2) stay the same size. I don’t want to make all three have their own (+/-). Anyway to make all of them change with one button?
ASKER
Yes. all pages are on same domain. Is there a way to tie all three to one function? I got it to work on one but the buttom had to be within that iframe. Im looking to make all three change with one button at the sametime. thx
It is going to be a lot of work and there is no quarantee it will work cross-browser. T start I need a link to the page so I can see structure, and whether the code is close enough to standard to give us a chance of getting it to work.
Cd&
Cd&
ASKER
OK. so I made each frame have its own (+/-) button and it seems to be ok.... but Im using this
<script language="JavaScript" type="text/javascript">fun ction changeFontSize(inc){ var p = document.getElementsByTagN ame('p'); for(n=0; n<p.length; n++) { if(p[n].style.fontSize) { var size = parseInt(p[n].style.fontSi ze.replace ("px", "")); } else { var size = 11; } p[n].style.fontSize = size+inc + 'px'; }}</script>
Now only the words that have <p> ... <p/> around them change? also the CSS for the headers resize to a smaller size so it looks sort of strange. Is there a better way? thx
<script language="JavaScript" type="text/javascript">fun
Now only the words that have <p> ... <p/> around them change? also the CSS for the headers resize to a smaller size so it looks sort of strange. Is there a better way? thx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Is there a way to make a button to do Crtl (+) or Crtl (-) ? Like a normal webbrowser but from the webpage itself?
In theory you could fire a function on one iframe to cause a change on another iframe, but the scripting runs into security restrictions unless the pages are all served from the same domain; in which case it gets ignored. You would also never want to use the keyboard for such an action because that is just about the least reliable way to do it.
Cd&