jquery

.attr("href") with links containing commas

Hay i have a link like this index.php?sometext=f,fsdsd,rerw,e,wewewe and when i use .attr("href") on the link, it stops at the first comma, so it only displays index.php?sometext=f Any idea how to get ALL the href value ...

Keep Tipsy tooltip from fading out when mousing over

Hello, I want to use the tipsy tooltip as a toolbar. When hovering a link I would like the toolbar to show, let's say a div, and when entering the toolbar area I want it to stay visible, not hide. So my questions are: How do I show a hidden div? How do I keep the tooltip visible when entering the tooltip area? ...

Suggestions on making this bit of Javascript code sexier?

I'm trying to make a way to add functions under a specific namespace (dpcom). This may be in dot notation depending on what the user did in their javascript file. So basically, what I want them to do is something like this: dpcom.library('something.foo.funcName', function() { // Code goes here. } They can then call their stuff la...

use jquery to ad ids to dialog buttons?

i can't seem to add ids to the buttons in a jquery created dialog. i can select the buttons after the dialog is declared via selectors as follows: var buttons = $("#dialog").siblings(".ui-dialog-buttonpane").find("button"); but when i try to do: buttons[0].attr('id', 'someId'); i get: TypeError: Object #<an HTMLButtonElement> h...

jQuery.find() ignores root node

My jQuery object looks like this: var myJq = jQuery("<div class='a'></div><div class='b'></div>") myJq.find(".a") returns an empty jQuery object, apparently because find() searches only the children of the nodes contained in a jQuery object, not the nodes themselves. How can I grab one of the divs in myJq using a selector? ...

How do I force a blur event to occur in JavaScript?

Here's what I want to do. I want to trigger an event every time a select element changes. I have a multiline select and when I make changes (click on elements), it does not change until the select box loses focus. So I'm trying to force a blur every time the select box is clicked. That way if it changes, it will trigger the changed e...

jQuery combine statements?

How can I simplify these statements, instead of having to count all the way upt to 34 and having 34 separate statements….. $('a#timeline-2010-lnk1').click(function() { $('#timeline-2010-1').show(); return false; }); $('a#timeline-2010-lnk2').click(function() { $('#timeline-2010-2').show(); return false; }); $('a#t...

use jquery .tabs() - content overlay page

I am VERY new to JQuery. Just trying to get a feel. I like the tab feature demoed here: http://jqueryui.com/demos/tabs/#mouseover I really like this, however I would like it to act a bit more like a Menu. Particurally I would like the tab content to apear OVER the content on the page (like a menu). Also, just as when I rollover the tabs...

jQuery plugins abuse

Possible Duplicates: Why build Javascript functions as jQuery plugins? Am I using too much jQuery? When am I crossing the line? I am trying to learn jQuery & front-end technologies in general. Right now my point of focus is jQuery. The framework has some really awesome plugins. But at what point does one consider the need fo...

how to get the element selected

The dropdowns on the top right, I need to get the first three characters of the string of the type selected for example if the user selects Pizza Delivery i need the string "piz" here is the url <div class="select-big select-small right"> <div class="select-holder"> <div class="button"> <div class="icon left"></div> <p class="text ...

ASP.Net ListBox values not posting changes after jQuery manipulation?

Hi everyone, I have an ASP.Net page with two ListBox components, rendered in the browser as <select> lists. I'm using jQuery to move elements from one list to another by manipulating the DOM. I then select all elements with the mouse and postback the form. That way, all the list elements are posted with the form. When I submit the ...

How to fade out a tab and replace it with another one, without removing either from the page?

I'm trying to design a tab control which will fade out the current content and replace it with new content, as can be seen here: http://jsfiddle.net/XcMuL/ The problem I'm having is that when you click between the two tabs, you can see a bit of a flicker where one tab fades out and and the other fades in at the same time, and for a brie...

JQuery method to get one node - rather than find();

I've been googling this for an hour and can't seem to find the answer. I'm using $(xml).find('title') -- but it seems to be returning all the "titles" in all nodes. How do I just grab the title within the root node? <response stat="OK"> <title>Some Document</title> <menu> <item> <title>Some Title</title> ...

How to edit 'onchange' attribute in a 'select' tag? (using jquery)

I'm trying to edit the 'onchange' event of an existent 'select' element. For example purposes I have the following code: <select id="sel_id" onchange="javascript:foo();" > and whenever I try to change its 'onchange' attribute I was using the following: $("#sel_id").attr("onchange", "foo_2()"); FYI, this code which should be f...

jQuery combine statements? (follow up)

Thanks for the help on my previous post, @AndyE, your solution works great. now for my follow up, same idea, different function(s)...i tried to implement your previous solution, but couldnt get it to work right...: $(document).keypress(function(e) { if (e.which == 27) { $('#timeline-2010-1').hide(); $('#timeline-2010-...

Handle elements after innerHTML or html(). Javascript.

I'm adding new element through html() function of jQuery. Then I want to handel it. Is it possible to do that in way you see here? $("#renamePlaylist").click(function(){ var aa = '<input type="text" name="plst_name" value="'+$("#playlist_header").find("span").text()+'" size="'+Math.round($("#playlist_header").find("span").text()....

jQuery: Wrap only first and second child, not the rest of children.

In my actual code: <div id="mother">     <div id="child-01"></div>     <div id="child-02"></div>     <div id="child-03"></div> </ul> I need to produce: <div id="mother"> <div id="myWrap">     <div id="child-01"></div>     <div id="child-02"></div> </div>     <div id="child-03"></div> </ul> I was playing with wrap, w...

multiple css rules or jquery

here is some "normal" code for sprite menu #menu li a { background:url('../layout/menu.jpg') no-repeat; display:block; text-decoration: none; width:100%; height:100%; } #menu li.m1 a{ background-position:0px 0px; } #menu li.m1 a:hover{ background-position:0px -55px; } #menu li.m1 a.selected{ background-position:0px -55...

jQuery will not return data after upgrading to new jQuery version

I upgraded my jQuery version to 1.4 from 1.3. My code worked fine in 1.3, but it doesn't in 1.4. What can I have done wrong? function add_product_to_shopping_cart( product_id ) { $.post("/actions/etrade/add_product_to_cart", { 'product_id': product_id, 'variant_first': $('#main_variant-'+ product_id ).val(), ...

How to compare height of nested divs?

I got 2 divs, one inside another. <div id="ads_content" class="ads_contents"> <div id="ads_text" class="ads_text"> ... text contents ... </div> </div> ads_content div has max-height of 230px, and it has overflow: hidden. So there will be shown a definite amount lines of text from ads_text div. I need to compare their ...