jquery

How can i store a bunch of jquery commands in a function that i can call with click event.

Currently i have this: $(".splitCol").click(function () { $.cookie('whichColumn', 'split'); $(".threeCol .active").removeClass("active"); $(".leftCol .active").removeClass("active"); $(".splitCol span").addClass("active"); $(".threeColumns li:eq(3)").removeClass("first"); $(".threeColumns li:eq(6)").remo...

Jeditable not working with Jquery sortable

I was using Jeditable(with type autogrow) for editing text within a div which has similar siblings. Then I used Sortable for all the siblings and then jeditable wont cancel edit when click outside. Really in a pickle as I need sortable functionality and dont want to lose the editing. Edit: Also, once I click to edit a text, It will not...

jQuery load() from within ajaxComplete() callback causing multiple loads

Hello, I've been staring at this one for a while and I'm completely stumped. You'll need firebug for this, take a look at the AJAX requests. They seem to be multiplying after each click of next and previous, until it's too slow to load entirely: http://www.ftsdev.com/freegreen/virtual-tour-prototype/virtual-tour.html All the JavaScrip...

jQuery: child-element disappears with $('.parent_class') opacity effects in IE

I have this html: <div class="foo parent"> <div class="child"></div> </div> with some css: .foo{ position:absolute; left: -117px; background:#000000 none repeat scroll 0 0; color:#FFFFFF; z-index:8; } .parent{ top:23px; width:100px; height:30px; ...

Close windows or tabs on a button click

Hello, I have a tab open in my browser which runs my web site. Upon clicking on a button, my site is going to open other windows or tabs with different URLs in each. <form action="search.php" method="get"> <input type="text" name="item" size="30" style="font-size:140%" id="item"> <input type="submit" value="Search All" style="f...

Use AJAX to populate page after page loads using jQuery

I would appreciate any help on this issue. Lets say I want to load controls for different items on the page AFTER it has finished loading. So: Object 1 <div id="controls1" class="controls" item_id="1"></div> Object 2 <div id="controls2" class="controls" item_id="2"></div> Object 3 <div id="controls3" class="controls" item_id="3"></d...

jQuery not working in AJAX Loaded page

I am using jQuery to load a page by AJAX using $.ajax (suppose test.html).Its a simple HTML document with a few buttons and associated animations upon clicking them (also using jQuery).The .click() properties associated are working fine when I load the page directly but the buttons fail to respond when I click them in the AJAX loaded ver...

Initially hiding a display:block to be shown with jquery.show()

I am trying to get better about minimizing any unnecessary markup and using optimal CSS. <label id="cart_promocode">Promo-code: <span><%= Html.TextBox("PromoCode") %> <a href="#" id="lnkApplyCoupon" class="hidden">Apply Coupon</a> </span> </label> The 'Apply Coupon' link should be positioned underneath the textbox. This...

Closing windows that were opened by search query

Hello, Please go to http://musicalinstrumentsfinder.com/search.php The top search box is a super search box if you will in that whatever text you type in it will automatically be put in the individual search boxes below. Also, upon clicking the "Search All" button, it will automatically simulate a click on all the individual search box...

jQuery framework internals

Hi I am trying to understand the internals of how jquery framework is written and finding it hard to understand the code. Does anyone have any suggestions regarding a good way to get started. Thanks for all the useful input. Editing the topic since I had limited space for adding individual comments. I have written a lot of basic java...

resizable jquery chrome

Hi All, I have a problem that i want to make an element draggable and resizable both. Even after dropping the tag it should be resizable. Some Sample Code function DivMouseDown(id) { try { jQuery('#'+ id).draggable({ opacity: 0.5, revert: 'invalid' }); } catch (e) { alert ("exception in DIVmouse down: "+ e); ...

How to create multiple instances of show/hide div in jquery?

I have the following code $(document).ready(function() { $('a#slick-toggle').click(function() { $('#slickbox0').toggle(400); return false; }); }); <a id="slick-toggle" href="#">Show/Hide</a> <div id="slickbox" style="display: none;"> hidden content here </div> The problem is, if there is more than 1 instance of this on the ht...

Problem with strings in c#

Hi guys , in the following code This is what i do , private Speed string[] { get; set;} internal speed duration.slow public setspeed { get { return speed } set { speed = value; string temp = "{ duration :"+speed.tostring()+"}"; this.Speed = new string[] {temp}; } } the properties are all appended to the script in terms of "atribut...

"UnHover" Moved Elements with jQuery

I'm using jQuery to move an element to a different position on the page when I click on it. The element is in a "hovered" state because the cursor is over it when I click it. When the element gets to it's new postion it retains it "hovered" state. How can I clear it? ...

Retrieving xpath of the selected text in browser

I want to retrieve the xpath of the currently selected text in a browser. Using JavaScript I am able to get the selected text, but was not able to get the xpath. I can find the xpath manually using Firebug, but I want to do it programatically. Is it possible to do it? [EDIT] Okay, found a pointer to the solution in this thread. Modifie...

jQuery readonly attribute problems

I have this <input type="text" id="tbox" name="tbox" readonly="readonly" /> I have a button on which I do this $('#tbox').removeAttr('readonly'); I've also tried doing this $('#tbox').attr('readonly', false); .. but none work.. ...

Array of IDs - how to select with JQuery?

I have an array of element identifiers, coming back from some server-side validation. The IDs aren't prefixed with a '#'. Rather than going through the array and prefixing a # to each member, is there jquery means of directly selecting all elements by their IDs? ...

Selecting elements in jQuery

In continuation of the question at this link I wanted to add some functionality in test.html The event trigger is 'clicking' on any <p class=""> tag. After clicking I wanted that particular <p> to disappear (which was fairly straightforward) but I also want that If out of the three either one or two <p> are hidden, then "Hide 'em" butt...

JavaScript/jQuery method to find base URL from a string

I'm trying to find a relatively easy and reliable method to extract the base URL from a string variable using JavaScript/jQuery. For example, given something like: http://www.sitename.com/article/2009/09/14/this-is-an-article/ I'd like to get: http://www.sitename.com/ Is a regular expression the best bet? If so, what statement could...

jQuery CSS bug in IE8

I have a bug in IE8 when trying to get a property from css for an element with background image. el.css({ 'background-position': "10px 10px"}); //set some alert(el.css("background-position")); //get the value In Opera, FF, Chrome, Safari works I get "10px 10px". Not in IE8 where I get undefined. I opened a bug report, but until then ...