vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Link changes colours when mouse hovers over it. (https://vborg.vbsupport.ru/showthread.php?t=102442)

leftie 12-07-2005 07:30 PM

Link changes colours when mouse hovers over it.
 
I have visited a forum where if you hover the cursor over a link in the navbar or username or new post it changes through about four different colours. Does any one know what this is, I have tried a search but i really don't where to start it so i have had no success.
Please help.

scotsnutta 12-09-2005 01:13 AM

Quote:

Originally Posted by leftie
I have visited a forum where if you hover the cursor over a link in the navbar or username or new post it changes through about four different colors. Does any one know what this is, I have tried a search but i really don't where to start it so i have had no success.
Please help.

i'm a newbi here and dont know much about scripting but i'll try and help you. i use that style for my forum so all my links flash so from what i can work out this is how you do it:

go to your header template in your style manager

find
Code:

<!-- /logo -->
and below that paste this

Code:


<script language="JavaScript">
function stopError() {
        return true;
}
window.onerror = stopError;
// -->
</script>
<!-- content table -->
$spacer_open
$_phpinclude_output
<script language="JavaScript">
function stopError() {
        return true;
}
window.onerror = stopError;
// -->
</script>
<SCRIPT src="<A href="http://www.mjjlatino.net/foro/clientscript/rainbow.js"></SCRIPT">http://www.mjjlatino.net/foro/clientscript/rainbow.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function expandingWindow(website) {
var heightspeed = 2; // vertical scrolling speed (higher = slower)
var widthspeed = 7; // horizontal scrolling speed (higher = slower)
var leftdist = 0;        // distance to left edge of window
var topdist = 0;        // distance to top edge of window
if (document.all) {
var winwidth = window.screen.availWidth - leftdist;
var winheight = window.screen.availHeight - topdist;
var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=1,height=1,scrollbars=yes");
for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) {
sizer.resizeTo("1", sizeheight);
}
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) {
sizer.resizeTo(sizewidth, sizeheight);
}
sizer.location = website;
}
else
window.location = website;
}
// End -->
</script>

hope that works as i say i'm new to this, and your the first person i've tried to help!!

let me know how you get on

Zia 12-17-2005 08:00 AM

nice..but he have'nt given a reply yet...

tipoboy 12-17-2005 02:17 PM

the code above can be narrowed down to this

<SCRIPT src="<A href="http://www.mjjlatino.net/foro/clientscript/rainbow.js">
</SCRIPT">
<SCRIPT LANGUAGE="JavaScript">

so i believe anyways i have this on my board also

leftie 01-03-2006 06:34 PM

Sorry for my late reply.
Thank you for your help. I have tried adding the code to the template but nothing happens. :(

tipoboy 01-04-2006 12:16 AM

Quote:

Originally Posted by leftie
Sorry for my late reply.
Thank you for your help. I have tried adding the code to the template but nothing happens. :(

ok download the "rainbow.js" file open it and copy the entire script into your header template via the style and templates section in your admincp

leftie 01-04-2006 04:55 PM

Sorry, still does not work.

tipoboy 01-04-2006 09:33 PM

Quote:

Originally Posted by leftie
Sorry, still does not work.

ok erm copy this scriptn into your header works on my forum, let me know how you get on

Code:


<SCRIPT LANGUAGE="JavaScript">
var rate = 20;
 
var obj;
var act = 0;
var elmH = 0;
var elmS = 128;
var elmV = 255;
var clrOrg;
var TimerID;
 
 
if (navigator.appName.indexOf("Microsoft",0) != -1 && parseInt(navigator.appVersion) >= 4) {
Browser = true;
} else {
Browser = false;
}
 
if (Browser) {
document.onmouseover = doRainbowAnchor;
document.onmouseout = stopRainbowAnchor;
}
 
function doRainbow()
{
if (Browser && act != 1) {
act = 1;
obj = event.srcElement;
clrOrg = obj.style.color;
TimerID = setInterval("ChangeColor()",100);
}
}
 
function stopRainbow()
{
if (Browser && act != 0) {
obj.style.color = clrOrg;
clearInterval(TimerID);
act = 0;
}
}
 
function doRainbowAnchor()
{
if (Browser && act != 1) {
obj = event.srcElement;
 
while (obj.tagName != 'A' && obj.tagName != 'BODY') {
obj = obj.parentElement;
if (obj.tagName == 'A' || obj.tagName == 'BODY')
break;
}
 
if (obj.tagName == 'A' && obj.href != '') {
act = 1;
clrOrg = obj.style.color;
TimerID = setInterval("ChangeColor()",100);
}
}
}
 
function stopRainbowAnchor()
{
if (Browser && act != 0) {
if (obj.tagName == 'A') {
obj.style.color = clrOrg;
clearInterval(TimerID);
act = 0;
}
}
}
 
function ChangeColor()
{
obj.style.color = makeColor();
}
 
function makeColor()
{
 
if (elmS == 0) {
elmR = elmV; elmG = elmV; elmB = elmV;
}
else {
t1 = elmV;
t2 = (255 - elmS) * elmV / 255;
t3 = elmH % 60;
t3 = (t1 - t2) * t3 / 60;
 
if (elmH < 60) {
elmR = t1; elmB = t2; elmG = t2 + t3;
}
else if (elmH < 120) {
elmG = t1; elmB = t2; elmR = t1 - t3;
}
else if (elmH < 180) {
elmG = t1; elmR = t2; elmB = t2 + t3;
}
else if (elmH < 240) {
elmB = t1; elmR = t2; elmG = t1 - t3;
}
else if (elmH < 300) {
elmB = t1; elmG = t2; elmR = t2 + t3;
}
else if (elmH < 360) {
elmR = t1; elmG = t2; elmB = t1 - t3;
}
else {
elmR = 0; elmG = 0; elmB = 0;
}
}
 
elmR = Math.floor(elmR);
elmG = Math.floor(elmG);
elmB = Math.floor(elmB);
 
clrRGB = '#' + elmR.toString(16) + elmG.toString(16) + elmB.toString(16);
 
elmH = elmH + rate;
if (elmH >= 360)
elmH = 0;
 
return clrRGB;
}
</SCRIPT>


leftie 01-05-2006 07:17 PM

Yahhhhhhh it works, thanks buddy. Thank you.
What was the problem m8 with the others codes. :)

Ps, it looks like you have worked hard in your script, perhaps you should include your credit and release it. :nervous:

tipoboy 01-06-2006 01:21 PM

Quote:

Originally Posted by leftie
Yahhhhhhh it works, thanks buddy. Thank you.
What was the problem m8 with the others codes. :)

Ps, it looks like you have worked hard in your script, perhaps you should include your credit and release it. :nervous:

i found the script at http://www.mjjlatino.net

all i did was open up the javascript file, and post up the code in it m8. i deserve no credit. at least i can say i helped someone though lol


All times are GMT. The time now is 01:00 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01128 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete