Bluepearl Design
Go Back   Bluepearl Design > Misc > Tutorials > HTML, XHTML, Javascript, CSS

Making Your Buttons Flicker When Pressed

HTML HyperText Markup Language.
XHTML Extensible Hypertext Markup Language.
JAVASCRIPT object-based scripting programming language.
CSS Cascading Style Sheets.

    

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 09-04-2005, 02:37 AM   #1 (permalink)
 
SpawnDemon's Avatar
 
Title: Bluepearl Veteran
Join Date: Jul 2005
Location: Philadelphia, Pennsylvania - Home Base
Posts: 727
Rep Power: 4 SpawnDemon is on a distinguished road
Send a message via MSN to SpawnDemon Send a message via Skype™ to SpawnDemon
Making Your Buttons Flicker When Pressed

Today I will show you how to make your buttons flicker when a mouseover is happening.

Example: www.covclan.zeeblo.com/covclan

#1 At the tope of your HTML document put this code between the <link> or <META> tags and the <HEAD> tags that are at the bottom.

Quote:
<script language="JavaScript1.2">

function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)", 50)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.3
else if (which2.filters)
which2.filters.alpha.opacity=40
}

function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpa city)+0.1
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

</script>
#2. Goto to your first button and look for the part where it says

<img border="YourSize"
src="images/yourbutton.jpg(w/e format)

then after that type:

Quote:
style="filter:alpha(opacity=40);-moz-opacity:0.3"
onMouseover="high(this)" onMouseout="low(this)" width="170" height="21
The End Result Should look something like this

Quote:
<td height="yourheight" background="images/yourbuttonbackground.jpg"><a href="yourpage.html"><img border="yoursize"
src="images/yourbutton.jpg" style="filter:alpha(opacity=40);-moz-opacity:0.3"
onMouseover="high(this)" onMouseout="low(this)" width="yoursize" height="yoursize"></a></td>
The Top Should look like this:

Quote:
<head>
<title>YourTitle</title>
<link rel="stylesheet" href="style.css" type="text/css"> |<-- This stuff does not apply.
<script language="JavaScript1.2">

function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)", 50)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.3
else if (which2.filters)
which2.filters.alpha.opacity=40
}

function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpa city)+0.1
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

</script>
</head>
All things in red depend on your website. You can screw with the Opacity to fit your theme.
__________________
What did he say? A new e1studios site? Where can I get some. Click Here!

Last edited by SpawnDemon; 09-04-2005 at 02:40 AM.
SpawnDemon is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-04-2005, 08:00 PM   #2 (permalink)
 
Fragalot's Avatar
 
Title: Ipood
Join Date: Nov 2004
Location: belgium west-flandres
Age: 19
Posts: 4,442
Images: 1
Rep Power: 9 Fragalot is on a distinguished road
Send a message via ICQ to Fragalot Send a message via MSN to Fragalot Send a message via Yahoo to Fragalot
Re: Making Your Buttons Flicker When Pressed

nice tutorial mate
Fragalot is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-04-2005, 08:47 PM   #3 (permalink)
 
Sean's Avatar
 
Title: Founder/Admin
Join Date: Jan 2004
Location: Sydney, Australia
Age: 28
Posts: 8,907
Images: 386
Blog Entries: 4
Rep Power: 10 Sean will become famous soon enough
Send a message via MSN to Sean Send a message via Skype™ to Sean
Re: Making Your Buttons Flicker When Pressed

Thanks for adding
Sean is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-06-2005, 04:30 PM   #4 (permalink)
 
Title: Bluepearl Veteran
Join Date: Feb 2005
Posts: 1,848
Images: 9
Rep Power: 6 Kate will become famous soon enoughKate will become famous soon enough
Re: Making Your Buttons Flicker When Pressed

Nice tutorial, Thanks for adding
Kate is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-12-2005, 12:43 PM   #5 (permalink)
 
bjinc's Avatar
 
Title: Banned
Join Date: Nov 2005
Location: 123 OUT OF MY WAY
Age: 21
Posts: 36
Rep Power: 0 bjinc is on a distinguished road
Send a message via AIM to bjinc Send a message via MSN to bjinc
Red face Re: Making Your Buttons Flicker When Pressed

Thank you for adding this tutorial keep it up
bjinc is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads for: Making Your Buttons Flicker When Pressed
Thread Thread Starter Forum Replies Last Post
Request Plz Buttons For Clanz BlazedTrigun ClanzDarkness2 35 10-23-2005 10:44 AM
should i create new buttons for this theme? Sean ClanzDarkness 12 01-19-2004 06:30 PM


  
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Bluepearl Templates

All times are GMT +11. The time now is 06:03 PM.

 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52