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 13360 times)
Defcon 5
Master
*****
Posts: 2410



View Profile WWW
« on: April 21, 2009, 02:33:36 pm »

thats where I got the idea of changing the colour.  Grin

But I've been pulling apart someones functions I found for fading in some text and wrote my own its rather simple, only problem I have is other browsers it wont work in opera.

Code:
var duration=1000;
var steps=100;
var fadeid="fade";

function setopacity(level){
document.getElementById('fade').style.opacity=level;
document.getElementById('fade').style.MozOpacity=level;
document.getElementById('fade').style.KhtmlOpacity=level;
document.getElementById('fade').style.filter="alpha(opacity=" + (level * 100) + ");";
}
function fadein(){
var i=0;
for (i=0; i<=1; i+=(1 / steps)) {
setTimeout("setopacity("+i+")",i * duration);
}
}
function fadeout(){
var i=0;
for (i=0; i<=1; i+=(1 / steps)) {
setTimeout("setOpacity("+(1 - i)+")",i * duration);
}
}
Rather simple when you get your head around it.
I dont know how to change the colours though due to the letters being in hex colors as well, I shall have to do some googling on the subject though.
Still I'm amazed at how much a little JS on a site can make a massive difference, which is why I'm obsessing with learning it  Cheesy
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.034 seconds with 12 queries.