Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Changing the font size with javascriptChanging the font size with javascript
Previous
 
Next
New Post
3/8/2009 9:36 AM
 

I'm trying to change the font size with javascript. I put some javascript in my skin and also two links you can click on to change the font. In my javascript I say that all my text in div containers can be altered. Unfortunately, only my footer changes font, and nothinbg else. Can someone help me? The code of my skin is this:

 

<%@ Control Language="vb" AutoEventWireup="false"

    Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<%@ Register TagPrefix="dnn" TagName="LOGO" Src="~/Admin/Skins/Logo.ascx" %>

<%@ Register TagPrefix="dnn" TagName="LOGIN" Src="~/Admin/Skins/Login.ascx" %>

<%@ Register TagPrefix="dnn" TagName="USER" Src="~/Admin/Skins/User.ascx" %>

<%@ Register TagPrefix="dnn" TagName="LANGUAGE" Src="~/Admin/Skins/Language.ascx" %>

<%@ Register TagPrefix="dnn" TagName="MENU" Src="~/Admin/Skins/SolPartMenu.ascx" %>

<%@ Register TagPrefix="dnn" TagName="SEARCH" Src="~/Admin/Skins/Search.ascx" %>

<%@ Register TagPrefix="dnn" TagName="COPYRIGHT" Src="~/Admin/Skins/Copyright.ascx" %>

<%@ Register TagPrefix="dnn" TagName="BREADCRUMB" Src="~/DesktopModules/effority.Ealo.BreadCrumb/effority_Ealo_BreadCrumb.ascx" %>

<%@ Register TagPrefix="dnn" TagName="RADTABSTRIP" Src="~/DesktopModules/Telerik.SkinObjects/RadTabstrip.ascx" %>

<%@ Register TagPrefix="dnn" TagName="RADPANELBAR" Src="~/DesktopModules/Telerik.SkinObjects/RadPanelbar.ascx" %>

 

<script type="text/javascript" language="javascript">

var min=8;

var max=16;

function increaseFontSize() {

   var p = document.getElementsByTagName('div');

   for(i=0;i<p.length;i++) {

      if(p[i].style.fontSize) {

         var s = parseInt(p[i].style.fontSize.replace("px",""));

      } else {

         var s = 11;

      }

      if(s!=max) {

         s += 1;

      }

      p[i].style.fontSize = s+"px"

   }

}

function decreaseFontSize() {

   var p = document.getElementsByTagName('div');

   for(i=0;i<p.length;i++) {

      if(p[i].style.fontSize) {

         var s = parseInt(p[i].style.fontSize.replace("px",""));

      } else {

         var s = 11;

      }

      if(s!=min) {

         s -= 1;

      }

      p[i].style.fontSize = s+"px"

   }  

}

</script>

 

 

<div id="backgroundSmall">

<div id="large">

<table cellpadding="0" cellspacing="0" width="100%">

    <tr id="smallheader">

        <td>     

            <ul id="availableLanguages" CssClass="fontClass">

                <dnn:LANGUAGE ID="LANGUAGE1" runat="server" ShowMenu="False" ShowLinks="True" />

            </ul>

            <ul id="bannerLinks" class="fontClass">

                <li><asp:HyperLink id="HyperLink2" Text="CONTACT" NavigateUrl='~/Contact.aspx' runat="server" /></li>

                <li><asp:HyperLink id="HyperLink1" Text="HOME" NavigateUrl='~/' runat="server" /></li>       

            </ul>   

            <dnn:LOGO ID="LOGO1" runat="server" />   

        </td>

    </tr>

    <tr>

        <td id="content">

            <div id="test">

                <table width="100%" cellpadding="0" cellspacing="0">

                    <tr>

                        <td colspan="3" id="leftRightPaddingMenu">

                            <dnn:RADTABSTRIP ID="RadTabStrip1" Width="100%" runat="server" MaxLevel="1" Skin="BDB" />

                        </td>               

                    </tr>

                    <tr>

                        <td id="leftPadding" style="padding-top: 5px;">

                            <dnn:BREADCRUMB runat="server" Separator="&nbsp;&#8250;&nbsp;" RootLevel="0" ID="broodkruimel" CssClass="fontClass" />

                        </td>

                        <td align="right">

                            <a href=" decreaseFontSize();">-</a>

                            <a href=" increaseFontSize();">+</a>

                        </td>

                        <td align="right" id="rightPadding">                       

                            <dnn:LOGIN runat="server" ID="dnnLOGIN" />

                        </td>

                    </tr>

                </table>

            </div> 

            <div id="xsnazzy">

            <b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b>

            <div class="xboxcontent">         

                <table cellpadding="0" cellspacing="0">

                    <tr>

                       

                        <td id="TopPane" runat="server"  colspan="3" valign="top" align="center" class="toppane">                           

                        </td>

                    </tr>

                    <tr valign="top">

                        <td class="leftpane" runat="server" id="Leftpane" valign="top" align="left">

                            <dnn:RADPANELBAR ID="RadPanelBar1" runat="server" ShowOnlyCurrent="MenuLevel:2"

                                Skin="BDB" Width="170px" />                           

                        </td>

                        <td class="contentpane" runat="server" id="Contentpane" valign="top" align="left">                                                                    

 

                        </td>

                        <td class="rightpane" runat="server" id="Rightpane" valign="top" align="center">

            

                        </td>

                    </tr>

                    <tr>

                        <td class="bottom" id="Bottompane" colspan="3" valign="top" align="center">

                        </td>

                    </tr>

                </table>    

            </div>

            <b class="xbottom"><b class="xb4"></b><b class="xb3"></b><b class="xb2"></b><b class="xb1"></b></b>

            </div>                                                

        </td>

    </tr>

    <tr>

        <td>

            <div id="footer">

                <dnn:COPYRIGHT runat="server" ID="COPYRIGHT1" />

            <asp:HyperLink id="hlSitemap" Text="Sitemap" NavigateUrl='~/Sitemap.aspx' runat="server" />

            <asp:HyperLink id="hlWebmaster" Text="Webmaster" NavigateUrl='~/ContactF.aspx' runat="server" />

            </div>                     

        </td>

    </tr>

</table>

</div>

</div>

 

 
New Post
4/2/2009 4:30 AM
 

This happens because you use tables in your div's. YOu can fix this by setting the fontsize on the TD's in the tables. Tables have a strange way of avoiding styles opposed from above.

 
New Post
5/15/2009 5:38 AM
 

That worked, thanks!

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Changing the font size with javascriptChanging the font size with javascript


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out