jquery

jQuery : selector question (stylesheet class)

hi all, how can i select items with a classname that contains spaces? like <a href='button normal'> thx ...

jQuery is only returning first item

For some strange reason, whenever I have a selector and expect to get multiple items, jQuery is only returning the first item, instead of the entire collection. This is the HTML I have: <a id="reply-424880" class="reply" href="#" rel="nofollow">Reply</a> <a id="reply-424885" class="reply" href="#" rel="nofollow">Reply</a> And the sel...

jQuery: Animated header

I'm looking for a jQuery plugin that can help me with the following: I have a list of images I want to use for my header but they are pretty big (height especially) and I don't want to resize them to fit my small header div. What I'd want is a plugin that allows the images to start at the bottom of the div (or rather the top of the im...

Callback for When jqGrid Finishes Reloading?

Hi, I am using the jqGrid plug-in and at one point I need to refresh the grid and set the selected row to match the record that I am showing in detail on another section of the page. I have the following code but it does not work: $("#AllActions").trigger("reloadGrid").setSelection(selectedRow); The selectedRow parameter comes from an...

CodeIgniter: json_decode array issues

On my client side I'm sending an ajax request with jQuery in the following matter: $.post(script.php, { "var1":"something", "var2":"[1,2,3]" }, function(data) { }, "json"); On the server side, in the CodeIgniter's controller I'm receiving the values like so: $var1 = trim($this->input->post('var1')); $var2 = trim($this->input->post('v...

Is there a way to cut and paste or clone CSS from one element to another using JQuery?

I have a situation where I'm wrapping an image with a span and I want to remove all the CSS from the image and apply it to the span. Is there a way to do this with JQuery? JQuery: $(img).wrap('<span />'); Style Sheet: img { border: 5px solid red; padding: 10px; … needs to allow for anything } I would like to do this with out editi...

Using jQuery to make a group of images appear in order.

I have a page that shows a bunch of thumbnails (around 30), and the client is wanting them to appear one by one, in order, going from left to right on the page. This is what I've tried: var start_opacity = 500; $j('.grid-photo').each(function(i) { start_opacity = start_opacity + 500; setTimeout(function() { ...

jQuery UI, setting two handles calling only one function

I'm having a bit of trouble using the slider in the jQuery UI API. I'm using a slider that has two handles, and I want to change them both manually. I would go about doing this in two steps, one for each handle; $('#slider-range').slider('values', 0, 1000); $('#slider-range').slider('values', 1, 2000); The problem with this is that e...

Jquery click and append dissapearing

When this fires I see the added li for a split second and then it disappears.... What gives? Using jquery 1.4.2 $(function(){ $('a#add_phone').click(function () { $('<li>Test</li>').appendTo('ol#phones'); }); }); Ok so this works in a blank page, but this is in the context of a rails 3 app. Must be something in there, althou...

jQuery: Trouble with draggable across cloned elements

I'm trying to implement: User drags a draggable li to a droppable li. The original li is no longer draggable A new li is cloned from the original li, and is appended to the droppable li. I can't get it to work. function moveToTerm(original_course, helper, term) { var cloned_course = original_course.clone(true); original_course.a...

jquery binding multiple events, and pass data

I know we can have this in 1.4: $("a").bind({ click : clickFn, mouseover: mouseFn }); and that is nice and i would like to use it, but it seems like there is no way to pass extra data to events bound this way, it needs to be done the 'old way': $("a").bind("click", {"some":"data"}, clickFn); Question: how can i pass the extra d...

using jquery $.ajax to retrieve data and push data into javascript array through the success function? HELP!

Hello All, I have a function that I'm trying to retrieve values using $.ajax and push the returned data into an array called output. Problem is the success function will not allow me to push the results into the array. see below for code. var getValues = function(el) { ...

Is it possible to reference object within the same object?

I've been messing around with jQuery plugin code and I'm trying to put all of my common variables into a single object for easy access. I have included a few examples below on how I've done this, but I'm wondering how others deal with this problem. Lets say I have this var x = function(options){ var defaults = { ulist : $('ul#list...

Why the Markitup BBcode preview doesnt work for me?

I dont know how to make works BBcode preview on Markitup Editor. I followed all instructions and the editor is working but i really dont understand what to do to make the correct preview appear, actually I can open the windows preview but i cant get the html code. I had download the parser file (markitup.bbcode.parser.php) and settled t...

Divs don't toggle

I have following divs on my page <div id="rpttimeline">div 1</div> <div id="rptareaview">div 2</div> <div id="rptgalleria">div 3</div> <div id="rptremainingwork">div 4</div> <div id="rptremainingspec">div 5</div> <div id="rptremainingreq">div 6</div> <div id="rptremaininguserstory">div 7</div> Initially through css I have the f...

Google/Bing maps drawing library

My company wants to use Google/Bing maps to map out our sales territories. I would like a jquery (or silverlight or something) plugin/library that would allow an ordinary user to draw and manipulate shapes on Google or Bing maps to draw out our sales territories. Then I would like to export this information as KML or something similar. I...

iFrame Access Problem

Hi Guys, I have data in a iframe. When a user performs an action - I want this want this data to be collated and sent "inside" another iframe inside this iframe. I have having a bit trouble achieving this and was wondering whether its possible and if it is, how I can do it ? Thx ...

loading javascript file after jquery.ready

I want to load a javascript file at the end of jquery.ready so that the code in my ready handler doesn't have to wait to execute until this large javascript file is loaded. My jquery.ready code doesn't rely on this javascript file at all. Would this be a good way to do that? $(function(){ ... ... $('head').append('<...

jquery validation stops page submit when non required field is empty

I'm using jquery to validate an asp.net form (content within a master page). The required fields validation all works great, but I have a field that is not required, but if it does have text then it needs to be in the proper format. Jquery validates incorrect text just fine, but when the text is empty it stops the form from submitting (n...

How to resize a Flot graph when its containing div changes size

I'm using the Flot graphing library jQuery plugin and I haven't found a good way to handle resizing the graph when it's containing <div> changes size (for example, due to window resizing). When handling the onresize event, I've made sure that the width and height of the containing <div>are updated to the correct size and then tried call...