Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-17-2011, 02:20 AM   PM User | #1
OregonCSSNewb
New to the CF scene

 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
OregonCSSNewb is an unknown quantity at this point
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
OregonCSSNewb is offline   Reply With Quote
Old 07-17-2011, 08:25 AM   PM User | #2
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,812
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
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..
SB65 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:33 AM.


Advertisement
Log in to turn off these ads.