Version: 1.00, by Triky
Developer Last Online: Nov 2023
Category: Miscellaneous Hacks -
Version: 3.7.0 Beta 3
Rating:
Released: 12-26-2007
Last Update: Never
Installs: 7
Template Edits
Re-useable Code Translations
No support by the author.
[Monkey's Works] - Ghost Images
by Triky - Web City
Hi there, guys and gals! I've foud this script: Gradual HighLight Image Script. I've asked myself: "How do I use it all over my forum?". I've used a Replacement Variables!
Go to your headinclude template
(AdminCp -> Styles & Templates -> Edit Templates -> headinclude)
Seacrh for:
Code:
<!-- / CSS Stylesheet -->
Below, add:
Code:
<script type="text/javascript">
/***********************************************
* Gradual Highlight image script- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
var baseopacity=30
function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",50)
}
function slowlow(which2){
cleartimer()
instantset(baseopacity)
}
function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}
function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}
function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}
</script>
Save & Close.
Now go to your style options:
(vBAdminCp -> Styles & Templates -> Styles Manager -> Your style Name --> All style Options -> Go!)
In Additional CSS Definitions (second box), add:
Save & Close.
Now, go to add a new Replacement Variable:
(vBAdminCp -> Styles & Templates -> Styles Manager -> Your style Name --> Replacement Variables -> Add -> Go!):
Search for text: <img Replace with text: <img class="gradualshine" onMouseover="slowhigh(this)" onMouseout="slowlow(this)"
To be more specific you could work out localized image ids/classes (if they have any) or add your own, such as Reply and Closed buttons in SHOWTHREAD template I add the class highlighted in red:
Now the CSS code is the same as above but tweaking the top lines to reflect the class added:
Code:
img {
to:
Code:
img.img_op {
and:
Code:
img.img_op:hover {
to:
Code:
img.img_op:hover {
Obviously this would be a very time consuming task if you wanted it to effect many images but I just wanted to show you how it could be achieved on a per image basis with no JS.