如何使用母版页字体大小增加内容页面字体大小 [英] How to increase content page font size with master page font size

查看:121
本文介绍了如何使用母版页字体大小增加内容页面字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,

i有一个母版页和母版页主体id =sitebody1,点击一个按钮我通过javascript函数增加字体大小。

母版页内容的字体大小正在增加,但内容页面字体大小不会增加。

以下是示例代码

Jacascript

Hello All,
i have a master page and master page body id= "sitebody1" and on clicking a button i am increasing the font size by javascript function.
The font size of master page contents are increasing but content page font size is not increased.
following is sample code
Jacascript

function set_font_size(fontType) {
        if (fontType == "increase") {
            if (fontSize < 100) {
                fontSize = parseInt(fontSize) + 15;
            }
        } else {
            fontSize = 75;
        }
      document.getElementById("sitebody1").style.fontSize = fontSize + "%";



设计


Design

<body id="sitebody1">
 onclick="set_font_size('increase')

按钮

推荐答案

没有 fontSize

此外,您的代码缩进建议您认为 else 部分属于 if( fontType ...)它属于 if(fontSize ...)部分......



在这里查看一个jquery a ided解决方案(某种形式): http://jsfiddle.net/1qhk4w38/ [ ^ ]
There is no sign of fontSize!
Also your indentation of code suggest that you think that the else part belongs to the if(fontType...) where it belongs to the if(fontSize...) part...

Check here a jquery aided solution (of some kind): http://jsfiddle.net/1qhk4w38/[^]


这篇关于如何使用母版页字体大小增加内容页面字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆