Darksat IT Security Forums
March 27, 2017, 12:16:00 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  

Javascript Effects


Pages: [1]
  Print  
Author Topic: Javascript Effects  (Read 1960 times)
Defcon 5
Master
*****
Posts: 2410



View Profile WWW
« on: April 26, 2009, 06:33:34 am »

So as I am working on some simple effects I'm having trouble with them.
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);
}
}
Cannot find the latest one but thats the old one and quite basic really just fades the color into another one.

But say I have it on a mouseon and out effect if I go through a few buttons it royally fucks up, and you get theis jumpy changing, is their a way I can get around this?
Report Spam   Logged

Social Buttons

Darksat
Administrator
Master
*******
Posts: 3303



View Profile WWW
« Reply #1 on: April 29, 2009, 01:17:49 pm »

Which browser is it mesing up in, Firefox?
Got an example live?
At a glance I think it may need a clearTimeout function.

Personally I would just use Ryan Morr FX effects.
Report Spam   Logged
Defcon 5
Master
*****
Posts: 2410



View Profile WWW
« Reply #2 on: April 29, 2009, 02:24:13 pm »

Thing is where I work we're re-developing the entire sites, and I want to be ontop of the javascript development shall we say.
So I'm developing my own classes with a shit load of functions, so I don't want to use someone elses.

I want to increase my salerie Tongue by learning as much as possible to put my collection of functions across the site, while being say the main one that understands how the javascript works (so people kinda rely on me  Wink to implement the javascript, from what I've seen from others that is a good way to get a increased salerie?).
I just see it as a good plan in the recession, I need to get stuck in somewhere!

I haven't got one live, it doesn't work at all on opera because its passing a hex color code where I require a RGB, so its only been tested on FF and Safari.
But the fact is you recall it when its in the process of changing it will jump all over the place.

I'm just wondering if theirs a way to say if this is running do not run yet?
« Last Edit: April 29, 2009, 02:27:39 pm by Defcon 5 » Report Spam   Logged
Darksat
Administrator
Master
*******
Posts: 3303



View Profile WWW
« Reply #3 on: April 29, 2009, 04:18:01 pm »

Should be easy to set it to use hex code.
Just be carefull about overusing the javascript, OK
Anyway you can alway run the javascript through a compressor or encoder and keep the originals yourself.
Good way to retain control of the source.
I went down the SEO route myself, as long as you constantly improve the traffic your valuable.
Probably easier to confuse stuff via the PHP route, you can use multiple PHP includes, can make your files look really small and can burry stuff very deep and its harder for someone to check your code.
Anyway
Gonna spend time with my GF right now but will take a look tomorrow.
Try an if statement before launching based on time or colour code.

Report Spam   Logged
Defcon 5
Master
*****
Posts: 2410



View Profile WWW
« Reply #4 on: May 02, 2009, 01:09:30 am »

Someone else grabbed onto SEO, so all I could see left was JS and everyone else their relys upon jQuery and we've had rather heated debates on using jQuery or our own  Cheesy, and we shall be using our own (which is where I come in!), and because the others are lacking with their javascript knowledge I am the main guy for JS now Shocked.
Report Spam   Logged

Pages: [1]
  Print  
 
Jump to:  

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

Buy traffic for your forum/website
traffic-masters
Powered by SMF | SMF © 2016, Simple Machines
Page created in 0.078 seconds with 12 queries.