JQuery :: Get The Original DOM Element From $('#xyz')?
Aug 4, 2010
I have this code which doesn't work with jQuery but works without So, suppose the element in question has id 'xyz'.
Doesn't work:
Code:
doSomthing( $('#xyz') ) ;
Does work:
Code:
doSomething( document.getElementById('xyz') ) ;
The thing is, inside this function no jQuery is used! So is there a way to get the original element from the object returned by $('#xyz') ?
View 8 Replies
ADVERTISEMENT
Jun 16, 2010
If you go on my test site: [URL]... You will see a navigation menu at the top, with an animated ball. Every time you click on one of the links in the navigation menu, you will notice that after a new page is loaded there is a sudden jump from the balls original position to it's new position. (Not that obvious in Firefox but very obvious in IE and Safari) My question is how can I resolve this.
I assumed that wrapping the code in the $(document).ready function would elimate this issue as everything inside it will load before the page contents are loaded.
[Code]...
View 2 Replies
View Related
Jul 31, 2009
When the page loads there will already be a drop-down on the page, here's an example of the drop down.
<select id="dropdown">
<option value="2121S">Option text</option>
<option value="2122S">Option text</option>
<option value="2123S">Option text</option>
<option value="2121A">Option text</option>
<option value="2122A">Option text</option>
<option value="2121K">Option text</option>
</select>
On page load it will evaluate this drop-down and repopulate it determined on their values. If there is an S in any of the values the drop-down will generate an option for 'S' like so.. <option value="s">S Option Text</option> And for the first code example in this post - the Javascript would be able to repopulate the drop-down with the following:
[Code]...
View 10 Replies
View Related
Dec 17, 2009
I have some sortable lists.
I need to be able to drag an element from on list to another but leave the original element in its list and have a copy in the new list.
I tried this;
But it treats el and elcone as the same element.
View 3 Replies
View Related
Aug 19, 2011
how can i know the original element that raised the event if that event is propagated up the tree ?
View 6 Replies
View Related
Dec 17, 2009
I have encoded same javascript file with "Microsoft script encode" and accidentally deleted the original file.There is a way to convert the encoded file into the original version.. The form of the encoded file is : <script type="text/jscript.encode">#@~^.....
View 5 Replies
View Related
Jan 27, 2011
I'm new using JQuery UI and for some reason everything seems zoomed. The calendar appear big, the accordian widget appears big, everything is big. But the original form control don't appear with zoom and the browser has no zoom either.[code]
View 7 Replies
View Related
Jun 6, 2010
jQuery(document).ready(function(){
$( '#nav_Primary > li' ).hover(function(){
alert($(this).find('ul').outerHeight(true));
$(this).find('ul')
.stop( true )
.animate(
{height:'toggle'},
{duration: 600, easing: 'swing'}
);
}, .....
Once you load this up you will see that eventually the hover will not set the height correctly. Keep on hovering on each item and then leaving it before it fully expands and then the next time you go over it it will leave off where the last item had expanded to
View 3 Replies
View Related
Apr 11, 2010
Something I was wanting to do with jQuery the other day was to obtain a reference to the original selector from inside the each function. I was looking through the documentation and for the life of me couldn't come across a suitable solution.I had to use an external variable instead and reference that from within the function, which seems to be a non-optimal solution.
Code javascript:
$('li').each(function () {
// how to reference the $('li') selector from in here
[code].....
View 5 Replies
View Related
Mar 20, 2010
I've got a number of divs with the prefix menu and the suffix where is say 1-10. My code is below. It assigns the click function fine to each, but assigns them all the function based on the last value of the for loop. (It calls the current value, while I want the value from when the code was originally executed to set up the click function). Scratching my head on how to accomplish this.$(function(){
[Code]...
View 2 Replies
View Related
Nov 14, 2008
I'm using this sortable method: [URL] Works perfect! I have one question though: When a certain action is taken by the user, I want to reset the original order of the <li>s in the list. I can't seem to figure out how to do that.
View 3 Replies
View Related
Aug 14, 2010
I have a table which contains multiple rows. The table has an unknown number of columns.
One of the TD's in the row has an 'A' tag containing the HREF property " /_layouts/DocIdRedir.aspx? somenumber" Let's call this TDSource and ASource
A sibling TD in the same row which has a class of ms-vb-title contains2 links- the'A' tagI want to update the HREF property of is in a DIV with a class of ms-vb itx . Lets call this TDTarget and ATarget.
The highlighted components are unique per row. I need to get the HREF value from ASource in each row and update the HREF value for ATarget in the same row.
It's my first day on jQuery - I understand that I can use children() to getthe TR containing the relevant TD's, and I can see how to use :contains() to identify the specific source HREF property, but I can't understand how to link these bits of information together to do what I want.
View 5 Replies
View Related
Oct 8, 2010
I'm using jQuery form plugin, but i want when when user clicks on a button to submit the form using the traditional submit, how can i reset the form to traditional one ?
View 1 Replies
View Related
Mar 26, 2010
The code below is jquery, and uses jquery's extend() [URL] function, but I don't think that the issue has anything to do with that... does it?
$(document).ready(function(){
var obj1 = {
"name": "spud"
,"age":32
}
var obj2 = obj1;
$.extend(obj2, {"location": "UK"});
console.log(obj1);
});
By my reasoning, obj1 shouldn't have location set. But it does. Is the line
var obj2 = obj1;
not making a copy of the original and leaving the original intact? Is it instead making some sort of reference to it? Why is changing the copy having an effect on the original??
View 6 Replies
View Related
Apr 1, 2010
I'm currently creating a simple shoutbox system. The whole shoutbox is in one DIV (shout_box). The DIV shows the 8 latest posts and below that you can enter a new shout / post. I used some script to submit the new post to a PHP page which fetches the data using Post. Then the script displays the message that the post has been added. This works great! However after 5 seconds I want the original DIV contents to reload (the 8 latest posts and the form to add posts. is that possible to do? I think it is, but don't really now where to begin.
I currently got the code below:
var dataString = 'message='+message;
//alert (dataString);return false;
$.ajax({
[Code].....
View 1 Replies
View Related
Oct 22, 2009
I'm having some problem with return value for a function. I'm trying to access google blogger's API to display blog entries on my site. I'm doing this through JQuery and requesting a JSON response. Everything seems to work ok, but I want to access the link for the blog entry. This is a subset of the "entry" object.
It's structured like this:
Entry:
title,
content,
link:
rel,
type,
href,
rel,
type,
href,
I want to get the link where the "link.rel == "self". To do this I have to loop through the link object (5 times). The loop and conditional statement works correctly, but I can't get the variable inside this loop back to my original function.
I have this code:
$.each(data.feed.entry, function(i, entry){
$.each(entry.link, function(j, link){
if(link.rel == "self"){
var postlink = link.href;
alert("link : " + postlink);
return postlink;
}});
alert(postlink);
});
View 2 Replies
View Related
Jan 17, 2010
I use jQueryUI's tabs and when a user changes a form in the tab, it promprts the user that a change has been made. My question is, how do I revert the values before being changed when the user presses 'OK' on my confirm() prompt?
View 1 Replies
View Related
Aug 19, 2010
I don't know if this is a browser bug. I positioned a div at the bottom of the page just underneath the viewport, calculating it with $(document).height() and animate it to bottom:0, works great even when scrolling, cause of updating with the scroll-event. But when I reload this page or scroll down a bit the original position value was used, so it animates to the original viewport value.
View 1 Replies
View Related
Jul 22, 2010
I have a the SimpleModal running on a php page, and on said php page, a varaible is defined; e.g. $var = "John";
and then the usual gubbings for simpleModal, which calls modal_output.php - the file generating the output for the modal popup.
I need to get that $var into this popup, so the popup can read:
"blaa blaa John"
This should be simple, I thought - but I can't parse it through _SESSION, or any method I try. I even tried hacking it into:
$.get("contact_modal.php", function(data){
to read $.get("contact_modal.php?var=<?php echo $var ?>", function(data){
but that breaks the js
Is there anyway I can parse the variable from the original page into the modal popup page?
View 3 Replies
View Related
Oct 4, 2011
So I have a table. With jquery I change border properties of several td. If later on in the code those same td have their background color changed by jquery, their borders return back.
Even if nothing is changed, nevertheless after some time some of the borders would seemingly randomly suddenly show up. I am working on a maze so this really spoils the game.
Code:
if($("crush",xml).text()=='1'){
border1=$("border1",xml).text();
border2=$("border2",xml).text();
[Code].....
View 4 Replies
View Related
Jun 17, 2009
On my site here [url], I am using the coda slider effect I found here [url]. And on the tab entitled "Home Groups", there is a link "Home Group 1", which links to a fancy zoom box that I got from here [url].
But when I click on the fancy zoom text it scrolls the container a little to the right, and on some older browsers it returns to the original first container that loaded from the start.
Any idea where the effects are conflicting? or what code I would have to amend to make it work more fluidly?
View 1 Replies
View Related
Jul 16, 2009
[URL] When I clone a list that is part of a Sortable, the Draggable objects are not bound to the cloned list, only the original one.
View 2 Replies
View Related
Oct 4, 2010
i have a menu generated by a list with nested lists. i want the parent link to stay highlighted when the mouse hovers over the sub menus. because those sub menus are also generated by jquery (qtip), CSS alone won't do it (triedul.topnav li:hover a {background-color: #F00;}).is there a way to do this using jquery?
View 15 Replies
View Related
Jul 23, 2005
I have a site with frames. Like most sites with frames, clicking
links in one frame changes the page in the other frame.
Obviously, if someone puts in the URL for my site, they will get the
"homepage" when they first get there. What I would like to accomplish
is that if they leave my site, and then use the BACK button to come
back, that the site will open with the homepage, not whatever page
they were at when they left. Is that possible using javascript? If
so, how?
My site isn't actually "on the web" yet, so I can't give you a URL.
View 2 Replies
View Related
Jul 23, 2005
I have written a script that highlights a table row when the appropriate checkbox is checked. Using element.style is a bit messy and doesn't really fulfil my needs..
I want to just be able to use className, but when I uncheck a row I am having difficulty restoring the original (when the page loaded)className, I need to do this because the rows have different styles Is their any other way to access the original className of an element?
View 2 Replies
View Related
Jul 20, 2005
Am I correct in assuming that when the starting value of a select list
is re-selected, the onChange command does not execute? I need to have it execute when the original value is selected if possible.
View 2 Replies
View Related