eq(x,x) and eq(x) with the profile page...
2 posters
Page 1 of 1
eq(x,x) and eq(x) with the profile page...
When using two (dl) from the same profile page, what is the best way to do this...
using it twice? eq(3) and eq(6)
and
Or there is another, better way?
Note: should be each dl (eq(x)) with different id or class.
using it twice? eq(3) and eq(6)
- Code:
$(function() {
$('#profilepage1').load('/u={*USERNAME} #profile-advanced-details dl:eq(3)');
});
and
- Code:
$(function() {
$('#profilepage2').load('/u={*USERNAME} #profile-advanced-details dl:eq(6)');
});
Or there is another, better way?
Note: should be each dl (eq(x)) with different id or class.
Ahmed.K- Forumember
- Posts : 349
Reputation : 4
Language : English
Re: eq(x,x) and eq(x) with the profile page...
You'd be better off, loading the parent element like so:
Then removing everything except the to DL elements you want.
- Code:
$('#profilepage2').load('/profile.forum?mode=viewprofile&u={*USERNAME} #profile-advanced-details', function() {
// sort out #profilepage2 to only contain the two elements you want.
});
Then removing everything except the to DL elements you want.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: eq(x,x) and eq(x) with the profile page...
what do you mean?
I want something like this (this is wrong code, but just to catch my point):
I want something like this (this is wrong code, but just to catch my point):
- Code:
$('#profilepage').load('/profile.forum?mode=viewprofile&u={*USERNAME} #profile-advanced-details', function() {
$('#profilepage1') document.getElementById('#profile-advanced-details dl')[3];
$('#profilepage2') document.getElementById('#profile-advanced-details dl')[6];
});
Ahmed.K- Forumember
- Posts : 349
Reputation : 4
Language : English
Re: eq(x,x) and eq(x) with the profile page...
Yes that's what I'm saying.
Doing this .load() :
You are loading the '#profile-advanced-details' element, which contains your two DL elements. All you need to do is then move them out of that and put them where you want them.... one load, two DL's.
Doing this .load() :
- Code:
$('#profilepage2').load('/profile.forum?mode=viewprofile&u={*USERNAME} #profile-advanced-details', function() {
// sort out #profilepage2 to only contain the two elements you want.
});
You are loading the '#profile-advanced-details' element, which contains your two DL elements. All you need to do is then move them out of that and put them where you want them.... one load, two DL's.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: eq(x,x) and eq(x) with the profile page...
Well, how? giving id for these parts:LGforum wrote:All you need to do is then move them out of that
#profile-advanced-details dl:eq(3)
#profile-advanced-details dl:eq(6)
is this correct?
- Code:
$('#profilepage').load('/profile.forum?mode=viewprofile&u={*USERNAME} #profile-advanced-details', function() {
$('#profilepage1') #profile-advanced-details dl:eq(3)
$('#profilepage2') #profile-advanced-details dl:eq(6)
});
<div id="profilepage2"></div>
Ahmed.K- Forumember
- Posts : 349
Reputation : 4
Language : English
Re: eq(x,x) and eq(x) with the profile page...
- Code:
$('#profilepage').load('/profile.forum?mode=viewprofile&u={*USERNAME} #profile-advanced-details', function() {
$('#profilepage1').append( $('#profile-advanced-details dl:eq(3)')[0] );
$('#profilepage2').append( $('#profile-advanced-details dl:eq(6)')[0] );
})
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: eq(x,x) and eq(x) with the profile page...
Doesn't work.
Ahmed.K- Forumember
- Posts : 349
Reputation : 4
Language : English
Re: eq(x,x) and eq(x) with the profile page...
Well I don't know what your doing... I've just showed you what you wanted... you wanted to get the 2 DL elements with one load. Thats the way to do it, get its parentNode, and then get the two DL elements and put them where you want them to go.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: eq(x,x) and eq(x) with the profile page...
See, Just it works with this one
Now, how we add eq(3) to .append('<div id="profilepage"></div>'); ?
- Code:
$(function() {
$('#profilepage1').append('<div id="profilepage"></div>');
$('#profilepage').load('/profile.forum?mode=viewprofile&u={*USERNAME} #profile-advanced-details dl');
});
Now, how we add eq(3) to .append('<div id="profilepage"></div>'); ?
Ahmed.K- Forumember
- Posts : 349
Reputation : 4
Language : English
Re: eq(x,x) and eq(x) with the profile page...
This one doesn't work too.
Ahmed.K- Forumember
- Posts : 349
Reputation : 4
Language : English
Re: eq(x,x) and eq(x) with the profile page...
The HTML code in widget and javascript in Javascript codes management
You have a private message with an admin account on the test forum.
You have a private message with an admin account on the test forum.
Ahmed.K- Forumember
- Posts : 349
Reputation : 4
Language : English
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum