jquery

Looping in jQuery

I am tring to loop loop a jQuery command 5 times. Here is my code: for(var i = 0; i < 5; i++) { $("#droppable_"+i).droppable({ activeClass: 'ui-state-hover', hoverClass: 'ui-state-active', drop: function(event, ui) { $(this).addClass('ui-state-highlight').find('p').html('Dropped!'); } }); ...

Jquery inside modal box function

I use next function to build Modal box. And I need jquery combo box inside that modal box. function launchModal(id) { jQuery('body').append('<div id="catmodal" title=""><select id="ac_s1"><option value="Home Security"></option></select></div>'); jQuery('#'+id).dialog({ resizable: false, height...

Convert javascript array handling to jQuery

Hi everyone I'm doing a javascript assignment and have just learned that I can do it in jQuery if I wish, rather than vanilla javascript. I thought I'd give it a go to see what it's like. This is the contents of my javascript function: rowsArray = $("#Table1 tr"); for (i=0;i<rowsArray.length;i++){ numSeatsInRow = rowsArray[i]...

jquery validation

Hi, i am using jquery validation as follow var validator=$("#myform") .validate({ rules: { field1: { required: true }, field2: { required: true }, field3: { required: true }, field4: { required: true } } }); field1, field2 are in tab0...

Get the "alt" attribute from an image that resides inside an <a> tag

this should be fairly simple but for some reason, it doesn't work. I want to get the "alt" attribute from an image that resides inside an tag <div id="album-artwork"> <ul> <li><a href="link to large image"><img src="thumbnail" alt="description of the image" /></a></li> ... </ul> </div> $("#album-artwork a").click(function(e) ...

Why isn't my jQuery plugin loading in webkit browsers?

I'm using the Galleria plug-in. It works perfectly in Firefox and IE 7/8 but just completely fails in Chrome/Safari. The JavaScript doesn't even kick in, you can tell by the fact that it's not surrounded the #gallery div with the extra #galleria-container divs like it normally does. Literally nothing happens, I've checked the resource tr...

JQuery Text Resizing not working with IE

Hi I am using the following script (that requires the cookies plugin for jquery) to allow javascript enabled users to change the font size on a medical charity website: var sitefunctions = { textresize: function () { var $cookie_name = "TextSize"; var originalFontSize = $("html").css("font-size"); //...

Jquery JCarousel Auto enabled updating external controls

Hello, I have a JCarousel that uses external controls (little buttons underneath the carousel to match the currently active carousel item...e.g. if your on carousel item #3, then the third button underneath it is in an active, or highlighted state). My problem lies in the fact that I have enabled "auto" within the carousel with a 3 se...

Wrap anchors in list tags in jQuery

I have some code like this: <div id="gallery"> <a href="#">link</a> <a href="#">link</a> <a href="#">link</a> </div> and I want to rewrite it using jQuery to produce: <div id="gallery"> <ul id="carousel"> <li><a href="#">link</a></li> <li><a href="#">link</a></li> <li><a href="#">link</a></li> ...

Target tabs within tabs with #hash URL (or otherwise)

I am using the jQuery Tools library Tabs. You can find them here: http://flowplayer.org/tools/tabs/index.html My basic markup is something like this: $("#tab-holder ul").tabs("div.tab", { history: true, api: true }) $("#profile-sub-tabs ul.menu").tabs("div"); The #profile-sub-tabs is another tab interface within the main #tab-holder ...

Sliding box with caption

I have a sliding boxcaption and it works fine. But when you first view it has the box caption over it and then when you mouse over it works properly but it starts off with the caption on top. And I want the box caption only to show when the user mouses over the box. I cant figure out why it does that. It's kind of odd. Take a look at i...

Using jQuery in place of document.getElement

I would like to use $("#fooid") in place of document.getElementById("fooid") because I'm getting the id with the # in front of it. While you can remove it easily enough, there is a fair amount of intermixing between when I'm using a jQuery selector and when I'm using native DOM calls. In particular this is being called inside a cha...

Help in jquery validation.

I am using jquery validation plugin to validate my form on client side. I am adding a new method using addMethod function for every HTML control which have regex (custom) attribute. My HTML control would look like. <input type="text" id="txtInf" name="txtInf" regex="some regular exp" error="check your inf"></input> $("*[regex]").each(...

Detecting the clicked links after ajax load in Chrome using $("a:focus")

I have a page which has a list item, and each item has a delete button. Clicking the delete button loads the child page (delete.asp?id=123) in a hidden div. delete.asp has a javascript alert (on document ready) which successfully fires when the button is clicked. It also has $("a:focus").hide(); which removes clicked link. I can't seem...

Conflict with ajax while using with Jquery

hi i am using jquery tab in my page. but while using update pannel both tab will appear in same page. this occures after a post back.. is any problem is there for using jquery and update pannel together? How can i overcome this? ...

Setting defaults for JQuery UI datepicker on whole site

I'm working with a site with the JQuery UI datepicker displayed on a lot of different pages. We have a certain set of features we'd like the date picker to use for all pages - the same date format, the same icon, etc. What's the best way to set these items as the default for the datepicker() function, rather than have every call to d...

using jQuery to add and remove textbox with unique IDs

I wrote a function to add listitem with a text box and a remove button, everytime the add button was clicked. i'm also adding a unique id to each new element by adding a number. the problem happens when i try to remove an element, then add another one, sometimes that number is being duplicated. ex: I add 4 li's and decide to remove #3...

Retrieving the dateFormat from jQuery UI datepicker

Hi, I would like to retrieve the dateFormat from my datepicker default set up declaration like so: $.datepicker.setDefaults({ constrainInput: true, dateFormat: 'dd/mm/yy', gotoCurrent: true, hideIfNoPrevNext: true, minDate: '-1y', maxDate: 0, showOn: 'both' }); Is there a way to retrieve this information? ...

Strip slashes that jQuery adds when returning HTML via ajax?

I am using the jQuery ajax method to get data from the database and return the data via a json object. However one of the values in this json object is an HTML string. I am basically doing exactly what is seen here except I need to know how I can remove the slashes that jQuery is adding to the HTML string. Any ideas? Example json.HTML ...

Creating interactive ajax javascript widgets in ruby / rails

Looking to create interactive javascript widget using ruby-on-rails that can be placed on any website. I am able to create a basic widget. Its fairly straightforward (eg. using document.write) This works fine for taking data from my server and putting it into the widget but its very static. But how do I create something more dynamic ...