Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Google Docs
Each Attachment size should not exceed 1.0 MB.
Max no of attachments : 3
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
New to this Portal? Click here to
Sign up
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
jQuery
Plugins
UI
Meetups
Forum
Blog
About
Donate
All Forums
Recent Posts
Log In
Search
jQuery
Search
jQuery Forum
Move this topic
Forum :
Getting Started
Using jQuery
Using jQuery Plugins
Using jQuery UI
Developing jQuery Core
Developing jQuery Plugins
Developing jQuery UI
QUnit and Testing
About the jQuery Forum
jQuery Conferences
jQuery Mobile
Developing jQuery Mobile
Sub forum :
Move this topic
Cancel
Using jQuery
skc03fr
[SOLVED] Script doesn't work since jQuery 1.6
in
Using jQuery
•
10 years ago
Hello, I would like to update my website by using the newest jQuery (1.8.3).
The code below works with jQuery before 1.6. Could you please help me to update my code ?
jQuery.noConflict();
jQuery(document).ready(function($) {
$('[class^=toggle]').hide();
$('[class^=link]').click(function() {
var $this = $(this);
var x = $this.attr("className");
$('.toggle-' + x).toggle(400);
return false;
});
});
Thank you in advance.
1
Replies(3)
skc03fr
Re: Script doesn't work since jQuery 1.6
10 years ago
I think I found but I'm not sure.
I change .attr by .prop and it works with newest jQuery 1.8.3.
Could you please confirm me I'm true ?
Leave a comment on skc03fr's reply
dsvick
Re: Script doesn't work since jQuery 1.6
10 years ago
It should be "class" not "className":
var x = $this.attr("class");
Dave
skc03fr
Re: Re: Script doesn't work since jQuery 1.6
10 years ago
I make your change Dave and it still works. Thank you. I think the biggest problem was .attr between .prop.
jQuery.noConflict();
jQuery(document).ready(function($) {
$('[class^=toggle]').hide();
$('[class^=link]').click(function() {
var $this = $(this);
var x = $this.prop("class");
$('.toggle-' + x).toggle(400);
return false;
});
});
It's ok with jQuery 1.8.3
Bruno.
Leave a comment on dsvick's reply
Change topic type
Topic Type :
Discussions
Questions
Ideas
Problems
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to skc03fr's question
Top
Reply
{"z23130384":[14737000003681910,14737000003681915,14737000003681931],"z7734866":[14737000003685056]}
Statistics
3
Replies
2319
Views
0
Followers
Tags
Cancel
update
old
code
version
Actions
Permalink