Results 1 to 4 of 4

Thread: Conveyor Belt slideshow with opacity hover

  1. #1
    Join Date
    Jul 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Conveyor Belt slideshow with opacity hover

    Hello, I hope someone take a hand.

    I want to implement opacity to these images but I have no success ...

    This is the code that implements the alpha to the images, using jQuery.

    Code:
    <script type="text/javascript">
        $(document).ready(function() {
            $(".thumbs img").fadeTo("slow", 0.6);
            $(".thumbs img").hover(function() {
                $(this).fadeTo("slow", 1.0);
            }, function() {
                $(this).fadeTo("slow", 0.6);
            });
        });
    </script>
    The problem is not put in any image, because if I get in any normal image. What happens is I put it on a slide ... specifically this...

    http://www.dynamicdrive.com/dynamici...rightslide.htm

    I have tried to implement it, as it should normally be

    Code:
    leftrightslide[0]='<a href="#" class="thumbs">
    <img src="dynamicbook1.gif" border=1></a>'
    But do not get results ... I do not know why ... scriptaculous had used before and that if I worked perfectly with this code... this.

    Code:
    leftrightslide[0]='<a href="#"><img  style="opacity:0.6;filter:alpha
    (opacity=60)"onmouseover="new Effect.Appear(this, {from:0.6, to:1.0});"
    onmouseout="new Effect.Appear(this, {from:1.0, to:0.6});" 
    src="dynamicbook1.gif" border="0"></a>'
    I do not want to use scriptaculous, because on my page I have jQuery and I'm in some ways conflicts

    I hope someone can help ... they are grateful.

    Regards and excuse my English

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Requires jQuery 1.4 or greater:

    Code:
    <script type="text/javascript">
    jQuery(function($){
    	var opacitystr = 'opacity: 0.6;';
    	/*@cc_on @*//*@if(@_jscript_version >= 5)if($.browser.version < 9)opacitystr = 'filter:alpha(opacity=60);';@end @*/
    	$('head').append('<style type="text/css">#test2 img, #test3 img {' + opacitystr + '}<\/style>');
    	$('#test2 img, #test3 img').live('mouseenter mouseleave', function(e){
    		$(this).animate({opacity: e.type === 'mouseenter'? 1 : 0.6}, 'slow');
    	});
    });
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Now if it worked, thank you very much
    Last edited by masterquest; 07-19-2011 at 07:43 PM.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    What version of jQuery are you using? As stated, this requires 1.4 or greater. Or perhaps you have some other error on your page.

    It works:

    http://home.comcast.net/~jscheuer1/s...fade_hover.htm

    If you want more help:

    Please post a link to a page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •