[jQuery] bind method to easily create closures with "this" altered.
Hi, is there any method to bind and create closures with "this" altered in jQuery (with chain possibility)?? Need it on various functions. I do not mean Events. Anythink like this: function myFunc() { }.bind(anything); Greetings, darki
[jQuery] is there a secret to jQuery with Opera?
Admittedly, the function in question is my own home-fudged one. It depends on: $('<img src="' + '/images/thelogo.png' + '#' + Math.random() + '"/
[jQuery] how to remove a behavior?
Hi, I have this function ... function defineBehaviors() { $('a.deleteWorksheetItem').click( function() { alert("Executing action"); }); } and I notice (at least in PC Firefox) if I call this function twice on a page, clicking the link causes the action to be executed twice -- in the above case, there are two alert boxes. My question is, how can I prevent the action from being defined multiple times or how do I remove any function associated with the action before re-defining it? Thanks, - Dave
[jQuery] Grouping within a list
I have an app which is producing a ul something like this:- <ul> <li class="green">grass</li> <li class="green">trees</li> <li class="blue">sky</li> <li class="blue">sea</li> <li class="yellow">sun</li> <li class="yellow">banana</li> </ul> I want to create a group the items by the class and then enable toggling of the group along the lines of:- + green - blue sky sea + yellow I guess my best solution is to create a nested list for each class. I have some javascript that does more or less the same
[jQuery] Tracking mousemove: Position inside a div
How do I get the position of a mouse within a div when I'm getting events from mousemove? If it helps, I'm already including dimensions.js for the myriad extensions that want it. I understand that I can get pageX or clientX but what I want is X inside that DIV where I have mousemove tracking on.. I want to make sure I'm getting (0,0) rock solid in the upper left corner of that div in all cases.
[jQuery] using functions as extensions - why does FF not take it?
has anyone had the following problem before? VERSION 1 =================// works in IE and FF myFunction(){ ... } document.onmousedown=myFunction; VERSION 2 =================// works in IE but not in FF jQuery.fn.extend({ myFunction: function() { ... } }); $(document).mousedown(function(){ $().myFunction(); });
[jQuery] [validate] maxLength for elements that are not required
Hey Jörn, It seems that whenever I define an element as not required:false and set a maxLength the validation plugin wouldn't bother limiting the field to the maxLength, When I switch to required:true - everything works perfectly. Is there a solution to that? Thanks, Yuval Karmi
[jQuery] Accessing elements from another frame
I, Is there an easy way to reproduce the following using only jquery? I am trying to hide and show an element in a specific frame from another frame. This code is actually working but I would prefer using jquery to do it. ... var lLoadingDiv = top.content.document.getElementById('loading_div'); lLoadingDiv.style.display='inline'; ... Where "content" is the name of my target frame. I want to use the show() and hide() jquery function instead. Thanks, Thierry
[jQuery] fadeOut and IE6
I'm currently building a widget which contains multiple "deep dives" into sections of a website in a limited amount of space and have run into an issue when using the fadeOut function with IE6. Per the requirements of this section, the client wants to have the currently selected item fade out and the new item's background fade in at the same time. This is working great in Firefox, IE7 and Safari, but for whatever reason, the fadeOut function doesn't seem to fire correctly in IE6. Has anyone run across
[jQuery] change image src not working in IE6
group, i just ran across an issue in IE6, that works in both Safari and Firefox. I am simply trying to change the source of an image using: $('img#tab2').attr("src","/b_tab2_on.png"); <img id="tab2" src="/b_tab2_off.png" border="0" alt="colors"/> I've noticed that in IE, the object is found but the attr array is empty. Has anyone else run across this before in IE? I can't post the page, perhaps an example, but wanted to ping the group to see if anyone has come across this, seems pretty simple. thanks,
[jQuery] Fade Background Image on Mouseover
I have set up an example photogallery in which the main image is supposed to stay visible at all times but the background images fades in and out on mouseover. The problem that I am having is all the images fade in and out on mousever how can I stop this? The gallery is http://capnhud.awardspace.com/image_gal_layout.html the script is $(function() { // do something on document ready $(".thumbnailbg").fadeTo("fast", 0.0); // This sets the opacity of the background to fade down to 60% when the page
[jQuery] select first item over multiple lists
I have a feeling this is easy, but I can't seem to wrap my head around it. I want to match the first item of multiple lists. For example below, I would like a set with the "foo 1" and "bar 1" items . Can I get this using one match? My tries keep coming back to something like $('ul li:first'), but that only matches "foo 1" of course. Thanks for any help! <ul> <li>foo 1</li> <li>foo 2</li> <li>foo 3</li> </ul> <ul> <li>bar 1</li> <li>bar 2</li> <li>bar 3</li> </ul>
[jQuery] formatting/defining variable values
Hello I'm collecting a number of values from various form elements: textfield, radio, checkbox. since some of the fields aren't require on my form, when I POST their values they are returned as 'undefined' is there a way in Jquery that would allow me to set all variables that are undefined with a given value like "N/A" or even just ""? for example, after the form is submitted, I'm using the following code to populate my values: //cancer vars var cancerVal = $("input[name='cancer']:checked").val();
[jQuery] What is the easiest way to add events to dynamically added rows?
What is the easiest way to add events to dynamically added rows? I can't seem to get .toggle() to react to the newly added rows. For example: var html = []; ... $.each(json, function(i,data){ var row = '<tr id="interview' + i + '"><td>data.test</td></tr>'; html.push(row); } $("#dataTableBody").append(html.join("")); $("#dataTableBody tr").toggle( function () { alert("toggled on"); } function () { alert("toggled off"); } ); If you have any suggestions, outside of my initial question, on how to make
[jQuery] .is() behaviour
Hi, I'm new to jQuery, and found something unexpected. With something like this: <div id="nav"> <a href="/exit/" class="exit">Exit</a> <a href="/open/" class="open">Open</a> </div> <script type="text/javascript" charset="utf-8"> jQuery('#nav').bind('click', function() { alert(jQuery(event.target).is('#nav .exit')); event.preventDefault(); }); </script> I expect .is('#nav .exit') to return true when the event is fired from the Exit link, and false otherwise. Instead it always returns true. What am
[jQuery] Strange syntax error loading jquery.js
My browser (FF 2.0.0.12) appears to be trying to interpret some of the HTML as part of the javascript file. This bug appears frequently (but not every time) a page is loaded. Details below. I see it with jquery 1.2.1 and 1.2.3 full and minimized. I see it also in IE. I see it even when I comment out the <meta tags and other scripts that load after jquery. Has this condition been seen before? Thanks Jack Here is a snippet of the xhtml: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
[jQuery] jcarousel - displaying more than 3 images
Hi, I'm new here and I'm just a beginner. The jcarousel's great! I loved it since the first time I saw it working at game.co.uk. I'm planning to use it for a new site I'm working on, but the displayed images are only 3, is there a way to change it to 6 or 7? Thank you in advance. Best regards, Richi3f PS: I'm using the thickbox example.
[jQuery] form input helper
Hi all! I'm trying to achieve the following effect: When you focus on an input tag, the content of the div named 'help- for-xxx' should appear in the #help-tip element. And, accorgingly when you leave an input it should disappear. Appearing and disappearing means here fadeIn and fadeOut. Of course my solution is bad (fadeIn should wait fadeOut to complete). I know I can attach a callback after event completion, but I don't know how to build a solution from it. thanks Script follows: $('.help').each(function()
[jQuery] Lazy Load Select elements
Hello everyone, On my page, I have a select element that may contain 20,000+ options. When I ask jQuery for the select element, it loads the set of options with it. For 20,000 it takes about 1 - 1.25 seconds for jQuery to return from $('.boxClass)[0];. When I use standard form.select it takes roughly 300 milliseconds. Is there a way to lazy load the options of a select?
[jQuery] jquery .fadeTo with radio buttons
Hi I'm having a bit of a problem when using .fadeTo on a div containing radio buttons. There appears to be a darkened border forming around the radio buttons that persists after i fade it back to opactiy 1. This problem only occurs when i have my theme set to windows xp. if i set it to windows classic it looks fine... I'm using IE7 to test this. Not sure how it looks in other browsers... Just wondering if anyone else has had this problem and if there is a fix or workaround or something... Cheers
[jQuery] digits: false;
It appears that the digits validator doesn't check it's value. I have a situation where, depending on the value of one field, a second field may or may not be required to contain only digits. The only way I can see to achieve this within the framework would be: $(document).ready(function() { $("#formid").bind("validate",function(e,validator) {}).validate({ rules: { fieldOne: {required : true}, fieldTwo: { required: true, digits: function(e) { return $ (e.target).find("input[name=fieldOne]:checked").val)
[jQuery] Possibly a bug with Form plugin and IE(7)
This works fine in FF, however when run in IE7 the showResponse function will never run. Actually, the ajax-event probably never fires. The beforeSubmit function runs however. $('#container').children('#form2').ajaxSubmit({dataType: 'xml', beforeSubmit: showRequest, success: showResponse}); Changing the line to: $('#form2').ajaxSubmit({dataType: 'xml', beforeSubmit: showRequest, success: showResponse}); ..solves the problem for me. But it should work, right? Any thoughts? -- View this message in
[jQuery] Having problems is using JQuery Effects in Vista Gadget.
Hi, When trying to add a SlideUp effect it works well in the browser but the same does'nt work with the Vista Sidebar gadget. m curious to know the reason behind the problem. Let me know if u have any solutions. please find the code below: js $(document.body).ready(function() { //debugger; $("a").click(function(){ if ($("div:first").is(":hidden")) { $("div").show(); } else { $("div").slideUp("slow"); } }); }); HTML <BODY> <a href="#">click here</a> <div id="one"> <img src="en-US/images/apple.png"
[jQuery] How can I make searching not case-sensitive?
Hi, everybody! My problem is that I need to filter a list by hiding the rows that don't contain the string entered in a form. What I did till now is: $("#submitButton1").click(function(){ xx=$("form#form1 *").fieldValue()[0]; $("div.nume:contains(" + xx +")").parent().addClass("zero"); $("div.info:contains(" + xx +")").parent().addClass("zero"); $("div.rowcont").toggleClass("zero"); $("div.zero").hide(); }); It works, but it's case sensitive. How can I make it not to be? Any ideas...?
[jQuery] Using JQuery works with browser, problem with Vista Sidebar Gadget.
Hi, i'm trying to develop vista gadgets, with sliding effects for the RSS feeds, which has images, title, link to the detailed news page. i found that JQuery makes it simple in getting the effects, since m new to JQuery want to know about implementing the same in the Gadget. i tried the samples in the browser and it works great, but when m using the same piece of code in the gadget, like SlideUp on Click event of an Anchor Tag, the div content just flickers and does slide up really. is there any
[jQuery] Newbie needs a little help with Digg style javascript
I have a client that wanted a Digg style "Login" form that faded in and out. I was able to use jquery and some of the Digg code to accomplish this for the most part, but I'm having a couple issues and don't know how to write new javascript at all. Here is the sample link: http://rlprodesign.com/clients/kstreet/ 1) Top right, Search, Email, etc. If you roll over Search or Email, the form fades in, works perfectly. The problem is that I need only one of them to show up at a time. Like if some rolls
[jQuery] on form submission, how to decide "on submit: return true / false"
Hi there, I got helps and also debugging on self for days on trying to implement a form submission with jQuery, now I was stunk on getting the results from call back .Post or .ajax to pass true & false to the form submission. the code is pretty simple here: $(document).ready(function() { $("#regForm").submit(function() { $.post("check.php", { username: $('#username').val(),password: $ ('#password').val() }, function(data) { $('#errorMessage').html(data); if (data == "pass"
[jQuery] slideDown & slideUp - Anyone Know How?
I have been fussing with this for a long time. I don't know Javascript, so if someone knows how to help don't talk gibberish ;) Here is the link I was using: http://docs.jquery.com/Effects/slideDown#speedcallback I have tried the example of the slideDown and slideUp and have yet to get it to work the way I need it to. I know this is extremely basic since I can do it with MooTools with literally a couple lines of code. Unfortunately, I need ThickBox on the same page (jQuery), so I need to do this
[jQuery] show() on first click, hide() on second click
Hello, I have following HTML structure. http://phpfi.com/297736 I want the last dd to show() on first click on DT and hide on second last on DT. Currently, I am using the following: http://phpfi.com/297738
[jQuery] Trigger a toggle when page loads
I have several buttons whose SRC is toggled each time they are clicked. This is accomplished by: //deactivate activate click handler var destroy = function() { $(this).unbind('toggle').unbind('click'); }; var init = function() { $(this).toggle(function(e){ var $this = $(this); $(this).attr("src","images/btnReactivate.gif") }, function(e) { $(this).attr("src","images/btnDeactivate.gif") }); }; $("img.active_toggle").livequery(init,destroy); I'm
[jQuery] Sending base64 encoded data with .ajax()
I am attempting to send base64 encoded data but what is received on the server is mangled (specifically, any plusses are turned into spaces). I have attempted to set processData to false, but that doesn't seem to work. Would setting the contentType help? If so, what should it be set to? $.ajax({ type: "POST", url : processorURL, cache: false, timeout: 3000, processData: false, data: "arg=" + arg, success: DisplayResults, error: DisplayError
[jQuery] Read More button
I have some testimonials on my website but they take up a lot of space, I would like to have it so that it will show the first sentence and then have a 'Read More' button where they can click on it and it would would expand showing the rest of the paragraph. It would be like: " I am an owner/agent that was trying everything in a down market to get my condo sold. I had it listed on MLS, signs in the windows, open houses, but nothing seemed to generate any traffic... READ MORE" and once someone clicks
[jQuery] (Validation) Am I missing something in this code?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> <META NAME="Generator" CONTENT="MS Exchange Server version 08.00.0681.000"> <TITLE>(Validation) Am I missing something in this code?</TITLE> </HEAD> <BODY> <!-- Converted from text/rtf format --> <P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Consolas">This code validates after submission (how can I go back to</FONT></SPAN><SPAN LANG="en-us"></SPAN></P> <P DIR=LTR><SPAN
[jQuery] Adding more than 3 images with jcarousel
Hi, I just downloaded the jcarousel and let me say its amazing! I'm going to use for a new site I'm working on, but the problem is that it only shows 3 images! I need it to show about 6 or 7, how can I make it to show more than 3 images? Thanks, Best regards, Richi3f PS: I'm using the thickbox example.
[jQuery] Get Store Your Files Online 2 GB for free !
Free online photo Album, Free online auto-matic Back-up, Free Access your MP3 music online,2 GB For Free! That's right, we are happy to give you a whopping great 2GB of secure online storage where you can manage and share your files easily. For Free! Get Free Code: Limited Time Only! <a href="http://www.web4easy.com/free2gb">http://www.web4easy.com/free2gb</a>
[jQuery] got the new book - its great
I am new to jQuery and I purchased the book. It is nice. Very detailed explanations.
[jQuery] open page in new window without popup blocking me.
I have tried to create a link with target _blank and do a .trigger('click') and that does nothing(not even try to open new window, i mean nothing, there is another post about that). I have also tried to do the same thing by creating this a form like: <form id="redirect_form" target="_blank" method="get" action="<?php echo $url; ?>"></form> and do .submit() but that get blocked by popup blocker. The thing that i am doing is that someone submits a form and collects data and then on the submit and opens
[jQuery] fastest way to load both jquery & thickbox
Hi guys/girls, Sorry for the noobie question but i've been searching and experimenting with no luck! I've got a pretty simple site with one page - and it loads both jquery and thickbox. I've put both the files into the one js file and it's size is 33KB, i know i can gzip (somehow) to get jquery down to around 11KB.....but how the heck do i do this? I've read Juliens blog post ( http://www.julienlecomte.net/blog/2007/08/13/ ) but still dont understand how to use her php file? Is gzip a set of php
[jQuery] Keep Accordion Open When Using Ajax
I am using an accordion with a list of main categories, each with a list of sub categories (so just 2 levels of hierarchy). When you click a sub category, a nearby div element is populated with a list of products via Ajax. The normal behavior for the accordion when you click the sub category is to close. I'd like it to stay open when a sub category is clicked, kind of like what the navigation option does. The navigation option doesn't seem to suit my needs because the URL isn't changing because it's
[jQuery] clock pick in ajax loaded form - ie error
I've been using the clockpick plugin (it's awesome) and I load the form which uses the plugin via an ajax call. The plugin works perfectly in FF and Safari, but in ie 6&7, it only shows a grey box at the bottom of the page. I've look through other comments here in the jquery groups, but the other resolutions don't apply to this instance. If I attach clockpick to an input box in the main page, it works no problem, so this only affects input boxes on a form retrieved through ajax in ie. I have included
Next Page