jquery

Swapping classes on click with jQuery, by using elements class

I have written this simple bit of jQuery that swaps out the containing ul's class based on which contained anchor is clicked. It's working fine, but, I know this is messy. I was wondering if someone could point out a way to do this same effect without having to manually enter each class name. I am just a jQuery newb and am looking to lea...

how to convert image into bytes (like byte array in .Net) using javascript in Palm WebOS

Hello, In Palm WebOs I need to convert an image into bytes (like byte array in .Net) to pass it as a parameter to a web service, where I can convert back this bytes data to image and save on server. Please help me to convert image into string variable or any other format to send it to the web service using javascript or jquery in palm we...

Defining a variable in a js file, from a php file.

I have a javascript file that needs a value from a variable in a php script in which the JS file is being called. <? $sid = session_id(); ?> <html> <head> <script src="javascript.js" type="text/javascript"></script> ... How can i get $sid into the js file for use? ...

Jquery not finding element within a table

Hi there, Jquery is unable to find any element within my table - here is the htmlcode. if I don't specify and element name #btnLogin it attaches the click event to all the elements. When i try to find a specific element it just doesn't pickup. <script> $("#btnLogin").click ( function() { alert('Hi'); ...

asp.net MVC: Making an Xdocument available to jquery?

Hi there, Can anyone help, I have got an Xdocument which opens an XML files on the disk and returns it to the view in asp.net mvc... Everything is working ok. The problem being is that i need to manipulate the data with jquery, how do i pass this data which is asp.net mvc to jquery? here is what i have XDocument xdoc = XDocument.Lo...

JQuery Radio Button / Checkbox Flow

I've got a set of questions that when selected displays another set of radio buttons for the next question (a show / hide system), what i'm having trouble with is that at the end of the questions (only 3, but on one step there's a skipping system) i need to post to a specific url depending on what the user has selected, so the href needs...

Substitute for eval() for using LiveValidation constructor

Hi. I'm using LiveValidation for input elements. These come in a table retrieved with an AJAX call, and can be multiples of 4, anywhere between 4 and 36. I'm using eval to call the constructor for LiveValidation as the number of input elements can vary after each AJAX call and I couldn't think of another way (I don't have much experien...

arrow keys not scrolling on IE7 for our web site

Hello we have a live production site in which IE7 users complain that they cannot use the arrow keys / page up / page down to scroll around on a page. it works perfectly for IE6/IE8/FF/Opera/Chrome, but not for ie7 This happens on all the pages in the solution any ideas? the site is found on www.rikstoto.no Yours Andreas Knudsen ...

changing the color of p elements with .click(function)

I'm trying to change the color of some p elements when they're clicked and while they're in that state, but when another p is clicked I need to change the color of the previous p element back to normal, just wondering how it's possible to do that. thanks $('.slide span p').click(function() { var p =$(this); p.css('color','#999'); ...

[php] return json string with html characters?

i want to call a php with jquery ajax to perform some database things and then return 2 lists of links. so i have to pass these two link lists back to jquery so it can display list 1 in the left side of the webpage and list 2 in the right side. i created the lists in separate arrays that i send back to jquery with json_encode but i noti...

Thickbox seems to have just stopped loading images, although iFrame still works

Hi guys, I can't figure this one out! Thickbox seems to have stopped loading images in it's default lightbox mode - I've made no changes and the clients just reported it. Weird thing is the iFrame version works fine. I'm seeing no errors, but using Tamper Data through Firefox there's no attempt to call the image either. Example page is...

How to trigger event upon first visit of website only using jQuery?

Hi I would like the navigation on my website to fade in when visiting my website and remain present (ie. not fade in again) when visiting other pages of the site. Would the best way to achieve this be to tell jQuery to ignore the fade in effect if visiting from the same domain? If so can someone tell me how I would write this? Many tha...

django chain select

django-smart-selects is an elegant solution that enables Django developers to have chained select inputs in their forms. But as reported by developers in its list of issues, it does not work well when used in formsets. The javascript it renders is tied to the id of the "chained field" right in the model definition. How do you think thi...

Jquery drag and drop

Hi I am new to jQuery and trying work on a proof of concept. I have posted the example code here and my requirement is as follows. I have 2 droppables dog/sheep and I want to drop them on the shirt. I drop the sheep/dog on the shirt but as soon as drop it goes to the down-left position of the div. I tried doing $('[id$="apparel"]').ap...

jquery ui style customization

how do i change the tab size, font size etc for my jquery accordion? ...

Replacing div content using jquery in a jsp

So far I've been making an AJAX call to replace the content of a div with another page, using the following code: <script> function fetchContainerContent(url, containerid) { var req = false if (window.ActiveXObject) { try { req = new ActiveXObject("Msxml2.XMLHTTP") } catch (e)...

Floating Scrolling Div with vertical constraints

What I am aiming for is along the lines of the example at http://net.tutsplus.com/tutorials/html-css-techniques/creating-a-floating-html-menu-using-jquery-and-css/ However I would like to constraint the floating div within another parent div. E.g. I would like a menu div to be floating in the above light grey box, but it should not ...

JQuery PNG Fix Plugin - Doesn't work so well?

Hello all, I have just switched over from the old png transparency fix using a htc file and I have started using a JQuery plugin called JQueryPngFix. I have to migrate because I have started using JQuery and its conflicing with the htc file. The thing is, it works but it seems to have over-layed the PNG (sends it to front rather than a...

Possible Wordpress URL rewriting issue

Hey all, I've just installed wordpress at the root of my site and created a custom theme, you can see it at www.danwellman.co.uk I have a problem with the form attached to the 'Contact' tab near the top-right of the header - this is a jQuery plugin which makes a POST request to a PHP file to send an email to my hotmail. before install...

jQuery: How do I add a click handler to a class and find out which element was clicked?

Hi there, I have been using the following method for adding a click event to an id, I was wondering if i could do the smae with a class.... I have a number of items (which are created in a for each loop) and i need to be able to click them and then pickup which was clicked... here is my existing code $('submit-button').bind('click', su...