I struggled a lot with this, and I found out now that it doesn't work with the newer versions of jQuery. jQuery version 1.4.2 still works, but from version 1.4.3 and higher it doesn't work any more.

It also doesn't solve the problem when putting the newer file into the same folder as the other js-files.

When I embed the 1.4.3-plugin in the exercise file from the book, it also doesn't work any more.

Is something changed in the newer jQuery-versions, and is there a workaround for this? Maybe it's possible to put a solution in the 'corrections and typos'-section of this book?

Thanks for your help

ralphm
—
2011-02-13T12:46:32Z —
#2

robdewinter said:

I found out now that it doesn't work with the newer versions of jQuery. jQuery version 1.4.2 still works, but from version 1.4.3 and higher it doesn't work any more.

I just tried it with jQuery version 1.5 and it works fine. Have you checked your file paths?

PS: Hi robdewinter, welcome to SitePoint!

robdewinter
—
2011-02-13T12:57:08Z —
#3

Hi, jQuery 1.5 doesn't work with me, neither in the exercise file. I tried the googleapi link, and tried to place it in the folder. I checked the file paths and they are okey, connections are fine, when I replace an older file than 1.4.2 it doesn't work. Have you used the first animated navigation (with the #navigation_blob)? Thanks for your welcome by the way

ralphm
—
2011-02-13T13:06:18Z —
#4

I have only just started the book, so jumped ahead to test that file. Which file is the navigation_blob in? Let me know and I'll test it out.

robdewinter
—
2011-02-13T13:12:05Z —
#5

The file is in the lesson 3 folder, 09_animated_navigation (the first one).

ralphm
—
2011-02-13T13:34:39Z —
#6

Huh, interesting. Yes, the 09 menu doesn't seem to work right with JQ 1.5, though the dropdown in folder 10 does. Hmm, that's a worry.

robdewinter
—
2011-02-13T14:29:44Z —
#7

Thanks for trying. It also doesn't work when making the exercise (even with the corrected code on page 66 --> the ; after left;} is a mistake).

Paul_Wilkins
—
2011-02-13T23:08:03Z —
#8

The problem seems to be that animating a hidden element causes that element to show in 1.4, but in 1.5 it doesn't.

Where with 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4 and 1.5.0 does the problem occur?

1.4.0, 1.4.1 and 1.4.2 work fine.From 1.4.3 onwards is where things stop working.

Paul_Wilkins
—
2011-02-14T00:26:24Z —
#9

One solution is to remove all of the parts that hide/show the blob, and then add a final piece to set the blob's width once you leave it.

You can then later on work out how to implement a hiding mechanism, if the need for it is strong enough.

ralphm
—
2011-03-18T07:59:49Z —
#10

I just got up to this part of the book, and noticed that the code in the download files is different from the code in the actual book. So I replaced the code in script.js with the code in the book and it works perfectly even with jQuery version 1.5.1. The authors obviously just forgot to update the download files.

EDIT:Sorry guys, forget this. The code doesn't work. It only appeared to work because I had a typo (I had navigation_blob instead of navigation-blob in the last section of code). So the hover only worked partially.

kinakuta_james
—
2011-03-31T22:52:58Z —
#11

It seems like all you have to do is call show() before calling animate() on hover for the first hover function:

It seems like all you have to do is call show() before calling animate() on hover for the first hover function

Have you tried this with jQuery 5 though? I doesn't seem to work with that.

kinakuta_james
—
2011-04-01T03:30:32Z —
#13

The code was relying on calls to animate() to "show" the div - apparently this wasn't the behavior they intended so they changed it and this broke code which relied on that behavior (which seemed like a side effect anyway.) If you just explicity call show() before you call animate, the code will work as intended (tried it on 1.5.1 and it works as expected.)

ralphm
—
2011-04-01T03:48:05Z —
#14

Hm, do you mind posting the full script you are using then? Nothing happens for me with JQ5 with the code you posted, but perhaps I don't use it correctly. Pasted it in where it seemed to belong.

Paul_Wilkins
—
2011-04-01T03:54:26Z —
#15

ralph_m said:

Hm, do you mind posting the full script you are using then? Nothing happens for me with JQ5 with the code you posted, but perhaps I don't use it correctly. Pasted it in where it seemed to belong.

Can you please link is to this JQ5 that you are using? It's one that I don't think I have come across before.