Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
var currentSize = 14; //Нормален размер на шрифта
var max = 24; //Максимален размер на шрифта
var min = 9; //Минимален размер на шрифта
function increase_decrease(type) {
var obj = document.getElementById('text');
if(type) {
if(currentSize < max) {currentSize++;}
}
else {
if(currentSize > min) {currentSize--;}
}
obj.style.fontSize = currentSize + "px";
}
<html>
<head>
<title>Залавие</title>
<script type="text/javascript" src="text.js"></script> // вкарваш js-та
</head>
<body>
<a href="javascript:increase_decrease(1);">Увеличаване на шрифта (+)</a> |
<a href="javascript:increase_decrease(0);">Намаляне на шрифта(-)</a><br>
<div id="text">
тука пишеш текста
</div>
</body>
</html>
<html>
<head>
<title>Увеличаване / Намаляне на шрифта</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<style type="text/css">
body {font-family: Verdana, arial, serif; font-size: 10px;}
a {color: blue; text-decoration: none;}
a:hover {text-decoration: underline;}
div#text {cursor: default; width: 400px; padding: 5px; margin-top: 5px; border: 1px solid gray; background:#f9f9f9;}
</style>
<script type="text/javascript">
var currentSize = 10; // Нормален размер на шрифта
var max = 16; // Максимален размер на шрифта
var min = 9; // Минимален размер на шрифта
function incdec(type) {
var obj = document.getElementById('text');
if(type) {
if(currentSize < max) {currentSize++;}
}
else {
if(currentSize > min) {currentSize--;}
}
obj.style.fontSize = currentSize + "px";
}
</script>
</head>
<body>
<center>
<a href="javascript:incdec(1);">Увеличаване на шрифта</a> |
<a href="javascript:incdec(0);">Намаляне на шрифта</a>
<div id="text" style="text-align: justify">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</center>
</body>
</html>
Даdiko каза:ахам стана и после като качвам сайта този фаил го качвам при страниците нали ?
<a href="javascript:incdec(1);">+</a> |
<a href="javascript:incdec(0);">-</a>
<style type="text/css">
body {font-family: Verdana, arial, serif; font-size: 10px;}
a {color: blue; text-decoration: none;}
a:hover {text-decoration: none;}
div#text {cursor: default; width: 400px; padding: 5px; margin-top: 5px; border: 1px solid gray; background:#f9f9f9;}
</style>
<html>
<head>
<title>Увеличаване / Намаляне на шрифта</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<script type="text/javascript">
var currentSize = 10; // Нормален размер на шрифта
var max = 16; // Максимален размер на шрифта
var min = 9; // Минимален размер на шрифта
function incdec(type) {
var obj = document.getElementById('text');
if(type) {
if(currentSize < max) {currentSize++;}
}
else {
if(currentSize > min) {currentSize--;}
}
obj.style.fontSize = currentSize + "px";
}
</script>
<style type="text/css">
body {font-family: Verdana, arial, serif; font-size: 10px;}
a {color: blue; text-decoration: none;}
a:hover {text-decoration: none;}
</style>
</head>
<body>
<center>
<a href="javascript:incdec(1);"><div id="text">+</div></a> |
<a href="javascript:incdec(0);"><div id="text">-</div></a>
<div style="text-align: justify">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</center>
</body>
</html>
<style type="text/css">
body {
font-family: Verdana, arial, serif;
font-size: 10px;
}
a {
color: blue;
text-decoration: none;
font-size: 20px;
}
a:hover {
text-decoration: underline;
font-size: 20px;
}
div#text {
cursor: default;
width: 400px;
padding: 5px;
margin-top: 5px;
border: 1px solid gray;
background:#f9f9f9;
}
</style>