jquery

jquery dynamic toggle button

Using jQuery, I'm trying to make a quick & dirty way of changing the innerHtml text of a control button (#ctrlBtn) to reflect the state of div's slideToggle() using the html() method. I can't seem to get my head around it. It changes the button text on the 1st click but then that's it... here's the code: <script type="text/javascript">...

How can I simulate a click on a jQuery UI radio button?

I have some radio buttons <div id="typeRadios"> <input id="character_chartype_a" name="character[chartype]" type="radio" value="A" /><label for="character_chartype_a">A</label> <input id="character_chartype_a" name="character[chartype]" type="radio" value="B" /><label for="character_chartype_b">B</label> </div> that I turn int...

Delegate handler and inner children clicked

Hi, I have the following: <ul id ='foo'> <li><p>hello</p></li> <li><p>hello</p></li> <li><p>hello</p></li> </ul> $('#foo').delegate('li', 'click', function(event) { var target = $(event.target); console.log(target); }); the click handler gets called whenever one of the inner p elements gets clicked, as well as...

In Firebug, $ == jQuery returns false, only sometimes

Okay, I have this weird problem in Firefox. I type in Firebug's console $ == jQuery Sometime it displays true, and sometimes false. The file is just an empty HTML document with one script tag including jQuery. I refresh the page, click "Run" in the console, and again, occasionally it returns true, occasionally false. On the occasi...

How to select the <tr> which holds the <a> andchange the color

Hi All, I have a table structure: <table style="width: 100%;"> <tr> <td> <a href="#" class="xx">one</a> </td> <td>Two</td> <td>Three</td> </tr> <tr> <td> <a href="#" class="xx">Four</a>...

$.ajax({url:link}) and Jquery UI Droppable

I have a problem. I drop element into #projectsActive. New element have been created there. Old element have been deleted with fadeOut But ajax query sometimes isn't running. What's the reason? $("#projectsActive").droppable({ drop: function (event, elem) { var e = elem.draggable; var linkToSend = "/Projects/Pu...

Showing one text box value in another text box while user type the value to the text box

Hi Guys, Is there a way to get the value from one text box and add it to another using jQuery dynamically when user is typing the value to the text box? can someone please explain the method if there is any such thing? regrds, Rangana ...

Using jQuery UI Tabs with a custom HTML Layout

The markup required by jQuery UI Tabs is like following... <ul> <li>Tab1</li> <li>Tab2</li> <li>Tab3</li> </ul> <div> Panel 1 </div> <div> Panel 2 </div> <div> Panel 3 </div> That is good enough in some cases, but in other cases where SEO and usability are top priorities, this markup is not the better. I would have working...

jQuery drag & drop works in html

Does jQuery drag & drop functionality work on HTML as well? I used button tags and used same drag & drop jQuery function to get it work. But unfortunately it does not work? Is it possible to call drag & drop functions for HTML buttons? I would be glad if you can help me. Here is the code that I used for that. alert("inside script"); $(...

How to share contents of a web page with social Networks and bookmarking them in on-line bookmark services??

Hi, I'm Looking for a free(or Open Source) Sharing Script to put it in my content pages(I do ASP.net). I want to allow my visitors to share contents(ex: articles) in social networks like Facebook or on-line bookmark services like google bookmarks. what's the best way to do that? i found JQUERY SHARING(you can see demo here) Plugin from t...

Jquery - live('hover') and mousemove

Hi, i have a little problem with the hover funtion with mousemove. But what is wrong? working example -> http://www.jsfiddle.net/V9Euk/306/ $('.tip').live('hover', function(e) { if (e.type == 'mouseover') { $('#'+this.id+' .tooltip').show(); } if (e.type == 'mousemove') { alert('move'); $('#...

jQuery sortable on contenteditable items

If I do "jquery sortable" on a contenteditable items, the item would never be editable. I should mention that in IE every thing works fine and i have this problem in FF 3.6.8 <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleap...

Stop jquery queuing events.

So, I have this demo site up: http://webspirited.com/ha2/ If you hover over the main header (not in ie). You will notice that the image changes a bit, This is what i want. However the keen eye will notice that if you hover on-off-on-off-on-off it will queue the events. How do i stop it from doing this behavior? ...

Function is not defined when appending a url parameter

Hi, I'm using Zend Framework and on one of my forms I have a ZendX JQuery form element. When I run the action that instantiates the form like this: .../controller-name/action-name the form element works fine. But when I append a parameter to the url, i.e. .../controller-name/action-name/parameter the form element does not wo...

jQuery: if click again, hide.

Right now you click on a link, it send ajax call and on success it prepends the output in . Not i would like to, if you click on the link while its open then it should close/hide the output. function MoreFriendOptions(friend){ $.ajax({ type: "POST", url: "misc/GetMoreFriend.php", data: { mode: 'ajax', friend :...

Updating JQuery UI Progressbar inside Updatepanel

How can I use JQuery UI Progressbar inside Updatepanel? When I try to do the following, progresbar is not being updated when it's inside updatepanel. <script type="text/javascript"> $(document).ready(function() { $("#progressbar").progressbar({ value: 0 }); $("#progressbar").css({ 'background': 'LightYellow' }); $("#progre...

how to get next relative dropdown using jquery

i have this code <div id="aggregate" style="display:inline"> <%=Html.RadioButton("a", "1", true, new {id = "meRadio"})%><label>Me</label> <%=Html.RadioButton("a", "2", false, new { id = "teamRadio" })%><label>Team: </label><% = Html.DropDownList("Teams", Model.Teams, new {@scope="Team", @id = "t...

A bug in encoding while storing html-based blog posts using php and jquery

I am writing a code to post html-based blog posts through jquery/ajax to php to amazon s3. I first urlencode the post with this function from php.js - http://phpjs.org/functions/urlencode:573 then send it to a php which stores the content as is to s3. If i read this file naked, it looks fine with slashed for special characters like " '...

jquery animate scroll not working inside iframe! :S

I am making an iframe facebook application. When I had it running as a normal website this: $('html,body').animate({scrollTop: $("#"+id).offset().top},'slow'); worked fine. Now it is inside the facebook iframe and the iframe is resized to fit its contents. As a result there is no longer a scroll bar on the iframe and to navigate you ...

jQuery: appendTo either elements

Is there a good way to .appendTo either one element or the either depending on if it exists in the DOM? So for example ideally I would like to do ideal method 1: .appendTo($('#div1') || $('#div2')); not so good method 2: var div1 = $('#div1'), div2 = $('#div2'), e = div1; if (!div1.length) e = div2; .appendTo(e); Of cou...