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
Screen name:
Buitrako
Buitrako's Profile
4
Posts
6
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Ideas
Problems
Expanded view
List view
Private Message
Insert a new html element before another
[2Replies]
25-Feb-2011 07:32 AM
Forum:
Getting Started
Hi.
I have a td like this:
<td id="info">
<a href="#" id="linkfirst"> <span id="first">First</span> </a>
<a href="#" id="linkprevious"> <span id="previous">Previous</span> </a>
<a href="#" id="linknext"> <span id="next">Next</span></a> </a>
<a href="#" id="linklast"> <span id="last">Last</span></a> </a>
</td>
I want to remove the two first links and leave only the <span> tags.
I remove the first two elements doing this:
$('td#info a').first().detach();
$('td#info a').first().detach();
And I'm trying to put the <span> tag doing this:
$('#info a').first().prepend('').html('<span id="first">First</span> ');
But this instruction substitutes the code into the "third" element (now first).
How can I put new HTML code before this element?
Append method without moving?
[2Replies]
23-Feb-2011 04:55 AM
Forum:
Getting Started
Hi.
There is no method to append an element to another without moving?
I think that the only solution is to use .html() method. Is this true?
append
[5Replies]
21-Feb-2011 11:48 AM
Forum:
Getting Started
Hi.
I have two HTML tables, one with five td elements and another empty. I want to append an element from the fist table on the second table and delete it from the first table.
So here is code:
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
});
</script>
</head>
<body>
<script>
$(document).ready(function(){
var numElems = $('#data-source td').length;
console.log("Before deleting there are " + numElems + " elements in the original collection");
//I try to append one element to the second table and remove it from the first table
$('#data-source:nth-child(1)').append('#new_table'); // DOESN'T WORK!
$('#data-source td:nth-child(1)').remove(); // Yeah! It works!
var numElems = $('#data-source td').length;
console.log("After deleting there are " + numElems + " elements in the original collection");
//Verification of thing's that doesn't work
var numElems2 = $('#new_table td').length;
console.log("There are " +numElems2+ " elements in the new collection");
$('#new_table').css('display', 'block');
});
</script>
<table id="data-source" align="center">
<tr>
<td>First element.</td>
<td>Second element.</td>
<td>Third element.</td>
<td>Fourth element.</td>
<td>Fifth element.</td>
</tr>
</table>
<table id="new_table" align="center"></table>
</body>
</html>
My problem is in line 19.
Can anyone help me? Any idea?
Thank you very much.
Any ideas to disordering a table?
[3Replies]
20-Feb-2011 05:18 PM
Forum:
Getting Started
Hi, I'm new at the forum and new in jQuery.
I have to alter randomly the order of the td elements of a table. Do you have any idea to do it "quickly"?
My initial idea is:
- Clone the original table (I can't modify it).
- Disorder randomly the elements of the cloned table.
- Show the cloned table.
The actual code is:
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
});
</script>
</head>
<body>
<script>
$(document).ready(function(){
<!-- We make the copy of the table
$('#data-source tr')
.clone()
.appendTo("#new_table")
;
<!-- We show the copied table down the original (for testing purposes)
$('#new_table').css('display', 'block');
$('#data-source').css('display', 'block');
});
</script>
<!-- ini data-source -->
<div id="data-source-container">
<table id="new_table"></table>
<table id="data-source">
<tr>
<td>First element.</td>
<td>Second element.</td>
<td>Third element.</td>
<td>Fourth element.</td>
<td>Fifth element.</td>
</tr>
</table>
</div>
<!-- end data-source -->
</body>
</html>
Can someone help me a bit disordering the elements?
Thank you very much, and sorry for my english.
«Prev
Next »
Moderate user : Buitrako
Forum