jquery

jQuery show/hide multiple 'Other' input fields based on select drop down

I am using the follwoing jQuery to show/hide an 'Other' title field on page: $('label[for=customerTitleOther], #customerTitleOther').hide(); $('.jTitle').change(function() { if($(this).val() != 'Other') { $('label[for=customerTitleOther], .jOther').hide(); } else { $('label[for=customerTitleOther], .jOther'...

Push method only works once unless variable is used before

This might be a weird question. Anyway, I'm working on a jQuery plugin and this is a useful piece of code for this question, note that it's not all ;) : Javascript: (function($){ $.fn.newPlugin = function(){ var ranges = [], selectableRange = this; function init(){ selectableRange.live('mousedown', func...

Asp.net MVC Edit in Place

There are already jQuery based Edit in place plug ins available. But i am not sure how can i use them with Asp.net MVC. Any code sample for controller? I want to edit the .aspx files as my web application is not getting text/content from database... ...

How to sort divs according to their id using jQuery?

Hi, I have a set of divs with random ids: <div id="container"> <div id="2"></div> <div id="9"></div> <div id="7"></div> <div id="1"></div> <div id="4"></div> </div> Is there a fast way to sort them according to their id values using jQuery? Thank you. ...

JavaScript: How to get value of sender input element from keyup event?

I need to capture the keyup event to provide live validation when user is typing in an input (change event fires only when the input loses focus). I am having trouble getting the edited value of the input that fired the evnt. The code also runs on timer to prevent multiple calls when user is typing (fires only every 500 ms). I have se...

Different durations for CSS properties in jQuery animate()

I’m using jQuery to animate DOM element on the page and I hit an obstacle when using its native animate(). I’m trying to move my element to the right and change its opacity. $element.animate({ 'left': '50%', 'opacity': '1.0' }, 1000); It works very well, but I need to animate position in 1000ms and opacity in 300ms. I found ...

Using jquery and greasemonkey to get multiple pages

Sorry the title isn't great, it's sort of a loaded question.. What I am trying to do is load multiple pages from links on a page (they are on the same host). In my case it is a forum in the thread view, and I'd like to load the last page of posts so there's some kind of preview. To keep it simple, my code example assumes jquery is alrea...

jQuery Javascript ratings: Making the rating reappear when user takes their cursor off

I have this jQuery code that handles hovering over rating stars, when you hover they glow as they're meant to. Problem is, once you've taken your cursor out, it still displays what your cursor was on (and doesn't show the original rating). How can I make it check for when the cursor is removed, then show the original ratings? $(document...

jQuery Javascript removing attribute from filtered item

Hello. I have a treeview menu with variable levels. Only element on last level is clickable, the rest should have links "#". By default level 2 and 3 have links (links are created dynamically so I can't add them by jQ). If li level is 3, I need to change href for level 2 to "#" but I can't get it working :/ <ul id="Menu"> <li> <span...

Onclick event doesn't work when .append()

Simple example: I have html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Test</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="portal.css" /> <script type="text/javascript" src="/test/lib.js...

Navigating to a specific element with jQuery

I have a table, trying to figure out how to navigate to the 3.35 and add columns. Is there a way to specify which TD i want to navigate to with jQuery? Thanks ahead of time! <table> <tbody> <tr> <td> <table> <tbody> <tr> <td><a href="">title</a></td> <td><a href="">ra...

How to manipulate HTML within a jQuery variable?

Hi All, I am trying to manipulate the HTML stored within a jQuery variable. I want to do this manipulation before I write the variable to the document. So, I have a variable defined as: var sighting = "<div><span class="feed_name"></span></div>"; And I want to put "hello world" in the span element. This is the part that I can't get...

mask for asp text box using jquery

Hi, I'm trying to mask text box with 2 different masks when a check box has been checked using jquery. I tried my code with html text box and html check box and it is working ok but when I tried my code with asp text box and asp check box there is no response. any advice??? here is my code: <%@ Page Title="" Language="C#" MasterPa...

Writing a better jQuery plugin.

Hi, at the moment I have my jQuery plugin running it's logic in if statments. For example I have: (function($) { $.fn.myplugin = function(action) { if(action == "foo"){ } if(action == "bar"){ } if(action == "grapefruits"){ } } })(jQuery); Is there a better wa...

maintain fonts size with different screen resolutions

what is the best practice/solution to maintain fonts size with different screen resolutions ...

jQuery getting text value for a select list

I have a list like this: <select name="select_list_name" id="list_id"> <option value="">Select Option</option> <option value="value1">Option 1</option> <option value="value2">Option 2</option> ... ... </select> I am trying to get the text value of the currently selected option in a select list. I looked at this thr...

Jquery animated overflow element shifts in Safari

I am developing an annual report site which needs to be compatible with major browsers such as IE, FF and Safari at least. I have a couple of issues with the jquery effect. I have added a jquery slide reveal effect to the page which partially shows the main content div for a couple of seconds then it animates to reveal the rest of the c...

jQuery $(element).each function doesn't work on newly added elements

Hi there, I am using .each function to iterate trough list of elements. I am having initial list of matched elements and .each works great on these. But I can add new elements via AJAX method... .each don't work on this newly added elements? I know about live events and rebinding of events for newly added elements, but .each is not ev...

Use JQuery.post() with JSON for a secure login form.

So I'm tring to create a secure form ( username & password ) with the usernames and passwords stored stored in a Json fil. So I have some questions. How can I secure that json file will not be accessible by something coming via cross-domain request? Or How can I ensure it will not. How do I actually use the .post() the function with js...

jQuery Scrollable Next/Prev Buttons Can't Be Wrapped In Other Tags

Hey, I have a scrollable going here: http://treethink.treethink.net/portfolio/ I am trying to put a p tag around the 2 a tags that cause the scrollable to move back and forth but no matter what I put around the a tags it breaks the scrolling (span, div, p...They all don't work) How can I solve this? I assume it's something to do with ...