-
1. Data: 2010-04-18 07:09:35
Temat: Problem z js
Od: bn <b...@g...com>
Czesc
Mam kawalek html w ktorym tekst ma "wylaniac sie". I robi to ale nie
do konca, tzn. wylania sie naglowek h3 i li, ale linki juz nie. Jak to
poprawic aby fading obejmowal caly tekst? Przegladarka: firefox 3.6.
<?xml version="1.0" encoding="iso-8859-2"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<title>bookmarks</title>
<script type="text/javascript">
hex=255
function fadetext()
{
if(hex>0)
{
hex-=11;
document.getElementById("sample").style.color="rgb("
+hex+","+hex
+","+hex+")";
setTimeout("fadetext()",50);
}
else
hex=255
}
</script>
<meta http-equiv="Content-Type" content="text/xml;
charset=iso-8859-2" />
</head>
<body onload="fadetext()">
<div id="sample">
<h3>google</h3>
<ul>
<li><a href="http://google.com">google.com</a></li>
<li><a href="http://goosh.org">goosh.org</a></li>
<li><a href="http://google.pl/advanced_search?hl=pl">google
.pl/
advanced</a></li>
</ul>
</div>
</body>
</html>
Pozdrawiam
-
2. Data: 2010-04-18 09:00:35
Temat: Re: Problem z js
Od: Peter May <p...@o...pl>
W dniu 2010-04-18 09:09, bn pisze:
> Czesc
>
> Mam kawalek html w ktorym tekst ma "wylaniac sie". I robi to ale nie
> do konca, tzn. wylania sie naglowek h3 i li, ale linki juz nie. Jak to
> poprawic aby fading obejmowal caly tekst? Przegladarka: firefox 3.6.
>
> <?xml version="1.0" encoding="iso-8859-2"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
> <head>
> <title>bookmarks</title>
> <script type="text/javascript">
> hex=255
> function fadetext()
> {
> if(hex>0)
> {
> hex-=11;
>
> document.getElementById("sample").style.color="rgb("
+hex+","+hex
> +","+hex+")";
> setTimeout("fadetext()",50);
> }
> else
> hex=255
> }
> </script>
> <meta http-equiv="Content-Type" content="text/xml;
> charset=iso-8859-2" />
> </head>
> <body onload="fadetext()">
> <div id="sample">
> <h3>google</h3>
> <ul>
> <li><a href="http://google.com">google.com</a></li>
> <li><a href="http://goosh.org">goosh.org</a></li>
> <li><a href="http://google.pl/advanced_search?hl=pl">google
.pl/
> advanced</a></li>
> </ul>
> </div>
> </body>
> </html>
Użyj właściwości opacity, zamiast zmiany koloru. Chodzi Ci o taki efekt?
http://www.switchonthecode.com/tutorials/javascript-
tutorial-simple-fade-animation
http://www.ilikespam.com/blog/javascript-fade-effect
s
--
Peter