Results 1 to 3 of 3

Thread: Jquery attaching to a play button

  1. #1
    Join Date
    Oct 2011
    Posts
    22
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Jquery attaching to a play button

    Hi, i have a javascript gallery that when a play button is pressed the images cycle through, i have this piece of jquery to fade the images in and out once the play button has been pressed. But i need to attached it to the play button still in order for it to work, can anyone help me out?


    If you can help me, thankyou
    [/CODE]
    Last edited by louisaivy; 10-09-2011 at 04:23 AM.

  2. #2
    Join Date
    Oct 2011
    Posts
    22
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    I have been trying to add something like this
    Code:
    $('#play').click(function(){
    in the second line, am i on the right track at all?

  3. #3
    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

    This has less meaning than it could if we could see the markup.

    But, assuming you know what you want in a general sort of way and the markup and other code support it, one could do:

    Code:
    $('#captionarea').hide();
    $('#play').click(function(){
    	$('img#slide').fadeTo(500,0.05,function(){
    		$('#slide').attr('src','Assets/images/big/'+i+'.jpg');
    		$('#slide').fadeTo(500,1,function(){
    			$('#captionarea').show();
    		});
    	});
    });
    It might make more sense to:

    Code:
    $('#play').click(function(){
    	$('#captionarea').hide();
    	$('img#slide').fadeTo(500,0.05,function(){
    		$('#slide').attr('src','Assets/images/big/'+i+'.jpg');
    		$('#slide').fadeTo(500,1,function(){
    			$('#captionarea').show();
    		});
    	});
    });
    Either way, the play button would need to have already been parsed by the browser.

    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

Tags for this Thread

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
  •