Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2009
    Posts
    78
    Thanks
    17
    Thanked 1 Time in 1 Post

    fancybox not working...

    Site: http://bit.ly/cpPNuL

    The video image of the lady in the sidebar is supposed to pop up with Fancybox. I added a class "fancybox", loaded all the necessary scripts and css and fired it up with the following code; however, no dice. Can someone take a look at it and let me know where I went wrong?

    Code:
    jQuery(".fancybox").click(function() {
    	jQuery.fancybox({
    		'padding'		: 0,
    		'autoScale'		: false,
    		'transitionIn'	: 'none',
    		'transitionOut'	: 'none',
    		'title'			: this.title,
    		'width'			: 400,
    		'height'		: 265,
    		'href'			: this.href.replace(new RegExp("([0-9])","i"),'moogaloop.swf?clip_id=$1'),
    		'type'			: 'swf'
    	});
    	
    	return false;
    
    });

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Wrap everything above in a document.ready() so it actually gets called:

    Code:
    jQuery(document).ready(function() { 
    // do stuff
    });

  • Users who have thanked Spudhead for this post:

    cpkid2 (07-07-2010)


  •  

    Posting Permissions

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