jquery

jQuery DataTables plugin: adding a checkbox dynamically

When adding a row dynamically using jQuery DataTables plugin, what do I do if one of the cells has to be, say, a checkbox? Just put the HTML in quotes? ...

Setting CSS3 gradient properties with jQuery?

I'm writing a plugin that is reliant on CSS3 gradient background properties. I have no problem getting something like this to work: $(this).css({ '-webkit-box-shadow': 'inset 2px 2px 5px #DEDEDE' }); However, this fails to work: $(this).css({ 'background': '-webkit-gradient(linear,left top,left bottom,from(#f4f4f4),to(#FFFFFF))' })...

Filter content from mysql db with checkboxes using jQuery?

Hi all, I'm new to jquery and php and I'm having trouble doing this... I have a php webpage that gathers content from a mysql table. I want to be able to filter through this content with some checkboxes, but have no idea how to create the checkbox jquery code and for it to get the selected or checked results back from the database to d...

Fancybox external controls

I'm trying to use create external controls for Fancybox, or somehow manipulate the controls that exist to look and position how I want them. Here is the page I'm working on. http://bit.ly/a5AGZB At the moment, it's set up to load these portfolio slides via iframe (HTML pages) via Fancybox. I've set the background to be white, and I've ...

Internet Explorer $.ajax / MVC JSON call failing

I have a relatively simple example of an MVC page that is using jQuery to make a POST to get some JSON data and then just show a success/failure message when it is done. The code works perfectly fine in the other browsers but in IE7/8 it seems to fail 4/5 times. Here is the MVC View Page: <asp:Content runat="server" ContentPlaceHolderI...

zoom image effect on image

Looking for a jquery plugin or some jquery script that would do something like on the following page: http://tinyurl.com/2uqojd8 If you roll the mouse over the main image, you can see the zooming of the image etc. Anywhere I could find something that does similar? ...

How to know when an DOM element moves or is resized

I'd like to know if there is a DOM event to listen for that tells me when a DOM element moves is repositioned or is resized on the page. I am not talking about an elements being drag/dropped. An example is if a have a list of three items on a page, and I use JS to remove one of the top two list items from the page (or hide it or whatev...

Making a simple ajax post in jQuery and Ruby on Rails

I am trying to make a Ruby on Rails post via AJAX, and can't figure it out. So close! HTML: = link_to image_tag(current_user.votes.any? {|v| v.votable_id == post.id && v.value > 0} ? 'vote-up-selected.jpg' : 'vote-up.jpg'), vote_up_post_path(post) CONTROLLER: def vote_up get_vote @vote.value += 1 unless @vote.value == 1 @vote....

jQuery validator access from error handler

I'm posting text and have created a remote validator. I've used it now 3 times and I want to consolidate the validator into a specific method. I'm having problems making the data ($("#Title")) and the error handler more generic ($("#editIntroOverlay > form").validate()). Is there a property of the validator object I can access like '...

Turn jQuery into vanilla JS - Insert p element after h1

Any ideas on how I would convert this jQuery to vanilla JS: $('.section > h1').after('<p>This paragraph was inserted with jQuery</p>'); I am new to jQuery and even newer to vanilla JS. This is as far as I got: var newP = document.createElement('p'); var pTxt = document.createTextNode('This paragraph was inserted with JavaScript'); ...

jQuery noob: Auto select checkbox if another is selected.

Hi guys, Basically all I'm trying to do is if one check box is selected by the user, then automatically check the previous box. Each check box has an iterating number id. So for example if checkbox id=3 is selected then auto select check box id=2. Here's my code below: <script> var $j = jQuery.noConflict(); $j('input:checkbox').cli...

Is google adsense breaking my menu displaying ?

Hello, i've noticed a annoying bug. When you navigate on my website, the menu (on top right) acts normally : http://bit.ly/cPcnGA But as soon as you go on a page where is an google adsense ad, the menu appears for 1seconds to 5 seconds, complitely exploded (means that we can see all the subsmenu) Example here : http://bit.ly/971vMl ...

Simple Modal on a hidden div

I want to have a hidden div on the page with the elements of a SimpleModal dialogue, but when I set the CSS visibility to hidden and fire the modal, it is empty. How can I use a DIV in this fashion without making it visible on the page? ...

jQuery to PHP and back again!

I'd like to pass content back and forth from PHP to jQuery and vice versa. I'm not sure if I fully understand the best way to go about this and am hoping for some best advice and clarification. Below is an example of something I'm trying to do. The PHP lists the files in a directory (whose path is passed to it from jQuery), stores them ...

Variable not being updated on button click?

Hi everyone, I'm making a simple jQuery script that will allow you to change something on the click of a button. My problem is that if I change the value (checked), and then click the submit button, it will recognize it as the default. If you do this on the default, it is set to off, so if you check it off (turn on) and then click the su...

jQuery: get the type of an Ajax response

I need to make an Ajax request, but its response may vary and it's decided on the server side. Is there any way to know what type the response is? It may look similar to: $.post(url, pars, function (response, type) { if (type=='json') ... if (type=='html') ... }); Thanks ...

Does display: none affects SEO on a navigation menu ?

Hello, i want to know if using display:none (via CSS) on a menu will affect SEO (make it less efficient) than using only display:none (via jQuery) Thank you ...

How can I highlight every single word in jquery so that I can provide a definition for each word?

What I am trying to do is allow the user to scroll over any word on a web page and when the mouse goes over the word it is highlighted (I know I can use hover for that). However I do not know how to select individual words, from the paragraph. The ultimate goal is to allow the user to click on the word and a definition appears over the...

jQuery Ajax returning 404 Error, but correct Response

I'm posting some data to a PHP script via jQuery AJAX, and everything executes correctly, but it returns a 404 error. In my Firebug console the response from the PHP script is correct. I don't understand how the script can respond, and it is still throwing a 404 error. The jQuery "error" callback method triggers, and the "success" met...

"Smart" text area auto indent

I'm attempting to make an auto-indenting textarea and so far it works with the following code. The problem that I'm having is that I'm currently preventing the default action of pressing enter in order to calculate the tabs in the line, and then inserting the newline afterwards. This works, but I want to have the default action of the t...