|
|
Post a Project »
Find a Professional HTML Freelancer!
Find a Freelancer to help you with your HTML projects
| |
|
Help - marquee tag in html
04-08-2009, 05:14 AM
|
Help - marquee tag in html
|
Posts: 9
Name: Nicky
|
I want to use marquee tag with color changing display in text of "Click here..", so can you guide me how can it be possible.
Thanks in advance
|
|
|
|
04-08-2009, 06:00 AM
|
Re: Help - marquee tag in html
|
Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
First, I cannot imagine someone wanting to use a marquee...
Second, google is your friend.
http://www.javascript-fx.com/develop...spancycle.html
HTML Code:
<!--- *** BEGIN CUT - Demo starts here *** --->
<!-- * You may use this code for free on any web page provided that
* these comment lines and the following credits remain in the code.
* "Link Color Cycle" © http://www.javascript-fx.com
-->
<script type="text/javascript">
/***********************************************
*
* Function : getColor
*
* Parameters : start - the start color (in the form "RRGGBB" e.g. "FF00AC")
* end - the end color (in the form "RRGGBB" e.g. "FF00AC")
* percent - the percent (0-100) of the fade between start & end
*
* returns : color in the form "#RRGGBB" e.g. "#FA13CE"
*
* Description : This is a utility function. Given a start and end color and
* a percentage fade it returns a color in between the 2 colors
*
* Author : www.JavaScript-FX.com
*
*************************************************/
function getColor(start, end, percent){
function hex2dec(hex){return(parseInt(hex,16));}
function dec2hex(dec){return (dec < 16 ? "0" : "") + dec.toString(16);}
var r1 = hex2dec(start.slice(0,2)), g1=hex2dec(start.slice(2,4)), b1=hex2dec(start.slice(4,6));
var r2 = hex2dec(end.slice(0,2)), g2=hex2dec(end.slice(2,4)), b2=hex2dec(end.slice(4,6));
var pc = percent/100;
var r = Math.floor(r1+(pc*(r2-r1)) + .5), g=Math.floor(g1+(pc*(g2-g1)) + .5), b=Math.floor(b1+(pc*(b2-b1)) + .5);
return("#" + dec2hex(r) + dec2hex(g) + dec2hex(b));
}
/************************************************/
var colors = new Array("339966", "FF0000", "00FF00", "0000FF", "FFFF00", "FF00FF", "00FFFF");
var start = colors[0];
var end = colors[0];
var index = 0;
var cindex = 0;
var faderObj = new Array();
function fadeSpan()
{
if(index == 0)
{
start = end;
end = colors[ cindex = (cindex+1) % colors.length ];
}
for(var i=0 ; i<faderObj.length ; i++)
faderObj[i].style.color = getColor(start, end, index);
index = (index+5) % 100;
setTimeout("fadeSpan()", 40);
}
function fadeAll()
{
for(var i=0 ; i<arguments.length ; i++)
faderObj[i] = document.getElementById(arguments[i]);
fadeSpan();
}
function JSFX_StartEffects()
{
fadeAll("marquee1", "marquee2");
}
</script>
<!--- *** END CUT - Demo ends here *** --->
As I understand this code, simply put an id on every marquee you want to have color cycling (a different id on each marquee !) and give the list of those id in the JSFX_StartEffects() function.
__________________
Only a biker knows why a dog sticks his head out the window.
Last edited by tripy; 04-08-2009 at 06:02 AM..
|
|
|
|
04-08-2009, 09:54 AM
|
Re: Help - marquee tag in html
|
Posts: 10,017
Location: Tennessee
|
Egads... a marquee??? eeeeyeeewwwwww.. so 1995, and such a BAD idea. All it does is add distraction to your page.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
Please login or register to view this content. Registration is FREE
Please login or register to view this content. Registration is FREE
|
|
|
|
04-11-2009, 05:42 AM
|
Re: Help - marquee tag in html
|
Posts: 9
Name: Nicky
|
Quote:
Originally Posted by tripy
First, I cannot imagine someone wanting to use a marquee...
Second, google is your friend.
http://www.javascript-fx.com/develop...spancycle.html
HTML Code:
<!--- *** BEGIN CUT - Demo starts here *** --->
<!-- * You may use this code for free on any web page provided that
* these comment lines and the following credits remain in the code.
* "Link Color Cycle" © http://www.javascript-fx.com
-->
<script type="text/javascript">
/***********************************************
*
* Function : getColor
*
* Parameters : start - the start color (in the form "RRGGBB" e.g. "FF00AC")
* end - the end color (in the form "RRGGBB" e.g. "FF00AC")
* percent - the percent (0-100) of the fade between start & end
*
* returns : color in the form "#RRGGBB" e.g. "#FA13CE"
*
* Description : This is a utility function. Given a start and end color and
* a percentage fade it returns a color in between the 2 colors
*
* Author : www.JavaScript-FX.com
*
*************************************************/
function getColor(start, end, percent){
function hex2dec(hex){return(parseInt(hex,16));}
function dec2hex(dec){return (dec < 16 ? "0" : "") + dec.toString(16);}
var r1 = hex2dec(start.slice(0,2)), g1=hex2dec(start.slice(2,4)), b1=hex2dec(start.slice(4,6));
var r2 = hex2dec(end.slice(0,2)), g2=hex2dec(end.slice(2,4)), b2=hex2dec(end.slice(4,6));
var pc = percent/100;
var r = Math.floor(r1+(pc*(r2-r1)) + .5), g=Math.floor(g1+(pc*(g2-g1)) + .5), b=Math.floor(b1+(pc*(b2-b1)) + .5);
return("#" + dec2hex(r) + dec2hex(g) + dec2hex(b));
}
/************************************************/
var colors = new Array("339966", "FF0000", "00FF00", "0000FF", "FFFF00", "FF00FF", "00FFFF");
var start = colors[0];
var end = colors[0];
var index = 0;
var cindex = 0;
var faderObj = new Array();
function fadeSpan()
{
if(index == 0)
{
start = end;
end = colors[ cindex = (cindex+1) % colors.length ];
}
for(var i=0 ; i<faderObj.length ; i++)
faderObj[i].style.color = getColor(start, end, index);
index = (index+5) % 100;
setTimeout("fadeSpan()", 40);
}
function fadeAll()
{
for(var i=0 ; i<arguments.length ; i++)
faderObj[i] = document.getElementById(arguments[i]);
fadeSpan();
}
function JSFX_StartEffects()
{
fadeAll("marquee1", "marquee2");
}
</script>
<!--- *** END CUT - Demo ends here *** --->
As I understand this code, simply put an id on every marquee you want to have color cycling (a different id on each marquee !) and give the list of those id in the JSFX_StartEffects() function.
|
Hey,
Thank for giving me right guidance
|
|
|
|
04-12-2009, 10:42 PM
|
Re: Help - marquee tag in html
|
Posts: 1
|
Thanks ....for the code
--------------------------------------------------------------------------------------
Orc World Orc Online - Lots of fun games to play. 
--------------------------------------------------------------------------------------
|
|
|
|
04-13-2009, 03:42 AM
|
Re: Help - marquee tag in html
|
Posts: 15
|
i think no one could use marquee to change the color,but you can use C or other kind languange to controll it.
|
|
|
|
04-14-2009, 12:30 AM
|
Re: Help - marquee tag in html
|
Posts: 6
Name: Danny
|
Great information thanks
|
|
|
|
04-14-2009, 02:10 PM
|
Re: Help - marquee tag in html
|
Posts: 30
|
thanks for the code buddy..
And for others marquee is old but useful @ times..
|
|
|
|
04-15-2009, 08:42 AM
|
Re: Help - marquee tag in html
|
Posts: 9
Name: Nicky
|
Quote:
Originally Posted by jingwen
i think no one could use marquee to change the color,but you can use C or other kind languange to controll it.
|
Thanks for sharing your knowledge
|
|
|
|
04-21-2009, 02:04 AM
|
Re: Help - marquee tag in html
|
Posts: 5
|
Try this code:
<div
align="center"> <marquee bgcolor="#000080" scrollamount="2"
direction="up" loop="true" width="35%"> <center>
<font color="#ffffff" size="+1"><strong> THIS
IS A COOL WAY<br> TO MAKE YOUR TEXT<br> SCROLL UPWARDS<br> <br>
IT IS EASY AND FAST LOADING </strong></font> </center> </marquee></div>
|
|
|
|
04-21-2009, 02:16 AM
|
Re: Help - marquee tag in html
|
Posts: 931
|
Quote:
Originally Posted by LadynRed
Egads... a marquee??? eeeeyeeewwwwww.. so 1995, and such a BAD idea. All it does is add distraction to your page.
|
I agree. Websites with such tag like that look like an amateur-made website.
|
|
|
|
04-21-2009, 03:00 AM
|
Re: Help - marquee tag in html
|
Posts: 2,162
Name: ...
Location: ...
|
Quote:
Originally Posted by LadynRed
Egads... a marquee??? eeeeyeeewwwwww.. so 1995, and such a BAD idea. All it does is add distraction to your page.
|
Nothing wrong with the '90's ---> There just like the '80's only newer!
To be honest, I think the '80's were even better!!   
__________________
Made2Own
|
|
|
|
|
« Reply to Help - marquee tag in html
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|