Fade in/out mouseover + lightbox, images in wordpress

Discussion in 'JavaScript' started by chaukar, Feb 6, 2010.

  1. #1
    Hello,

    I really like this fade in or out effect on mouseover an image:
    http://hv-designs.co.uk/2010/01/13/learn-how-to-add-a-jquery-fade-in-and-out-effect/

    I build it into my Wordpress blog, it worked!
    But then I installed the lightbox plugins and it did not work anymore.
    Also tried slimbox and other clones.....same problem.

    How to get it work together? Or is there a simple plugin or single jquery or mootools script that has both "lightbox" for the images and "fade on mouseover" effect for the thumbnails?
     
    chaukar, Feb 6, 2010 IP
  2. mariush1007

    mariush1007 Member

    Messages:
    40
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    mariush1007, Feb 6, 2010 IP
  3. chaukar

    chaukar Peon

    Messages:
    220
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the quick reply.

    I watched some demos.....it fades the borders, not the image itself.

    Is it possible to fade the images, cuz I don't really like borders :)

    I haven't looked at the code yet.....
     
    chaukar, Feb 6, 2010 IP
  4. mariush1007

    mariush1007 Member

    Messages:
    40
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    yes, of course just add fade in/out effect to those elements, I have prepared a little example for You:

    http://m1007.com/fadeinout/

    is it what You are talking about ?
     
    mariush1007, Feb 6, 2010 IP
  5. chaukar

    chaukar Peon

    Messages:
    220
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thank you very much!

    That's exactly what I want!

    I love this forum :)
     
    chaukar, Feb 6, 2010 IP
  6. chaukar

    chaukar Peon

    Messages:
    220
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    When in "lightbox mode" the user cannot right click image > save image as...

    How can I enable this?

    I'm using mariush1007's example
     
    chaukar, Feb 6, 2010 IP
  7. chaukar

    chaukar Peon

    Messages:
    220
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hmm I see in most Lightboxes it's diables or not possible :confused:.
     
    chaukar, Feb 6, 2010 IP
  8. mariush1007

    mariush1007 Member

    Messages:
    40
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #8
    because most of those lightboxes like image galleries are adding navigation layer on top - hiding the image itself that way.

    You can disable that navigation layer using small css rule if You want:

    div.pp_hoverContainer {
        display:none !important;
    }
    Code (markup):
    but then only footer navigation (next and prev buttons) will be available to browse set of images.

    ps: I changed that in my above example so You can see the result.
     
    mariush1007, Feb 6, 2010 IP
  9. chaukar

    chaukar Peon

    Messages:
    220
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Ok thanks again for the third time :D

    My final question :eek::

    How to add a simple description + textlink in the lightbox (different for every image)?
     
    chaukar, Feb 6, 2010 IP
  10. mariush1007

    mariush1007 Member

    Messages:
    40
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #10
    if You want to add description to images in the "lightbox" view You need to use title attribute in Your <a> html tags, and if You want to include textlinks in Your descriptions You need to also escape those descriptions before You add them as a title attribute, You can do that in javascript or in php for example - if You are using php as a backend, so:

    1) in javascript case just add below code (descriptions should be in the same order as images)

    var descriptions = [
    'First image description with <a href="http://forums.digitalpoint.com/showthread.php?t=1685587" target="_blank">textlink</a>',
    'Second image description with <a href="http://forums.digitalpoint.com/showthread.php?t=1685587" target="_blank">textlink</a>',
    'Third image description with <a href="http://forums.digitalpoint.com/showthread.php?t=1685587" target="_blank">textlink</a>'
    ]
    				
    jQuery("a.photo").each(function(index){
    	jQuery(this).attr('title', escape(descriptions[index]));
    })
    Code (markup):
    2) in php case just add below code to each link:

    <a class="photo" href="images/1.jpg" rel="prettyPhoto[gal]" title="<?php echo htmlspecialchars('First image description with <a href="http://forums.digitalpoint.com/showthread.php?t=1685587" target="_blank">textlink</a>');?>"><img src="images/t_1.jpg"/></a>
    <a class="photo" href="images/2.jpg" rel="prettyPhoto[gal]" title="<?php echo htmlspecialchars('Second image description with <a href="http://forums.digitalpoint.com/showthread.php?t=1685587" target="_blank">textlink</a>');?>"><img src="images/t_2.jpg"/></a>
    <a class="photo" href="images/3.jpg" rel="prettyPhoto[gal]" title="<?php echo htmlspecialchars('Third image description with <a href="http://forums.digitalpoint.com/showthread.php?t=1685587" target="_blank">textlink</a>');?>"><img src="images/t_3.jpg"/></a>
    Code (markup):

    ps: again I changed that in my above example so You can see the result.
     
    Last edited: Feb 6, 2010
    mariush1007, Feb 6, 2010 IP
  11. chaukar

    chaukar Peon

    Messages:
    220
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Damn...

    Everything works fine in html.

    It won't work in wordpress somehow :(

    Something in wordpress is blockong it


    Guess I'm just gonna stick with a lightbox or slimbox plugin and forget the thumbnail fadings
     
    chaukar, Feb 6, 2010 IP
  12. chaukar

    chaukar Peon

    Messages:
    220
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Combined the script with http://wordpress.org/extend/plugins/wp-prettyphoto/"]this plugin and now it's working on my blog :)
     
    chaukar, Feb 7, 2010 IP
  13. mariush1007

    mariush1007 Member

    Messages:
    40
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #13
    That is great, thanks for info.
     
    mariush1007, Feb 7, 2010 IP