Darksat IT Security Forums
January 16, 2026, 01:47:53 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Darksat IT Security Forum
From Firewall Support, AntiVirus Questions, Spyware problems, Linux and Windows Security, Black Hat SEO right down to Website Design and Multimedia
 
  Home Help Search Gallery Links Staff List Login Register  

Gallery and lightbox scripts.

Pages: [1] 2 3 4 ... 17
  Print  
Author Topic: Gallery and lightbox scripts.  (Read 13359 times)
Defcon 5
Master
*****
Posts: 2410



View Profile WWW
« on: April 24, 2009, 02:07:38 pm »

Code:
function bgcolor(id,color){
if(color != ""){
$(id).style.backgroundColor=color;
}
}
function bgchanger(id,r,g,b){
var hex=$(id).style.backgroundColor.replace('rgb(','').replace(')','').split(',');
var startr=hex[0];
var startg=hex[1];
var startb=hex[2];
var i=1;
while(i<=255){
if(startr != r){ if(startr < r){ startr++; }else{ startr=startr-1; } }
if(startg != g){ if(startg < g){ startg++; }else{ startg=startg-1; } }
if(startb != b){ if(startb < b){ startb++; }else{ startb=startb-1; } }
setTimeout("bgcolor('"+id+"','rgb("+startr+","+startg+","+startb+")')",i*50);
// $('debugger').innerHTML=$('debugger').innerHTML;
// $('debugger').innerHTML+=''+i+'. ['+startr+'] ['+startg+'] ['+startb+']';
// $('debugger').innerHTML+="<br />";
i=i+1;
}
}
DONE, just need to shrink it a little a lot of the code is pointless now.

the $ is just a short function for document.getelementbyid  Tongue
I'm lazy.
I saw it on someone elses script and though its a good idea.

Loving Javascript  Grin
« Last Edit: April 24, 2009, 02:17:25 pm by Defcon 5 » Report Spam   Logged

Pages: [1] 2 3 4 ... 17
  Print  
 
Jump to:  

Powered by EzPortal
eXTReMe Tracker
Security Forum
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy
Page created in 0.044 seconds with 12 queries.