I am trying to setup a checkbox that checks all the child checkboxes, like a tree view. The following codes works great in Firefox and Chrome but in IE, it takes two clicks to get it to work. What am I missing?
HTML
<input type="checkbox" name="org" value="orgs" id="orgs" />
<label for="All">Organizations</label>
<ul id="orglist">
...
I'm having a very hard time trying to do something very simple. Here's the code:
if(data == 'success') {
alert('foo');
} else {
alert(data);
}
I've simplified it, but that's all that's necessary to understand what's going on. the variable 'data' is a result of an AJAX call, if that m...
I want to be able to know when a user navigates away from the page I have loaded in a window opened by Javascript. For example if I have:
newWindow = window.open('http://www.example.com', 'testWindow');
I want to know when the user navigates away from that page (so unload, onunload, onbeforeunload would all work for me if any could be...
In jquery how do I refer to a div with a certain title attribute?
$('#inner').attr("title:contains('" + position +"')").css('position', 'absolute');
this isnt working for me, If contains doesnt work in there how do I refer to a div with the title="div1" and change its css . Thanks again!
EDIT:
I have multiple #inner divs, how can I ...
I'm looking to click a.go and then have a series of divs all with the class of .box animate to a percentage that is held in an input within the parent .box
So i looks something like this:
<a class="go" href="#">go!</a>
<div class="box><input type="hidden" value="50"/></div>
<div class="box><input type="hidden" value="90"/></div>
<div ...
I'm using a jquery plugin on my page, vTicker, "for easy and simple vertical news automatic scrolling". I'm using it in combination with an rss jquery plugin. It's working fine, but I need to create a button that will do a manual scroll. Can anyone tell me how to do this? I'm guessing I need to call the moveUp function from the vTicker f...
I have a Javascript module the following Javascript:
EntryController = function$entry(args) {
MainView();
$('#target').click(function() {
alert('Handler called!');
});
}
MainView() has a callback that creates the #target button. Because of the callback the code will pick up and run through the rest of the code $('...
I want to build a Country/State selector. First you choose a country, and the States for that country are displayed in the 2nd select box. Doing that in PHP and jQuery is fairly easy, but I find Django forms to be a bit restrictive in that sense.
I could set the State field to be empty on page load, and then populate it with some jQuery...
I am using .prepend() and .remove() to show menu items in the order a user clicks them.
$(document).ready(function()
{
$('#item1').click(function()
{
$('#item1_content').remove();
$('.menu_item_content').prepend('<div id="item1_content">The Box For Menu Item One</div>');
});
$('#item2').click(functio...
I need a smooth slide effect and i cant seem to understand what I am doing wrong. I have tried the following
$(document).ready(function(){
$('.drop2').click(function(){
var $next = $(this).parent().next('li.drop_down2');
if($next.is(':visible')) {
$next.animate( {'display':'none'}, 'slow', 'easeOutBounce...
I'm using JQUERY animate to show a banner at the top of the page, which is a DIV that is set to top -60 to hide it. I'm using the following JS call to show the div:
// Animation
$('#message-dock').animate({
top: 0
}, 500, function() {
// Animation complete.
});
What I can't figure out is for some reason there is an unwanted de...
Is there any way to watch, if the content within a div changes?
Let's say I have:
<div id="hello"><p>Some content here</p></div>
Which at some point 5 seconds later changes to:
<div id="hello"><ul><li>This is totally different!</li></ul></div>
How can I be notified of this via a callback or something else? I can in most cases get ...
Hello,
I have a spash screen on a website that has a div with the ID of "splash" i'm trying to make the div fade in then if the user clicks on the div it fades out and redircts to the main site. If the user dosen't click it just fades out and redirects after 10 seconds.
The timed redirect is working but not the click function.
...
Hi
I need to render a partial view (returned from the controller) to show some customer summary details. This will need to happen when the user clicks on a button. In the the mean time the user can select different customers on a grid. I keep note of the selected customer id in a hidden field using jquery on the grids selection changed e...
I have searched everywhere, and I can't seem to find a solid example.
Is anyone doing this? Can anyone provide and example of calling a remote validation using the JQuery validation plugin through a WebMethod in an aspx page (Web Forms)?
...
Hi, i am trying to create array from window.location.hash variable but i am failling.
My code is:
$.each(window.location.hash.replace("#", "").split("&"), function (i, value) {
value = value.split("=");
var my_item = {value[0] : value[1]};
form_data[i] = my_item;
});
consol...
Hi,
I have two combo box on my page. And when i change the value of first combobox then the value of second combo box should be according to the first box.
if i change the grade A then the value of Scored marks should be 70% and if i change the grade B then the value of Scored marks should be 60%.
Is it possible?I don't have any ide...
Hi,
To get the selected value from a dropdown with ID is easy:
$("#ComboBox option:selected").text()
However I can't use ID and need to get it by title/a select element, how do I do that? I tried something like: var item_level = $('select:contains("Item Level")').text()
but wasn't very successfull.
Any ideas?
Thanks in advance.
...
For reasons entirely beyond my comprehension, this function runs just fine:
function foo() {
var loop = true;
var abc = ["a","b","c"];
var ctr = 0;
while(loop) {
$("<img />").error(function () {
loop = false;
}).attr('src','images/letters/'+abc[1]+(ctr++)+".jpg");
alert(ctr);
}
}
...
The first half of this code works perfectly. However the second. Where an items is removed if you click it does not fire.
$(document).ready(function()
{
$('#contact').click(function()
{
$('#contact_box').remove();
$('.menu_item_content').prepend('<div class="menu_box" id="contact_box">Contact INFO goes in this...