Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #1  
Old 12-19-2006, 02:20 PM
irishblue Offline
forum loafer
 
Join Date: Dec 2006
Posts: 18
Mouseover swapping of image

Hi there,
I'm new here. I searched around if there are existing hacks or mods but didn't manage to find any similar.

I would like to use PixelPost to display digitally enhanced photos and was hoping that there will be the ability to display a before / after effect of photos using OnMouseOver. Basically, one image has two states e.g. image1-before.jpg and image1-after.jpg. When the mouse rolls over the main image, it will swap and show image1-before.jpg. And upon mouseout, it will display the image1-after.jpg

Would this be possible to do in PixelPost? Woud appreciate if someone could help out
Reply With Quote
  #2  
Old 12-19-2006, 05:58 PM
Dennis's Avatar
Dennis+ Offline
Team Pixelpost
 
Join Date: Jul 2006
Posts: 2,394
Send a message via MSN to Dennis
Have a look here: http://movie.leova.com/index.php?x=secret
__________________
My photoblog, powered by PixelPost 1.9 dev SVN | My Pixelpost Addons | My Cool Photoblog profile
Reply With Quote
  #3  
Old 12-20-2006, 07:39 AM
austriaka's Avatar
austriaka+ Offline
Team Pixelpost
 
Join Date: Nov 2006
Location: Germany
Posts: 1,175
Send a message via ICQ to austriaka Send a message via AIM to austriaka
I did it here with a very simple JavaScript, you find my "digital darkroom secret" when moving the mouse over the little mouth beneath the bottom right corner of the image:
http://blog.uhlig.at
(no mouth, no secret)

The doing:

You have to create a little grafic for the "secret". Do it in two
different colors (in my site it is the mouth, in grey and red)
Use it like this:
The image which should have a secret to reveale must have a (unique)
name, IE:
<img src="123456789_001.jpg" name="mainimage">
(change that in image_template.html)
The "before"-images have the same name than the "after"-images, just type "o_" before the name.
IE:
after: 123456789_001.jpg
before: o_123456789_001.jpg

The HTML for the "Secret" grafic (just for understanding):
Code:
<a href="#"
onMouseover="
document.images['secret'].src='PATH TO HIGHLITE SECRET GRAFIC';
document.images['IMAGE NAME'].src='PATH TO BEFORE IMAGE'"
onMouseout="
document.images['secret'].src='PATH TO LOWLITE SECRET GRAFIC';
document.images['IMAGE NAME'].src='PATH TO IMAGE'"
onClick="return false;" title="Before Processing">
<img name="secret" src="PATH TO LOWLITE SECRET GRAFIC" border="0">
</a>
In {pixelpost_src}/index.php insert this in line 258:

Code:
// ############ SECRET ################ //
if (is_file('images/o_'.$image_name)) {
	$tpl = str_replace("<SECRET_LINK>",'<a href="#" onMouseover="document.images[\'secret\'].src=\'templates/light.my.dark-ger/img/secret.gif\'; document.images[\'maini\'].src=\'images/o_'.$image_name.'\'" onMouseout="document.images[\'secret\'].src=\'templates/light.my.dark-ger/img/secret_grey.gif\'; document.images[\'maini\'].src=\'images/'.$image_name.'\'" onClick="return false;" title="Digital Darkroom Secret"><img name="secret" src="templates/light.my.dark-ger/img/secret_grey.gif" border="0" align="right" /></a>',$tpl);
}
else {
	$tpl = str_replace("<SECRET_LINK>",'',$tpl);
}
In image_template.html put the new pixelpost tag <SECRET_LINK> wherever you want it to be shown.

If anybody is interested, I could do this as an addon, should be not very tricky
KArin
__________________
Uh!log Photoblog
My Addons

Last edited by austriaka; 12-20-2006 at 12:14 PM.
Reply With Quote
  #4  
Old 12-20-2006, 12:37 PM
klimin_a_s's Avatar
klimin_a_s Offline
pp veteran
 
Join Date: Oct 2006
Location: Russia, Birsk
Posts: 95
Send a message via ICQ to klimin_a_s
austriaka, do you upload o_<filename>.jpg manual? I would like a see addon, that can upload and manage "before" images in the admin area.
__________________
Klimin Andrew,
Birsk photoblog: photoblog.birsk.info (PP 1.7.1)
Pixelpost addons: Custom Fields 1.3
Reply With Quote
  #5  
Old 12-20-2006, 12:43 PM
austriaka's Avatar
austriaka+ Offline
Team Pixelpost
 
Join Date: Nov 2006
Location: Germany
Posts: 1,175
Send a message via ICQ to austriaka Send a message via AIM to austriaka
yes, actually I do it manually.
I am just playing around with doing it with an addon, it is not such a problem

KArin
__________________
Uh!log Photoblog
My Addons
Reply With Quote
  #6  
Old 12-20-2006, 12:49 PM
klimin_a_s's Avatar
klimin_a_s Offline
pp veteran
 
Join Date: Oct 2006
Location: Russia, Birsk
Posts: 95
Send a message via ICQ to klimin_a_s
I can take this work! This will be my second addon! (I am not persist in doing that, actually). What you say?
__________________
Klimin Andrew,
Birsk photoblog: photoblog.birsk.info (PP 1.7.1)
Pixelpost addons: Custom Fields 1.3
Reply With Quote
  #7  
Old 12-20-2006, 01:33 PM
austriaka's Avatar
austriaka+ Offline
Team Pixelpost
 
Join Date: Nov 2006
Location: Germany
Posts: 1,175
Send a message via ICQ to austriaka Send a message via AIM to austriaka
if you don't mind, I want to do it by myself (have it halfway done already ;-)
But I can send it to you for testing, as soon as I am ready if you want
ok?
KArin
__________________
Uh!log Photoblog
My Addons
Reply With Quote
  #8  
Old 12-20-2006, 01:39 PM
klimin_a_s's Avatar
klimin_a_s Offline
pp veteran
 
Join Date: Oct 2006
Location: Russia, Birsk
Posts: 95
Send a message via ICQ to klimin_a_s
austriaka, I'll very glad to test your addon! Thank you!
__________________
Klimin Andrew,
Birsk photoblog: photoblog.birsk.info (PP 1.7.1)
Pixelpost addons: Custom Fields 1.3
Reply With Quote
  #9  
Old 12-20-2006, 02:47 PM
irishblue Offline
forum loafer
 
Join Date: Dec 2006
Posts: 18
Thanks schonhose and Austriaka! That's exactly what I wanted to achieve
Reply With Quote
  #10  
Old 12-20-2006, 05:05 PM
austriaka's Avatar
austriaka+ Offline
Team Pixelpost
 
Join Date: Nov 2006
Location: Germany
Posts: 1,175
Send a message via ICQ to austriaka Send a message via AIM to austriaka
Andrew,
I couldn't find an email adress in your site, could you contact me via ICQ?
(or look for my email adress in Uh!log)
KArin
__________________
Uh!log Photoblog
My Addons
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 02:38 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs