[jQuery] Validation Plugin - addMethod
Hello, I am having a little problem understanding the addMethod function of the validation plugin. I am trying to do a simple test like this: I've placed this code outside of the $().ready(): JQuery.validator.addMethod('testMethod', function(str1, str2) { alert("testing...."); alert("str1 is " + str1 + "\nstr2 is " + str2); return false; }, 'some message'); and this inside of $().ready(): $("#medForm").validate({ rules: { medication : "required", dosage:
[jQuery] [treeview] Open a certain "folder" when page loads or link
So here is my problem... if anyone could help that would be great and thank you! in advance. Say this is my menu: Folder 1 (href="folder1.htm") - File 1 (..) - File 2 (..) - File 3 (..) Folder 2 (..) - File 1 (..) - File 2 (..) File 1 (..) I'm using the location.href which works perfectly when I click on File 1 (webpage).. and I have it bold "File 1" when it is on that page. When I click the "Folder 1" page, is there any way to have the "sub pages" show in the treeview? Example: Folder 1 (href="folder1.htm")
[jQuery] [validate] submitHandler not working
for some reason submitHandler doesn't seem to trigger... this is what I have: var container = $('div.errors'); // validate the form when it is submitted var validator = $("#newclient").validate({ success: "valid", errorContainer: container, errorLabelContainer: $("ol", container), wrapper: 'li', meta: "validate", submitHandler: function(form) { alert("submitted!"); //going to insert more code here form.submit(); } }); whenever I submit the form it just
[jQuery] [treeview] Get data from ASP.NET webservice using JSON
Would it be possible to write the treeview async extensions using the $.ajax syntax, as it offers more options on how and what you can use as source for the treeview. More specifically, i would like to populate using a webservice that receives json parameters and sends back json $.ajax({ type:"POST", url:"webservice.asmx/GetTreeview", data:'{"source":"root"}', contentType:"application/json; charset=utf-8", dataType:"json" (Data being sent as string is important for ASP.NET will otherwise not return
[jQuery] need to get value when event is bound, not when it runs.
I hope this will make sense to somebody. I currently have code which looks like this. for (var i = 0; i < 10; i++) { $('#textBox_' + i).blur(function() { alert(i); }); }; So, that should bind 10 blur events to 10 textboxes and when i "blur" the first textbox it should alert(1). When I blur the second textbox it should blur(2). the problem is that all of the textboxes alert(10) when you blur them because by the time the event happens the looping has finished and "i" is 10. How do I use the value of
[jQuery] Create an array of colors for text hover effect.
I'm trying to create a fun effect when you hover over a character it changes to a color (from an array) and then fades to white on roll- out. I'm experiencing a bit of an issue. For some reason, the color stays the same in the array. My guess is the value isn't increasing the way I think it would. Here's my code: function rainbow(){ var colors = Array( "#00ADEF", "#EC008B", "#F36523", "#8CC63E" ); var c=0; var chars = $("#text").html().split(""); var
jCarousel + animated hover menu
hi I'm new I'm trying to integrate jCorousel and animated hover menu found at http://www.webdesignerwall.com/demo/jquery/animated-hover1.html can anyone help me out please. thanx in advance <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>Fade Method 2 (single image)</title>
[jQuery] current selected tab versus previously selected tab
I'm getting some unexpected behavior when trying to determine the selected tab. I always get the index of the prior selected tab. Here is the code: jQuery(document).ready(function(){ var $tabs = jQuery("#example > ul").tabs({ fx: { height: 'toggle', opacity: 'toggle' } }); $tabs.tabs({ select: function(e, ui) { var selected = $tabs.data('selected.tabs'); alert("selected: "+selected+ ", event: "+e); } }); }); Any suggestion on this are most welcome. Duane Gran
[jQuery] show hide content like Google Maps
<div dir="ltr">Hi all. Google Maps(<a href="http://maps.google.com/">http://maps.google.com/</a>) haves a interesting toggle content(the << >>) in the left top corner. Do you know a jquery plugin with that functionality? Cheers Marco Antonio </div>
[jQuery] jQuery.getScript cross protocol, same domain
I am getting an access denied error when trying to do a getScript call to an https protocol from a http protocol: jQuery.getScript("https://www.mydomain.com/someJSONScript.js"); I have implemented my own cross domain ajax method that writes a script element into the head, and it works given the same scenario. This makes me believe that the jQuery.getScript method is comparing the document.location.hostname to the hostname in the URL passed in, and if they match, performing an XMLHttpRequest. Can
[jQuery] treeview async - differences between download and demo
I am a bit confused. It seems that the downloadable jquery.treeview.async.js (http://plugins.jquery.com/files/ jquery.treeview_3.zip and/or http://jquery.bassistance.de/treeview/jquery.treeview.zip) is different from the one used in some of the the demo's (http:// dev.jquery.com/view/trunk/plugins/treeview/demo/async.html). It's rather confusing, especially for beginners such as myself. Why is that? What exactly are the functional differences between the two versions?
[jQuery] jQuery and JSON
Hello. jQuery provides AJAX API that can parse JSON. For example, $.getJSON. Does jQuery proviede API that parse JSON (without AJAX)? I need functions parse() and stringify(). Do I have to download particular library for that purpose?
[jQuery] Passing a variable to a jquery function
I would like to know how I can pass a variable into a jquery function, similar to this: (function slide(x) is a function i created and x is the value I would like to pass down to the jquery function) function slide(x){ $(document).ready(function(x) { var t = "'#"+ x + "'"; if($(t).is(":hidden")) { $(t).slideDown(); } else { $(t).slideUp(); } }); } I have tried several other ways but this is the most recent. thank you!
[jQuery] jCarousel
Hi, The circular jcarousel has flickring effect when we click on the next button. It is happening in firefox 2.0 only in IE and safari it works. Some one please fix this issue as early as possible. Thanks, Hareesh
[jQuery] jCarousel
Hi, The circular jcarousel has flickring effect when we click on the next button. It is happening in firefox 2.0 only in IE and safari it works. Some one please fix this issue as early as possible. Thanks, Hareesh
[jQuery] Ajax Experience / jQuery Camp hotel sharing
Anyone interested in sharing the cost of a hotel room at the Renaissance Boston Waterfront Hotel sept. 27 thru the Oct 1st. I'm trying to lowever my travel costs to the Ajax Experience / jQuery Camp. cody
[jQuery] XML encoding UTF-8
Hello i have a really strange problem with encoding problems. This is the code that i put in the XML file " sdfasdf :) asdfa & l t ;script& g t ;alert(& # 039;asdf& # 039; ) ; & lt ;/script> <hr> :):)<br /> asdf<br /> asdf<br /> asdf wef lwekf adosnt<br /> asdgivealeuf asdlfk uasdfk<br /> asdfawefl kjasdfl asdfoucktdk " I use htmlentities(ENT_QUOTES, 'UTF-8') and nl2br() in PHP Now when i place this value in a div I get an alert(what i dont want becouse i replaced > < with utf-8) and the
[jQuery] Finding the element which has focus
I am using jQuery table key navigation plugin and I have three key navigateable tables. And focus can be moved across tables. How can I know the table name which has focus?
[jQuery] Selector question / coding help
Hi, I would like to traverse an UL and LI and set classes according to their depth. Normally I would try and try until l get it working, but I'm a bit pressed for time. Should be pretty straight forward for jquery guru's :) What I essentially have is (Joomla generated): <div id="menudiv"> <ul class="menu"> <li class="parent active"> <a href="#"><span>Main item 1</span></a> <ul> <li id="current" class="parent active"> <a href="#"><span>subitem</span></a> <ul> <li> <a href="#"><span>sub sub item</span></a>
[jQuery] element pixel-wise position
Hi everybody, is there a method to recognize the exact coordinates of an element in the document? My purpose is to chain an element position with another's (Example: i want a div to appear right below a selected span element, which hasn't fixed positions, but it has automatic ones). I thought make some math about coordinates of the top-left corners of the two elements would be the solution, but any other suggestion is welcome as i'm new in jquery and willing to learn. Thanks Balanza
[jQuery] treeview async - behaviour with 'unique' option: feature or bug
I'm not a very skilled JavaScript programmer, so when I make use of JavaScript, I always use jQuery. Currently I'm working on a Java application in which I make use of jQuery and the treeview plugin. Because my tree can grow quite large, I decided to start using the async version. Apparently treeview behaves differently, depending on whether the 'unique' option is set or not. If it's not (the default), treeview accesses the data page (url: source.php) only once, that is for the node being clicked
[jQuery] more elegant code...
Hello guys, is there a way to write this code more elegantly? (I'm sure there is ;-) Here is the code (it's working but is not very nice to look at): setTimeout(show_sentence_1,1000); setTimeout(show_sentence_2,4000); setTimeout(show_sentence_3,7000); function show_sentence_1(){ $("#intro_div .sent_1").show(); setTimeout(hide_sentence,2500); function hide_sentence(){ $("#intro_div .sent_1").hide(); } }
[jQuery] OT: simple javascript inheritance by john resig
<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Based on the simple javascript inheritance snippet published by john resig (<a href="http://ejohn.org/blog/simple-javascript-inheritance/)">http://ejohn.org/blog/simple-javascript-inheritance/)</a>, I'm developing some classes and an error is causing me some problems.</div><div>In this code sample I created a simple "person" class, and two classes inherits of it. Both "child" classes
[jQuery] leandrovieira.com lightbox problems with several images
Hi, This lightbox plugin works in all browsers. But they must think nobody needs help because I cannot find any forum, help or comments at all Good. Problem is I cannot get the navigation to work with several images. The demo works fine but when I get that on my server it always thinks there is only one image. I test in the plugin for alert(jQueryMatchedObj.length) upon startup and always get "1". So of course no navigation. Any ideas? I have these plugins on the page also: jquery-1.2.6.min.js jquery.tablesorter.min.js
[jQuery] the isDigit function in jquery.tablesorter (2.0.3) does not work for 0 or 0.0
Hi, I'm using jquery.tablesorter (ver 2.0.3) and I'm seeing that the numeric parser in the parsers failing to detect 0, 0.0, [1-9]*.0 and 00.0[1-9]* as numeric. Surely 0.0 should be considered numeric as 0? This is the code in tablesorter to check if it is numeric: this.isDigit = function(s,config) { var DECIMAL = '\\' + config.decimal; var exp = '/(^[+]?0(' + DECIMAL +'0+)? $)|(^([-+]?[1-9][0-9]*)$)| (^([-+]?((0?|[1-9][0-9]*)' + DECIMAL +'(0*[1-9][0-9]*)))$)|(^[-+]? [1-9]+[0-9]*' + DECIMAL +'0+$)/';
[jQuery] unworking php callback
Hi everybody, i'm trying to get some data from a php script using $.post() paradigm. Let me show you the code: JS: $.post( "dictionary.php", {"value" : value}, function(data){ alert("data") }); PHP: <?php $value = $_POST['value']; echo $value; ?> Ok, this look like an example, but it isn't too much simpler than my code. I'm learning jQuery, so I'm using simple functions. I only changed variable names to be more readable :) Anyway, the problem is that in the js code, the alert isn't shown as the program-flux
[jQuery] Set height of an empty div dynamically in IE6 using jQuery
Hi I'm new to jQuery but i'm finding it exciting to work with.. and i'm stuck in a problem. The problem is that i've a div, initially empty. Now i want to set its height to, say 400px (in fact it is based on the content that i retrieve from a page using ajax request). i simply do $('#initially_empty_div').height( the_height ); or $('#initially_empty_div').css('height', the_height ); Both of above methods work in Firefox and IE 7, but in IE6. Any help will be more than to appreciate for. Thanks in
[jQuery] Translation project
There are some plans about a translation project of: - documentation - official plugins in both documentation code and documentation samples? I'll partecipate for Italy :D
[jQuery] Lightbox gallery problems with livequery
Hello, I am using the jquery lightbox plugin (http://leandrovieira.com/projects/jquery/lightbox/). The lightbox works fine except that the page is using ajax to load the gallery. The navigation is missing because the plugin cannot register more than one image. I have pointed the issue to livequery since I have made a test without livequery which works fine. Here is the page with the problem. Click on the gallery and there is no navigation the next image. Ajax and livequery: http://borchbio.no/narin/?nid=1099
[jQuery] apply function
Hi everyone, I have a problem with jquery script.. I have this script : $(document).ready(function() { $('select[@name=menu]').change(function() { $('#diff').html('<a class="test">click here</a>'); }); $('.test').click(function() { alert('haha'); }); }); And the html is below : <select name="menu" class="textfield"> <option>One</option> <option>Two</option> </select> The problem is, when the anchor 'click here' has appeared (if I select one of the option), the pop-up window
[jQuery] List from array
Hi. I want co create simple HTML list with jQuery. List of items is taken from array, and those values should be also used for css color property value. Now it looks like this: colors = new Array('red', 'green', 'blue'); $(function() { $.each(colors, function() { $('#colors').append('<li>'+this+'</li>').css('color', THIS); }); }) Code shoud produce sth. like this: <li style="color: red;>red</li> <li style="color: green;>green</li> <li style="color: blue;>blue</li> How
[jQuery] absolute beginner question: $() create versus select
Hi, having started learning jQuery yesterday, I'l already struggling with the creation of new elements. Given teh following html: <ul id="existinglist"> <li>first item</li> <li>seconditem</li> <li>thirditem</li> </ul> <div class="vb" id="demo"></div> I want to create a NEW list in the div 'demo' from an array. My code: var arrPersonen = ['jan', 'pol', 'carole', 'ilse', 'piet'] $(document).ready(function(){ var list= $('ul'); $.each(arrPersonen,function(i,n){list.append('<li>'+n+'</li>')});
[jQuery] JCarousel + Views in Drupal for Slide Image
Hi, i am being creating SlideImage with JCarousel from Drupal in Drupal Site. It related with views . Any one can explain me how to do this ? Thanks
[jQuery] SimpleModal confirmation box
I am trying to overwrite JavaScript confirm method with SimpleModal. However, when I try to call confirm(parameters) outside of document.ready, all I get is a box with no text. How can this issue be fixed?
[jQuery] jdMenu update coming?
Hi, We use jdMenu for some things and I noticed that the jdMenu site says "dMenu has an update coming in the first week of August.". Does anyone know what that will include and when it might arrive? Thanks, Jack
[jQuery] problem with .keypress( fn ) firing on load
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=us-ascii"> <meta name=Generator content="Microsoft Word 12 (filtered medium)"> <style> <!-- /* Font Definitions */ @font-face {font-family:Wingdings; panose-1:5 0 0 0 0 0 0 0 0 0;} @font-face
[jQuery] Jquery cycle transitions with text
Hi there, When trying some transitions in jquery with the cycle plugin on slides that contain text, I find some work and some don't. For example scrollDown works fine: http://dev2.savingforchildren.co.uk/mjs/jquery_cycle/scrollDown.html but scrollRight doesn't seem to quite work (at least in the way I'd expect), in that the text being replaced disappears before the scrolling commences http://dev2.savingforchildren.co.uk/mjs/jquery_cycle/scrollRight.html also http://dev2.savingforchildren.co.uk/mjs/jquery_cycle/scrollLeft.html
[jQuery] [Autocomplete] Double Results
Hi guys, I'm having problem with autocomplete. I dynamically create new textboxes and attach autocomplete to it. And I'm getting following problem: 1. I enter some text into first textbox A, 2. Popup A-P appears 3. I select value in the popup. 4. I enter some text into second textbox B 5. Popup B-P appears. 6. When I rpess UP or DOWN while textbox B has focus, both popups are visible and both respond to pressing UP & DOWN keys. How can I solve it? Thank you.
[jQuery] Cookie
Hello. Does $.get() send cookie to server? I save sessions of users in cookies. I use jQuery AJAX methods to communicate with server ($.get, $.post, $.getJSON, etc.). Do I have to send header Cookie explicitly?
[jQuery] IE val() raises blur event
Hi, I'm getting a frustrating problem in IE (as usual). In a textbox's onblur event, I'd like to check if the user has entered something and change the value. I setup the onblur event: .blur(function() { // track whether the field has focus alert('blur called'); if(this.value.length == 0){selectItem(null)}; hasFocus = false; hideResults(); }); and the selectItem function function selectItem(li) { if(li.extra.sFirstName) { alert('setting name'); $("#txtSearch").val(li.extra.sFirstName
Next Page