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 to the CF scene
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Jquery Image Magnify won't work

    Hello,

    I am trying to get a script to work. When I click on the image here: www.katieandconrad.com/page2.html it should magnify.

    I got the script from here: http://www.dynamicdrive.com/dynamici...agemagnify.htm

    Now I am fairly competent in HTML and CSS but I know jack about javascript/jquery. I tried to disect the jquery code but it is way over my head. If someone could offer some assistance I would be very grateful.

    Regards,

    CB

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    In Firebug console I get an error on the fadein.js - '$ is not a function'.

    This is caused because the magnifier script applies .noConflict(), which relinquishes control of the $ variable, which jQuery uses as a shorthand for 'jQuery'. You're still using the shorthand in the fadein.js script, but it is no longer recognised. This error causes the subsequent code to fail - so no magnifier.

    So...amend your fadein.js to:

    Code:
    jQuery(document).ready(function($){
    	$("#wrapper").hide();
    		$(window).load(function(){
    		$("#wrapper").fadeIn("slow");
    });						   
    });
    and give that a try. Here we're explicitly calling jQuery rather than using the $ variable shorthand, so avoiding the problem.
    Last edited by SB65; 07-17-2011 at 08:30 AM.


  •  

    Posting Permissions

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