jquery

Append DIV and immediately add class in jQuery

What I'm trying to accomplish: I want to add a DIV after an existing DIV and assign it a specific class. I started with this: var myClass = "thisIsMyClass"; $(this).after("<div></div>").addClass(myClass) The problem with that is that myClass gets added to $(this) rather than the newly created DIV. So I gave this a try: var myClass ...

ajax wordpress posts

I am using Wordpress for this design portfolio website: http://onomadesign.com/wordpress/identity-design/shleppers-moving-storage/ Now, on this single.php page, you can see the thumbnails on the right which link to each different post. What I would like to accomplish is that the thumbnail navigation with scrollbar, stays in the same pos...

Removing and adding options from a group of select menus with jQuery

This is a little more complicated than the title makes it out to be, but here are the essential business rules: There are three select menus on the page, each filled with the same options and values. There will always be three select menus. There will always be the same number of options/values in each select menu. Selecting a question...

How can I animate text colors using jQuery?

$(document).ready(function(){ $('a.nav_menu') .css( {backgroundPosition: "0 0"} ) .mouseover(function(){ $(this).animate({ backgroundPosition:"(-650px 0)", 'color': '#000000' }, {duration:700}) }) .mouseout(function(){ $(this).animate({backgroundP...

Links to AJAX URLs

I've got a page on my site that requests quite a bit of content via AJAX. The problem I've run into is that if you've been poking around on the site and are on a page that doesn't technically have a URL, you can't copy/paste the URL and send it to someone, since you'll just end up on the home page. I was looking at facebook, and they us...

revalidating a dependent field with jQuery .validate

I'm using the JQuery validate plug-in to validate my form. I have 4 fields that are related: ev_start, ev_end, ev_starttime and ev_endtime. The first two are dates, are required, and ev_end must be after ev_start. The second two are times and may or may not be required, but ev_endtime must be after ev_starttime if they are entered. If...

Jquery selector question for form labels

I'm trying to make a selector using form labels. $("label:not[for='other']") $("label[for='other']") <label for="other"> <label for="somethingElse"> If someone selects the label for 'other', do something. If they pick a label for anything that isn't 'other' do something else. ...

Jquery ajax request, wait for latest request to finish

I have a textbox that for each time a user inputs a letter I make a search with an ajax request and show the result "live" for the user. Often when a user types the letters it takes longer time for the request to be made than for the user to input a new letter, hence a new request is made before the first one have ended. It would be much...

Can I find events bound on an element with jQuery?

I bind two event handlers on this link: <a href='#' id='elm'>Show Alert</a> JavaScript: $(function() { $('#elm').click(_f); $('#elm').mouseover(_m); }); function _f(){alert('clicked');} function _m(){alert('mouse over');} Is there any way to get a list of all events bound on an element, in this case on element with id="elm"? ...

How to get at repeater Item from jQuery

I've got a repeater on the page. The repeater is actually in an .ascx. In the repeater each item has a few things such as an Add button, and a couple of other fields. What I am trying to the Container.DataItem but the one that relates to the Add button that was clicked. If the user clicks the add button in the repeater list, give me ...

Get class name dynamically with jquery

I am trying to get this class name dynamically in jquery: echo "<div id=\"maini\" class=\"type_" .$category. " start_" .$adSize. " color_" .$color. "\"> \n"; echo " " . $siteName . " \n"; echo "</div> \n"; as you can see the class name is generated with PHP. I need the class name for this snippet of code. But what I tried does...

Jquery modal window problem

All, Can u please tell me whats wrong with the following code.I am trying to open a modal window here and the contents of it is a text box. Also i get the java script error .dialog is not a function. <html> <head> <script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; <script> $(docum...

In Javascript, perferably JQuery, how do I add something to the URL when the user clicks "back" button in the browser?

When the browser clicks "back" button, I want to append "&page=3" to the URL. How do I bind it, and then do this? Edit: I want this very simple. BIND the event{ window.location(that-url + "&page=3") } Can it be done that simply? ...

From scrollT to fadeTo

My task is to gracefully change the scrollTo function to use fadeTo from inside serialscroll.js taken from eleganttheme's ePhoto Wordpress theme. I simply tried changing the single scrollTo to fadeTo inside of serialScroll.js only for the scrolling featured section on the homepage to disappear entirely. I have found: docs.jquery.com/Ef...

longtail player + anythingslider + event listeners

I've implemented the AnythingSlider (http://css-tricks.com/anythingslider-jquery-plugin/) using image and video content (videos use the longtail flv player - licensed version 5). Problem: When the user plays the video, the slideshow doesn't know this has happened, so the slideshow keeps cycling while the video runs. So you have the sli...

How to detect if the user clicked the "back" button.

When the user goes history-back-1...how do I detect that? And then, alert "the user clicked back!" Using binds (and jquery preferably) ...

How do I initialise a silverlight control without using web service call

I am developing an asp.net mvc web application that makes much use of jquery and the progressive enhancement principle. I have a requirement for a complex control that needs access to .net code in order to function (using reflection across numerous classes). The choices were to duplicate this code in javascript (auto-generate if possibl...

How to gain reference to a clicked Hyperlink

I understand that I can use the .click() method on a hyperlink element. But how do I know which element was clicked? First I have to gain reference to the hyperlink's ID. So lets say I have a page of hyperlinks like this in view source: <a href="addButton1" href="...someurl"><img src="somebutton"></a> <a href="addButton2" href="...so...

centre thumbnail in scrollbar (jQuery)

Please check out this page: http://onomadesign.com/wordpress/identity-design/hans-appenzeller/ The thumbnails on the right, link to different portfolio items (Wordpress single posts). I want the thumbnail of the active project to be vertically centred in the scrollbar when the user enters the page. Right now, it resets the scrollbar, so...

jQuery event binding

Environment: JSF 1.2 RI, RichFaces 3.3.2 We utilize jQuery for is to change CSS classes when items gain or lose focus. This is pretty straight forward, however when our partial renders are completed we are not seeing these focus and blur events bound to the newly rendered form elements. This is to be expected, as these events are not ...