jquery

jQuery doing things in an order

Hi All How do I get things to run smoothly and in order based on my actions. ie var $content = $("#content"); $content.slideUp().html(''); $conten.html(from_my_ajax_request).slideDown(); Basically I have done an ajax request to place the content of div #content. But running the above I can see the code come in but the slideUp doe...

Jquery UI Datepicker on an image

Greetings, I want to pop up the Jquery Datepick as the image is clicked and displaying next to it. Once a date is clicked, I want to post my form. Here how I try this: The HTML: <form id="myform"> <span class="quickgo"> Quick Go: <select> <option value="1">Discovery Channel</option> <option value="2">History Channel</option> </select...

Jquery Fancybox

I use fancybox to zoom in images, how do I count the image views? ...

Is there a way to manipulate the mouse position with jQuery or javascript

Hi. I have a slideshow that opens when a thumbnail is clicked. Now I would like to know if there is a way to re-position the mouse with jQuery over the control elements of the slideshow? ...

Jquery call predefined functions?

All of the tutorials I see online are defining functions on the fly to respond to event handlers. I am trying to call a JS function when my form is submitted, but it never works quite right. In PHP: echo "$(document).ready(function() { $(\"#newDate\").submit( ValidateForm('".$ID."') ); });"; When the user hits enter for the input fi...

jquery ui autocomplete - not working in IE

This code works in firefox but not IE. Any ideas? I'm using the latest jQuery-ui libraries. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>jQuery UI Autocomplete Remote datasource demo</title> <link type="text/css" href="jquery.ui.all.css" rel="stylesheet" /> <script type="text/javascript" src="jquery-1.4.2.js"...

What is the correct way to save hidden data on a table?

I use the jTemplates plugin to load data on my tables. Because there are some properties I do not display yet I want available for later use, I save them in hidden fields and then grab them by their CSS's class name and jQuery's siblings method. Is this a correct way of doing such operation, or would this be considered terrible code? <...

how to get file name on perl of windows popup?

I'm using json to open the user popup. I used to use basename( $_FILES['userfile']['name'] ) on php, how to do that on perl? Server side code: #!/usr/bin/perl use CGI; print "Content-type: text/html; Cache-Control: no-cache; charset=utf-8\n\n"; @allowedExtensions =("jpg","tiff","gif","eps","jpeg","png"); my $q = CGI->new(); my $...

Replace html array notation var with loop value jQuery

I'm trying to replace the [2] in the name values of the hidden fields with a new value within a loop. The 2 could be any number and so I won't necessarily know it when I'm looping. What would be the best course of action in replacing it? <input type="hidden" class="pid" name="t[2][p][149][id]" value="ID"> <input type="hidden" class="pan...

jQuery ajax call: " turns out \"

Hey, i noticed when my ajax response (msg) gets prepended and toggled, if it contains " or ' it turns out \" and \'. How can i fix this? ...

jQuery, discover what a dom object's class are

I have a .click() on several buttons. Each .click() calls a function. The function needs to know which button called it so that it can show or hide different content and change the styles of the other buttons. The function has an event object passed to it. Is there a way I can get the current class that the event object has? ...

Jquery dropdown loading content

I'm trying to find some jquery that will allow me to use a dropdown to load specific content on the website. Specifically we have some documents that are state specific. I'd like the drop-down to have the states listed. The user will select their state and then view their state specific docs. There will only be a few states, so there...

Adding dynamic parameters with Html.BeginForm and jQuery submit

// html <% using (Html.BeginForm("MyAction", "MyController", new { id = ViewContext.RouteData.Values["id"] }, FormMethod.Post, new { enctype = "multipart/form-data", class="myForm" })) { %> <input type="file" name="blah" /> <% } %> // script $container.find('.myButton')....

Get height of image inside a hidden div

Hi, i want to to get the height/width of an image inside a hidden div-containter, but .height() and .width() both returns 0 (like expected). $('body').append('<div id="init"><img id="myimg" src="someimage.png" /></div>'); $('#init').hide(); $('#myimg').height(); // == 0 $('#myimg').width(); // == 0 How can i get the correct height/w...

Jquery click a href link inside for loop

I have assigned a variable with arrays inside array i.e. var encounter_names = new Array(); encounters.encountersDB.each(function(encounter) { encounter_names.push(new Array(encounter.key, encounter.name))}) this is my for loop statement mentioned as below for (var i = 0; i < encounter_names.length; i++) { window['li' + i] = $("l...

Scroll if on the right side (jQuery)

Hi all, i have create a gallery with jquery. http://www.rialto-design.de/endkunden/galerie/galerie-armaturen/?album=3&amp;gallery=2 so my question is, how can i make the thumbs scroll left or right. when the cursor is on the right or left side of the container. Important is, the thubs are still clickable. Thx ...

Event for radio button being selected?

Is there some event for a radio button being selected? I know I can use "click" but I believe it is possible to style radio buttons in some browsers such that clicking an outter area of a radio button might not select the radio button. What event should I use? ...

How can I load an iframe with JavaScript?

hi to all i am using jquery and php. i want to open iFrame when i change product id in browser url. can any one help me "how to get id from browser window even i manually change the produt id ". and open iFrame. Thanks ...

help conversion code in prototype to jquery

Good day, I'm done with the following code into prototype var DataAjax = new Ajax.Updater('Data','/inc/infoPanel.asp', {method:'get', parameters:'Name='+appIdOrName}); DataAjax.onComplete = function(){ if ($('Data').innerHTML.indexOf('status=ok')>-1){ loadBlogsphere(IdOrName); } I wonder how would t...

jQuery Validate (Date Range)

Im using the jQuery validate plugin and was wondering if there was a way to validate if the date entered into a field was a date like yyyy-mm-dd AND the the date falls between Nov 29 2010 - Dec 15 2010 Im pretty new to jQuery so if there is an answer please dumb up the answer as much as possible so i can get through it. Thanks a lot fo...