[jQuery] Re: Change stylesheets if images are off
One thing I realized, is that it will still have a delay from page load to running the images-enabled function--the browser has to request the nonexistent image, get the 404 Not Found response, then execute the onerror. So you may well have a flash of 'noimages.css' before 'gotimages.css' are loaded. The fastest thing may be to use "http://localhost/nothing.gif"; as your non-image. Danny On Feb 16, 11:15 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > OMG, I can't wait to test this!!!
[jQuery] Re: Change stylesheets if images are off
OMG, I can't wait to test this!!! On Feb 17, 5:12 am, Danny <[EMAIL PROTECTED]> wrote: > A simple hack to detect if images are enabled: > Include the following in your HTML: > http://microsoft.com/nothing.gif"; onerror="alert('hello');" > style="position: absolute;top=-100px" /> > > If images are enabled, we waste microsoft's bandwidth for a bit (it > could be any nonexistent image file on any server, obviously), and the > browser executes the onerror function (which should do something more > sophisticated than alert; it could change your stylesheet, for > instance). > If images are not enabled, the function is not executed. > The style attribute is there just to hide the ugly red x in IE, but > setting it really invisible with display: none or visibility: hidden > tells the better browsers (Opera) not to bother getting the image, so > the error function never gets called. > > This was tested in Firefox 2, IE 6, Opera 9, Safari 3 > > Using jQuery to insert the element, with > $('http://microsoft.com/nothing.gif"; onerror="somefunc()" > />').appendTo('body') > > works as well. > > Danny
[jQuery] Re: Change stylesheets if images are off
A simple hack to detect if images are enabled: Include the following in your HTML: http://microsoft.com/nothing.gif"; onerror="alert('hello');" style="position: absolute;top=-100px" /> If images are enabled, we waste microsoft's bandwidth for a bit (it could be any nonexistent image file on any server, obviously), and the browser executes the onerror function (which should do something more sophisticated than alert; it could change your stylesheet, for instance). If images are not enabled, the function is not executed. The style attribute is there just to hide the ugly red x in IE, but setting it really invisible with display: none or visibility: hidden tells the better browsers (Opera) not to bother getting the image, so the error function never gets called. This was tested in Firefox 2, IE 6, Opera 9, Safari 3 Using jQuery to insert the element, with $('http://microsoft.com/nothing.gif"; onerror="somefunc()" / >').appendTo('body') works as well. Danny
[jQuery] Re: is there a tab-indexer plugin?
Totally fair point, and one that Dennis's snippet doesn't fix entirely. I was fretting over http://jquery.cherryaustin.com, which has a nested div structure. The 'natural' tabs were all over the place - the divs are all javascript show/hide jobs, and various browsers set various tabs according to what they deemed visible (or so it seems, anyhow!). I started off manually setting tabs to fit in with the nested structure. Got fed up. Requested help. This little code does exactly as it says in Firefox. IE7 seems to disregard it, setting its own tabs according to its own rules ... haven't tried it elsewhere. As my site is basically an off-the-cuff blog, I'm just happy to have my tabs set in *some* sort of logical order. But, if we're looking for lessons out of the exercise, I'd say: [1] Natural (browser) tabbing isn't reliable, if your page has a complex/mutable structure; [2] Auto- magic indexing isn't reliable either, but is better than an abandoned manual system! On Feb 16, 11:48 pm, "Karl Rudd" <[EMAIL PROTECTED]> wrote: > I'm curious as to why this would need to be done. By "default" links > on a page have a tabindex based on their position in the HTML so > there's usually no need to set the tabindex. > > Interesting article on the > subject:http://www.webaim.org/techniques/keyboard/tabindex.php > > Karl Rudd > > On Feb 17, 2008 3:21 AM, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> wrote: > > > or does anyone know how to make one? Something that will incrementally > > number the tabindexes for all the hrefs on a page? It's a shot in the > > dark, but worth trying to save all that effort! > > Cherry :) > > >http://jquery.cherryaustin.com
[jQuery] Re: Defining more than one function
I can't see any problems with the code. What about the HTML? Can you show us an example page where it's not working? Karl Rudd On Feb 17, 2008 1:19 PM, Michael Ray <[EMAIL PROTECTED]> wrote: > I am trying to define three functions within the $(document).ready() > function. However, each of these functions only work if the other two are > not there. I have to use noConflict mode because I am also using Protype as > well. What is the proper syntax to define more than one function? Here's > what I have right now: > > > var J = jQuery.noConflict(); > > J(document).ready(function(){ > J('#slickbox').hide('slow'); > > J("#next").click(function(){ > J("#120141").hide(1) > J("#1201496400").hide(1) > J("#1201582800").hide(1) > J("#1201669200").hide(1) > J("#1201755600").hide(1) > J("#1201842000").hide(1) > J("#1201928400").hide(1) > return false; > }); > > J("#previous").click(function(){ > J("#calendar").append('this is a test
'); > return false; > }); > }); > >
[jQuery] Re: Defining more than one function
not sure exactly what's going on there, but one problem is that you apparently have ID values that start with a number, which is invalid. Also, do you really want those elements to take 10 seconds to hide? A demo page would help us see a bit better what's going on. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 16, 2008, at 9:19 PM, Michael Ray wrote: I am trying to define three functions within the $(document).ready() function. However, each of these functions only work if the other two are not there. I have to use noConflict mode because I am also using Protype as well. What is the proper syntax to define more than one function? Here's what I have right now: var J = jQuery.noConflict(); J(document).ready(function(){ J('#slickbox').hide('slow'); J("#next").click(function(){ J("#120141").hide(1) J("#1201496400").hide(1) J("#1201582800").hide(1) J("#1201669200").hide(1) J("#1201755600").hide(1) J("#1201842000").hide(1) J("#1201928400").hide(1) return false; }); J("#previous").click(function(){ J("#calendar").append('this is a test
'); return false; }); });
[jQuery] Defining more than one function
I am trying to define three functions within the $(document).ready() function. However, each of these functions only work if the other two are not there. I have to use noConflict mode because I am also using Protype as well. What is the proper syntax to define more than one function? Here's what I have right now: var J = jQuery.noConflict(); J(document).ready(function(){ J('#slickbox').hide('slow'); J("#next").click(function(){ J("#120141").hide(1) J("#1201496400").hide(1) J("#1201582800").hide(1) J("#1201669200").hide(1) J("#1201755600").hide(1) J("#1201842000").hide(1) J("#1201928400").hide(1) return false; }); J("#previous").click(function(){ J("#calendar").append('this is a test
'); return false; }); });
[jQuery] why are my tabs so jacked up in ie6?
Please use the tabs-powered list on the bottom right side of my homepage: http://www.fourthavenuechurch.dreamhosters.com When the secondary tab is selected, the initial div becomes nested within the newly activated div. What gives? I can't seem to figure it out. I'm using: jquery-1.2.3.pack.js jquery.tabs.pack.js I even tried changing my tabs plugin to idTabs, which did the exact same thing :( Thanks in advance, Brad
[jQuery] Re: Select next element ...
Hey, u can use $(this).next().toggle(); You should read Traversing section of jquery document, it describe clearly similar methods(next,prev,siblings...) On 16/02/2008, Daniele <[EMAIL PROTECTED]> wrote: > > I have some troubles with my project. Here it is the problem: > > I have an HTML like this > > click > > > click > > > > > When I click on the link i want to change its class and toggle the > below without using any ID. > I have no problem changing the link, but I can't find a way to select > the FIRST next element. > > $("a").click(function () { > $(this).attr({className: "new-class"}); > $(this + " + div").eq(0).toggle(); > } > > I though something like this would work, but it doesnt. > How can i select the first next element after my click element? > > daniele > > > > > > -- / * Người ta thưởng chỉ chú ý đến những kẻ lên như diều gặp gió! Nhưng hỡi ôi, chỉ có cát, bụi và lông hồng mới là những thứ lên nhanh nhất */
[jQuery] Re: returning variable from extension function
What you have coded doesn't work because the $.get call is *asynchronous*. When you call $.get, $.post, $.ajax or any async function you pass a callback function. The actual $.get call returns immediately, but the results from the server aren't passed to your callback method until the server responds. That may take a few hundred milliseconds or it may be many seconds. You have no control over when the response is received so you need to structure your code with that in mind. On Feb 15, 2008 8:35 PM, jquertil <[EMAIL PROTECTED]> wrote: > > I know little about variable scope, have been reading up on OOP, but I > don't understand why this would not work. > I tried inserting "return objectArray" in various places to no > avail... > > $('#button1').click(function(b){ >$().loadXML2array('url','var'); >alert(objectArray); // does not work > }); > > > jQuery.fn.extend({ >loadXML2array: function(url,variable) { >return this.each(function() { >$.get(url,{xml:variable}, function(data){ > objectArray = new Array(); > $(data).find('row').each(function(i){ > rowObj = new Object(); > rowObj.col1 = $(this).children('col_1').text(); > rowObj.col2 = $(this).children('col_2').text(); > rowObj.col3 = $(this).children('col_3').text(); > objectArray.push(rowObj); >}); >}); >}); >} > }); >
[jQuery] Re: Taconite + Jframe + forms = weird problem
> > > That does make sense. Thanks Mike. > > However, any idea why it works fine with a regular link? In the > example link I provided, the link in there also has a TARGET to the > same element and the response from the server is also XML. Yet, that > one works fine... > The link works because the click handler returns false and so the target is completely ignored. The entire XML response doc is never inserted into the document, rather Taconite processes it as expected. Mike
[jQuery] Re: returning variable from extension function
jquertil, I am the least qualified person to answer you, but am disappointed that you haven't received any replies to either of your posts, so am bumping you up! I have this difficulty all the time -- and you're clearly more advanced than me. I *think* you need to create a namespace - which I **think** means naming your function. If there is any simple documentation about this, I haven't found it yet! Good luck - and, if you don't get a reply but find the answer anyway, please post it back!! Cherry :) On Feb 16, 1:35 am, jquertil <[EMAIL PROTECTED]> wrote: > I know little about variable scope, have been reading up on OOP, but I > don't understand why this would not work. > I tried inserting "return objectArray" in various places to no > avail... > > $('#button1').click(function(b){ > $().loadXML2array('url','var'); > alert(objectArray); // does not work > > }); > > jQuery.fn.extend({ > loadXML2array: function(url,variable) { > return this.each(function() { > $.get(url,{xml:variable}, function(data){ > objectArray = new Array(); > $(data).find('row').each(function(i){ > rowObj = new Object(); > rowObj.col1 = $(this).children('col_1').text(); > rowObj.col2 = $(this).children('col_2').text(); > rowObj.col3 = $(this).children('col_3').text(); > objectArray.push(rowObj); > }); > }); > }); > } > > });
[jQuery] Re: How to dynamically load jQuery plugins?
Now you guys got me confused... Now I have getScript and the On-Demand plugin... which one is better? Which one suits better what I want to do? (explained on the first post) Though, I liked how the On-Demand was capable of loading css on run- time too and that might prove useful when and if, for some reason, my website needs specific IE CSS and I need to load that CSS file if the user is using IE. However, I would really like to know the differences between the two to include javascript files on run time... On Feb 16, 5:11 pm, Tony <[EMAIL PROTECTED]> wrote: > You can try the on-demand > plugin:http://www.creativit.com.br/jquery/ondemand_js/index.htm > > --Tony
[jQuery] Re: Select next element ...
Hi Daniele, Try this: $("a").click(function () { this.className = 'new-class'; $(this).next('div').toggle(); } All sorts of DOM traversing methods can be found here: http://docs.jquery.com/Traversing --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 16, 2008, at 5:04 PM, Daniele wrote: I have some troubles with my project. Here it is the problem: I have an HTML like this click click When I click on the link i want to change its class and toggle the below without using any ID. I have no problem changing the link, but I can't find a way to select the FIRST next element. $("a").click(function () { $(this).attr({className: "new-class"}); $(this + " + div").eq(0).toggle(); } I though something like this would work, but it doesnt. How can i select the first next element after my click element? daniele
[jQuery] Please suggest minimal test of jQuery installation
Please suggest some way to verify jQuery installation. I having some difficulty with jQuery installation on a server with 'antiquated' OS (OpenVMS circa 1995). I not sure if my lack of success is due to the web server software/OS or if I'm doing something wrong. I've managed to install jQuery on several other machines (including much newer OpenVMS). Thanks very much. Ransom Fitch
[jQuery] Re: prepend - but make second item instead of first
You, Mr. Steve Davis, a newb to javascript? ;-) Glad you came to be part of the jQuery group. Many of us started going that direction after I got back from a Lasso conference last year. One of those, "I could have had a V8" moments. I just need to add the tbody tags to my table. I can get lazy about that tag most of the time. On 2/15/08 3:09 PM, "Steve Davis" <[EMAIL PROTECTED]> wrote: > > i would make the first row a "th" then have it do a $("th").after(add > your TR here); > > but im a total newbie to javascript and jquery > > On Feb 15, 2:48 pm, Shelane <[EMAIL PROTECTED]> wrote: >> I would like to add a row to a table. The first row is a header. So >> I want to add it just under the header row. How would I accomplish >> such an endeavor? > >
[jQuery] Re: is there a tab-indexer plugin?
I'm curious as to why this would need to be done. By "default" links on a page have a tabindex based on their position in the HTML so there's usually no need to set the tabindex. Interesting article on the subject: http://www.webaim.org/techniques/keyboard/tabindex.php Karl Rudd On Feb 17, 2008 3:21 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > or does anyone know how to make one? Something that will incrementally > number the tabindexes for all the hrefs on a page? It's a shot in the > dark, but worth trying to save all that effort! > Cherry :) > > http://jquery.cherryaustin.com >
[jQuery] Re: a small accessibility rant
Wow!! What fantastic news :)) Please will you hurry up, so I can get on with using entertaining jQuery effects? Cherry ;) On Feb 16, 4:52 pm, Colin Clark <[EMAIL PROTECTED]> wrote: Excitingly, we just > received a grant from the Mozilla Foundation to help the jQuery > community make jQuery more accessible. We hope this will include > keyboard navigation, ARIA semantics for assistive technologies, high > contrast support, and more.
[jQuery] Re: Slideshow for divs (with AJAX?)
Hi Christoph, SerialScroll can be used with AJAX (actually can't now, but I'll add a release on monday with a small change that will allow it). Combining that change, with a custom event like the last example in the demo, you can easily use it for AJAX content. Just a note, this plugin: http://plugins.jquery.com/project/LocalScroll which is SerialScroll "sibling" :), already has an AJAX demo if you want to check, I was wanting to give SerialScroll that option too but couldn't figure out in what way, now I know.. I'll post here when the new release is up, and I'll tell you how. Ariel Flesler On 16 feb, 06:23, Christoph Haas <[EMAIL PROTECTED]> wrote: > On Thu, Feb 14, 2008 at 01:24:40PM -0800, Ariel Flesler wrote: > > The newborn:http://plugins.jquery.com/project/SerialScroll > > Very nice, Ariel. This is pretty close to what I'm looking for. Is there > a way to use it with AJAX? I'm trying to build a paginated view where > the user can click on the right arrow, a new DIV is loaded from the web > service and then scrolled to the left. Think of it as a slideshow where > the DIVs are not yet present in the HTML page (perhaps even with > preloading the images in the new DIV). I also experimented with the > "cycle" plugin but wasn't very successful. > > Has anyone perhaps done something like that? > > Kindly > Christoph > -- > [EMAIL PROTECTED] www.workaround.org JID: [EMAIL PROTECTED] > gpg key: 79CC6586 fingerprint: > 9B26F48E6F2B0A3F7E33E6B7095E77C579CC6586
[jQuery] Re: clock pick in ajax loaded form - ie error
Hey Pete, It looks like you're still not using the latest release - I can tell because in the settings object in the source, there is no "bgiFrame" property. This was added in the latest release. Here's the link to that: http://www.oakcitygraphics.com/jquery/clockpick/trunk/jquery.clockpick.1.2.1.js Also make sure you have the lastest css file: http://www.oakcitygraphics.com/jquery/clockpick/trunk/clockpick.css I think there may be some incompatibility between the .js and .css files you're using which could be causing the problem. -- Josh - Original Message - From: "pedalpete" <[EMAIL PROTECTED]> To: "jQuery (English)" Sent: Saturday, February 16, 2008 1:40 PM Subject: [jQuery] Re: clock pick in ajax loaded form - ie error making a TINY bit of progress on this, but maybe it will lead to the answer. I've been putting a few alert statements into the clockpick.js to see if it would lead to an answer. It turns out by adding an alert to the end of the 'renderhours()' function, the hours display and then hide. So apparently the problem isn't that the clockpick does not show in ie, but rather that it shows quickly and then is hidden. I've commented out the 'hide' line, and added alerts into the other functions to try to find why it hides after loading, but have come up empty thus far. The newly 'alerted' page can be found at http://zifimusic.com/testing/clockpick-ie.php So the problem isn't that the clockpick doesn't display, but that it hides itself after it builds itself, it just all happens to quickly to see it.
[jQuery] Select next element ...
I have some troubles with my project. Here it is the problem: I have an HTML like this click click When I click on the link i want to change its class and toggle the below without using any ID. I have no problem changing the link, but I can't find a way to select the FIRST next element. $("a").click(function () { $(this).attr({className: "new-class"}); $(this + " + div").eq(0).toggle(); } I though something like this would work, but it doesnt. How can i select the first next element after my click element? daniele
[jQuery] Re: I need some help with basic thing
FrEaKmAn escreveu: > $('a#addsuggest2').click(function() { > alert('working'); > }); > $('a#addsuggest').click(function() { > //alert('working'); > $('#message').html('add'); > }); > Add > > > what is wrong? When I click on second add link (addsuggest2) nothing > happens > > When the code $('a#addsuggest2').click(function() { alert('working'); }); is executed, the "a" element with "addsuggest2" id does not exist, so the click event is not bound, because you are creating the element on-the-fly when you click "addsuggest": $('#message').html('add'); Maybe the LiveQuery plugin can help you: http://brandonaaron.net/docs/livequery/ =) --- Carlos Antonio da Silva Sistemas de Informação Rio do Sul - Santa Catarina "Não deixa de fazer algo que gosta devido à falta de tempo, a única falta que terá, será desse tempo que infelizmente não voltará mais."
[jQuery] selecting elements in 'load' areas
Hi, I'm having a problem with selectors not affecting things that have been loaded into the page. Any help or ideas would be gratefully received. I'm quite new to all this... See comments in my code below... $(document).ready(function(){ // loads HTML with form and now there are two links with the class of .advancedsearchlink $("#advancedsearchholder").load("load-advancedsearch.html"); // this opens and closes a search area using either of the .advancedsearchlink links - but only the one outside of the loaded HTML works $(".advancedsearchlink a").click(function () { $("#advsearchbox").slideToggle(); return false; }); }); Thanks!
[jQuery] Re: How to dynamically load jQuery plugins?
You can try the on-demand plugin: http://www.creativit.com.br/jquery/ondemand_js/index.htm --Tony
[jQuery] Re: clock pick in ajax loaded form - ie error
making a TINY bit of progress on this, but maybe it will lead to the answer. I've been putting a few alert statements into the clockpick.js to see if it would lead to an answer. It turns out by adding an alert to the end of the 'renderhours()' function, the hours display and then hide. So apparently the problem isn't that the clockpick does not show in ie, but rather that it shows quickly and then is hidden. I've commented out the 'hide' line, and added alerts into the other functions to try to find why it hides after loading, but have come up empty thus far. The newly 'alerted' page can be found at http://zifimusic.com/testing/clockpick-ie.php So the problem isn't that the clockpick doesn't display, but that it hides itself after it builds itself, it just all happens to quickly to see it.
[jQuery] Re: a question about simple manipulation
$("a").append(" "); Will append the spaces to all a tags on your page. And like Cloudream said, check out the demos. The jQuery site has loads of great demos for doing just about anything. - Jamie Goodfellow On Feb 16, 9:53 am, Cloudream <[EMAIL PROTECTED]> wrote: > learn demos onhttp://docs.jquery.com/Manipulation > :) > > On Feb 16, 9:08 pm, amir abbas <[EMAIL PROTECTED]> wrote: > > > > > hi everybody > > i want to add some html character to end of all links. > > i want to add three before each link closing tag > > my links are like this > > > http://jquery.com>jquery > > > i want to change it to > > > http://jquery.com>jquery > > > is it possible to do something like this in jquery ? > > thanks in advance.- Hide quoted text - > > - Show quoted text -
[jQuery] Re: I need some help with basic thing
thanks for reply. I was also able to solve the problem with livejquery... On 16 feb., 22:06, Karl Swedberg <[EMAIL PROTECTED]> wrote: > The problem here is that you are bind the "click" handler to > "#addsuggest2" when the document is first loaded, but that element > doesn't get created until you click on "#addsuggest" > > Unlike with CSS, which allows you to set styles for non-existent > elements that will be automatically applied if the elements are > created at a later time, JavaScript events don't work that way. There > is a plugin, called LiveQuery, which you might want to investigate, > because it "listens" for elements added to the document and applies > event handlers to them as appropriate. > > However, in your case, you could solve your problem with a simple > rearrangement of your code: > > $('a#addsuggest').click(function() { > > $('add a>').appendTo('#message').click(function() { > alert('working'); > });}); > > Add > > > Note here that I used appendTo, which adds to whatever is already in > "#message". If you wish to replace the contents, you could precede > that line with this: > > $('#message').empty(); > > Hope that helps, > > --Karl > _ > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > On Feb 16, 2008, at 7:40 AM, FrEaKmAn wrote: > > > > > $('a#addsuggest2').click(function() { > >alert('working'); > > }); > > $('a#addsuggest').click(function() { > >//alert('working'); > >$('#message').html('add'); > > }); > > Add > > > > > what is wrong? When I click on second add link (addsuggest2) nothing > > happens
[jQuery] Re: a small accessibility rant
Hi everyone, I'm weighing into this thread late, but wanted to make a couple of quick comments. I agree with Chris' point that accessibility isn't only for the benefit of people with disabilities; it provides all kinds of value to everyone who uses the Web. Perhaps you've heard of the "electronic curb-cut effect:" when sidewalks were redesigned to provide accessibility for wheelchairs, this change had a direct benefit on people using strollers, shopping carts, rollerblades, and so on. Everyone wins. Similarly, accessible Web applications have a major impact on everyone: sites are easier to navigate, to search, to repurpose, and can be viewed on a wide variety of devices. You'll notice that many of the W3C's accessibility guidelines are just good general design principles! Bottom line: accessibility makes the Web better. I also think it is quite feasible to make our sites--and our JavaScript toolkits--accessible to a broad range of needs and abilities. I'm working on the Fluid Project, which is dedicated to improving DHTML usability and accessibility. Excitingly, we just received a grant from the Mozilla Foundation to help the jQuery community make jQuery more accessible. We hope this will include keyboard navigation, ARIA semantics for assistive technologies, high contrast support, and more. Colin On 15-Feb-08, at 4:41 PM, Chris wrote: > (Also, keep in mind that accessibility isn't only for the benefit of > people with disabilities: Having an accessible site is one of the most > robust search engine optimization strategies.) --- Colin Clark Technical Lead, Fluid Project http://fluidproject.org
[jQuery] Re: Taconite + Jframe + forms = weird problem
That does make sense. Thanks Mike. However, any idea why it works fine with a regular link? In the example link I provided, the link in there also has a TARGET to the same element and the response from the server is also XML. Yet, that one works fine... Peter :) On Feb 14, 5:43 am, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > The problem is the use of the 'target' option with the ajaxForm call within > the jFrame plugin. That option is meant to target the server response to a > particular element in the document. But your server response is an XML > document, not HTML, and that cannot be inserted wholesale into the current > doc. > > Mike > > On Wed, Feb 13, 2008 at 7:28 PM, lvp1138 <[EMAIL PROTECTED]> wrote: > > > We are currently designing a very dynamic application, and we thought > > we could use Jframe, from > >http://garage.pimentech.net/scripts_doc_jquery_jframe/, > > to do ajax calls instead of having to write jquery ajax calls code for > > forms, DIVs, etc, that we constantly remove and add to the DOM. > > > It works excellent with regular links, however, it seems to have a > > problem with forms. Here's an example: > > >http://72.18.207.149/english/taconite-test.html > > > When you click on the link, the result of the link is displayed on a > > DIV at the bottom. This is done by jframe without any need for ajax > > calls. The response is XML and formatted for the popular taconite, and > > it is just a simple SlideToggle. You can see the code in Firebug. > > > However, when submitting a form to the same link, which responds with > > the same Taconite formatted XML, it fails and Firebug shows: > > > Node cannot be inserted at the specified point in the hierarchy. code: > > 3. > > > I would be willing to not use Jframe for the forms, however, how do I > > add such ajax calls to forms that are being added into the DOM > > dynamically? > > > I hope someone can help... I've been burning my neural cells with this > > problem for quite a while... > > > Peter :)
[jQuery] Star Rating plugin
This is a great plugin but dont work with 1.2.1 version of jquery. Are someone using this plugin? -- []´s Jean www.suissa.info Ethereal Agency www.etherealagency.com
[jQuery] Re: jQuery UI bug (sortable)
Roy, Is this a question or a statement? If it's a statement, please provide an example and better explanation. Also, please post UI issues on the UI mailing list found here: http://groups.google.com/group/jquery-ui Rey Roy wrote: when using sortable with options "connectWith", it will have IE z- index bug.
[jQuery] Re: I need some help with basic thing
The problem here is that you are bind the "click" handler to "#addsuggest2" when the document is first loaded, but that element doesn't get created until you click on "#addsuggest" Unlike with CSS, which allows you to set styles for non-existent elements that will be automatically applied if the elements are created at a later time, JavaScript events don't work that way. There is a plugin, called LiveQuery, which you might want to investigate, because it "listens" for elements added to the document and applies event handlers to them as appropriate. However, in your case, you could solve your problem with a simple rearrangement of your code: $('a#addsuggest').click(function() { $('adda>').appendTo('#message').click(function() { alert('working'); }); }); Add Note here that I used appendTo, which adds to whatever is already in "#message". If you wish to replace the contents, you could precede that line with this: $('#message').empty(); Hope that helps, --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 16, 2008, at 7:40 AM, FrEaKmAn wrote: $('a#addsuggest2').click(function() { alert('working'); }); $('a#addsuggest').click(function() { //alert('working'); $('#message').html('add'); }); Add what is wrong? When I click on second add link (addsuggest2) nothing happens
[jQuery] Re: tabs: replacing the content without switching the selected tab
Thanks, Klaus. Another 5 star post. - On Feb 15, 6:20 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote: > Try: > > $('#replaceContent').click(function() { > $('#tabcontent div.ui-tabs-panel:visible').html('hello'); > > }); > > --Klaus > > On Feb 15, 11:24 pm, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > Hi, > > > Let's say I have these tabs and code that makes them so ... > > > > > $(function() { > > var tabSelected = $('#tabcontent > ul').tabs() > > }); > > > > > > > > > title="Document">Document > > Add Tabs > span> > > Add Slip Sheets > > > > > > > value="Replace" /> > > > Now I want to click the button "Replace" and put the HTML "hello" into > > the same place where the currently selected tab content is. However, > > I do not want to have a different tab selected. > > > How can I code this button? > > > Thanks, - Dave- Hide quoted text - > > - Show quoted text -
[jQuery] Re: Change stylesheets if images are off
Oops, set typing in motion before engaging brain Setting 'On' will defeat the object :o What I mean to say is, I set the initial css to 'gotimages'. I still sometimes see a flash of the 'noimages' style (on a slow connection, with cache disabled) and will certainly be delighted if anyone comes up with a kosher solution! Cherry :) http://jquery.cherryaustin.com On Feb 16, 2:04 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > The problem here is your .load callback will get called at some point in the > future, when the image finishes loading. However, the next line will get > executed immediately, without waiting for that. While this may work in some > cases (perhaps your tests), it may not if the image is too large or if the > server is slow in responding, for example. So, I don't think this is a good > test. > > > (hack: there is a hidden paragraph to hold the 'variable') > > A simple variable here works just as well: > > var imgOn = false; > > $('' > ).load(function() { > $('#noimages').attr("href", '/styles/gotimages.css'); > imgOn = true; > > }); > > alert(imgOn); > > But you have the same problem as above: your alert could very well fire > before the image is loaded, and the callback fired. > > - Richard
[jQuery] Re: Is this possible with jQuery?
Johny, there are some things you can try - see this thread for ideas? http://groups.google.com/group/jquery-en/browse_frm/thread/5ec2f96cc15f03d4# On Feb 16, 7:47 am, Johny <[EMAIL PROTECTED]> wrote: > Hi, > I have a website with some images.The size of these pictures are ok > for the most of users but some of users, who use higher screen > resolution, complain about the poor quality picture details. > > Would it be possible to use jQuery to enlarge pictures depending on > users screen resolution? > Or what other solution would you suggest? > > Thank you for your help > L.
[jQuery] Re: IE/Opera problem using ClueTip
Hi, Sorry you're having problems with the plugin. I'm wondering if you could help me troubleshoot a bit. Could you try pulling out the onActivate and onShow function options and see what happens? Also, I'd suggest moving some of the arrow background info to the stylesheet. Unrelated to your question -- you're using a transparent PNG image for the arrows. These will not work as expected in IE 6 unless you you use a filter css hack in your stylesheet or a pngfix plugin. thanks, --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 16, 2008, at 4:58 AM, fshuja wrote: i was using clueTip to create a tooltip like netflix. i just ClueTip's ajax based approach to load other html files in tooltip. its working perfect in FF but not in IE and asked for username/pass in Opera. please check the link http://www.unirazz.com/tooltip.html thnx
[jQuery] Re: Suggestions for the validation plugin
I've created them here... #1: Ignore fields without a method specified http://plugins.jquery.com/node/1601 #2: Accept custom messages from rules option http://plugins.jquery.com/node/1602 ...but I wasn't able to assign them to you (no permission I believe). Thanks, Diego On Feb 15, 5:48 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote: > Diego A. schrieb:> What do you think? > > Could you file tickets for those? Just put [validate] into the title, > label it as an enhancement and assign it to "joern". Thanks! > > Jörn
[jQuery] Re: is there a tab-indexer plugin?
Like magic :)) Thanks, Dennis! On Feb 16, 4:26 pm, spinnach <[EMAIL PROTECTED]> wrote: > try this: > > $('a').each(function(i,e){ >$(this).attr('tabindex', i); > > }); > > dennis. > > [EMAIL PROTECTED] wrote: > > > or does anyone know how to make one? Something that will incrementally > > number the tabindexes for all the hrefs on a page? It's a shot in the > > dark, but worth trying to save all that effort! > > Cherry :) > > >http://jquery.cherryaustin.com
[jQuery] Re: is there a tab-indexer plugin?
try this: $('a').each(function(i,e){ $(this).attr('tabindex', i); }); dennis. [EMAIL PROTECTED] wrote: or does anyone know how to make one? Something that will incrementally number the tabindexes for all the hrefs on a page? It's a shot in the dark, but worth trying to save all that effort! Cherry :) http://jquery.cherryaustin.com
[jQuery] is there a tab-indexer plugin?
or does anyone know how to make one? Something that will incrementally number the tabindexes for all the hrefs on a page? It's a shot in the dark, but worth trying to save all that effort! Cherry :) http://jquery.cherryaustin.com
[jQuery] Re: a small accessibility rant
On Feb 16, 8:49 am, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > On Feb 15, 2008 8:47 PM, Chris <[EMAIL PROTECTED]> wrote: > > On second thought... what event, exactly, is supposed to trigger this? > > Where is my onfontsizechange? > > See http://davecardwell.co.uk/javascript/jquery/plugins/jquery-em/ Genius! Thanks, Richard! Chris
[jQuery] Re: Change stylesheets if images are off
Oops, set typing in motion before engaging brain Setting 'On' will defeat the object :o Stupid idea! On Feb 16, 2:04 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > On Feb 15, 2008 6:55 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > wrote: > > > > > > > I finally finished it > > > // detect whether images are on > > // and change styles accordingly > > jQuery.imagesOn = function(){ > > > $(' > >' ).load(function() { > > $('#noimages').attr("href", '/styles/gotimages.css'); > > $('.imagecheck').html('On'); > > }); > > > if ( $('.imagecheck').val() != 'On' ) { > > $('#noimages').attr("href", '/styles/imagefree.css'); > > } > > } > > The problem here is your .load callback will get called at some point in the > future, when the image finishes loading. However, the next line will get > executed immediately, without waiting for that. While this may work in some > cases (perhaps your tests), it may not if the image is too large or if the > server is slow in responding, for example. So, I don't think this is a good > test. > > > (hack: there is a hidden paragraph to hold the 'variable') > > A simple variable here works just as well: > > var imgOn = false; > > $('' > ).load(function() { > $('#noimages').attr("href", '/styles/gotimages.css'); > imgOn = true; > > }); > > alert(imgOn); > > But you have the same problem as above: your alert could very well fire > before the image is loaded, and the callback fired. > > - Richard
[jQuery] Re: Change stylesheets if images are off
You're right about the imagefree stylesheet trying to load, the hack helps here! You can set its initial value to 'On' ;) There is a flash effect if you then switch between images on & off. (Not likely to happen in production, though far from ideal of course). I absolutley couldn't get this to work, using a proper returned variable. I don't know why this is; it's currently the bane of my life. Am reading more about jQuery callbacks & chaining, as I must be missing something If anybody feels kind enough to fix this solution so it works withut hacks, PLEASE post it!! Cheers :) Cherry. On Feb 16, 2:04 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > > The problem here is your .load callback will get called at some point in the > future, when the image finishes loading. However, the next line will get > executed immediately, without waiting for that. While this may work in some > cases (perhaps your tests), it may not if the image is too large or if the > server is slow in responding, for example. So, I don't think this is a good > test. > > > (hack: there is a hidden paragraph to hold the 'variable') > > A simple variable here works just as well: > > var imgOn = false; > > $('' > ).load(function() { > $('#noimages').attr("href", '/styles/gotimages.css'); > imgOn = true; > > }); > > alert(imgOn); > > But you have the same problem as above: your alert could very well fire > before the image is loaded, and the callback fired. > > - Richard
[jQuery] Re: jQuery Cycle Plugin help needed
You're absolutely right ... I knew it was going to be something simple that I'm too dense to catch! :-) Thanks so much!!! Nathan On Feb 16, 8:53 am, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > > it looks like I'm a little late to the game on this thread, but I > > found it via google, and you guys seem to know what you're talking > > about :-) > > > I'm trying to get this to work on a WordPress theme that I'm > > developing for my site, but for some reason it just won't work. I'm > > new to jQuery, but this should be pretty straightforward. > >http://www.nathanrice.net/?wptheme=NR2.0 > > You need to load the jQuery script *before* any plugin scripts. And you > should probably be using Firefox with Firebug so that you could see these > errors right away. They jump right out at you with the proper tools.
[jQuery] Re: I need some help with basic thing
just as info, I have included all jquery files + jquery code is in $(document).ready(function(){ code here... });
[jQuery] Re: a small accessibility rant
That told me. I'll download it this minute! Sorry. On Feb 16, 12:51 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote: > Just a quick note, jQuery.Accessible's main use is not the validator > shown in the demo, that's just an addition. What I really wished to do > is to actually improve accessibility with slight modifications of the > dom. The plugin doesn't have many of those, 2 or 3. I hoped some > people would contribute, but well :) > > Well, that's it. > Cheers > > Ariel Flesler
[jQuery] Re: div select and change it's css
> jQuery being what it is, there's bound to be a way of doing > this in one line, though :) $(this).addClass("highlight").siblings().removeClass("highlight") ...that saves a document wide search for $(".section") Geoge
[jQuery] Re: a question about simple manipulation
learn demos on http://docs.jquery.com/Manipulation :) On Feb 16, 9:08 pm, amir abbas <[EMAIL PROTECTED]> wrote: > hi everybody > i want to add some html character to end of all links. > i want to add three before each link closing tag > my links are like this > > http://jquery.com>jquery > > i want to change it to > > http://jquery.com>jquery > > is it possible to do something like this in jquery ? > thanks in advance.
[jQuery] Re: Change stylesheets if images are off
On Feb 15, 2008 6:55 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I finally finished it > > // detect whether images are on > // and change styles accordingly > jQuery.imagesOn = function(){ > > $(' >' ).load(function() { > $('#noimages').attr("href", '/styles/gotimages.css'); > $('.imagecheck').html('On'); > }); > > if ( $('.imagecheck').val() != 'On' ) { > $('#noimages').attr("href", '/styles/imagefree.css'); > } > } The problem here is your .load callback will get called at some point in the future, when the image finishes loading. However, the next line will get executed immediately, without waiting for that. While this may work in some cases (perhaps your tests), it may not if the image is too large or if the server is slow in responding, for example. So, I don't think this is a good test. > (hack: there is a hidden paragraph to hold the 'variable') A simple variable here works just as well: var imgOn = false; $('' ).load(function() { $('#noimages').attr("href", '/styles/gotimages.css'); imgOn = true; }); alert(imgOn); But you have the same problem as above: your alert could very well fire before the image is loaded, and the callback fired. - Richard
[jQuery] Re: jQuery Cycle Plugin help needed
> it looks like I'm a little late to the game on this thread, but I > found it via google, and you guys seem to know what you're talking > about :-) > > I'm trying to get this to work on a WordPress theme that I'm > developing for my site, but for some reason it just won't work. I'm > new to jQuery, but this should be pretty straightforward. > http://www.nathanrice.net/?wptheme=NR2.0 You need to load the jQuery script *before* any plugin scripts. And you should probably be using Firefox with Firebug so that you could see these errors right away. They jump right out at you with the proper tools.
[jQuery] Re: a small accessibility rant
On Feb 15, 2008 8:47 PM, Chris <[EMAIL PROTECTED]> wrote: > > In a moment of delusion on Feb 15, 11:49 am, I wrote: > > > if (parseInt($("body").css("fontSize")) > 20) { // font-size in pixels > > > > // replace img with higher res source > > > > } > > On second thought... what event, exactly, is supposed to trigger this? > Where is my onfontsizechange? See http://davecardwell.co.uk/javascript/jquery/plugins/jquery-em/ - Richard
[jQuery] the Return of "Validation Plugin - hows to only fire on form submit? "
Hi, I find an old post : http://groups.google.com/group/jquery-en/browse_thread/thread/cf34a35e202d9707/4fb5e88f4c81127a?lnk=gst&q=fire+submit# which use this method to show error only on sbumit : var validator = $("form").validate( { onblur: function(){}, onkeyup: function(el) { if(validator.check(el)) $ (el).removeClass(validator.settings.errorClass); else $(el).addClass(validator.settings.errorClass); }, showErrors: function(errors) { alert("should only fire on submit"); } }); Is there a way to do this in validate plugin 1.2.1 ?
[jQuery] Re: How to dynamically load jQuery plugins?
Try this http://docs.jquery.com/Ajax/jQuery.getScript
[jQuery] Re: jQuery Cycle Plugin help needed
it looks like I'm a little late to the game on this thread, but I found it via google, and you guys seem to know what you're talking about :-) I'm trying to get this to work on a WordPress theme that I'm developing for my site, but for some reason it just won't work. I'm new to jQuery, but this should be pretty straightforward. http://www.nathanrice.net/?wptheme=NR2.0 I have the script call in the head section, and I've got the necessary code: $(document).ready(function() { $('#s2').cycle({ fx: 'fade', speed: 'normal', timeout: 6000 }); }); plus the markup: http://www.nathanrice.net/themes/rockinbizred/";> http://www.nathanrice.net/themes/stripped/";> In theory this should be working, but it's not. Any help would be much appreciated. Thanks! Nathan On Jan 25, 6:18 pm, visitorQ <[EMAIL PROTECTED]> wrote: > thanks mike i'll try that and get back to you guys! you're all > great > > On Jan 25, 3:40 pm, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > > > > image and have it say 'read article >' and a user could click it. then > > > when the image fades, the link does also, until the next image fades > > > in, with it's own text link to its own article. i'm not having much > > > luck since i need to write each link it's own class in the stylesheet > > > because they need to be positioned a little differently from eachother > > > over their images. how would i do this? the plugin doesn't like to see > > > div tags after each image. it doesn't like it when i put text within > > > the image tags. what do you think i should do? > > > Q, you just need to think outside the box a little bit. The thing to > > remember is thatCyclewill treat each immediate child element of the > > container as a slide. A slide can be whatever you want (img, div, p, etc) > > and can contain whatever you need. For example: > > > > > > > > > Whatever > > blah blah blah > > > > > > > > Whatever > > blah blah blah > > > > > > > The markup above would drive a two-slide slideshow. You then just need to > > apply the appropriate CSS to the container and slides to make your markup > > bow to your will. > > > Mike
[jQuery] a question about simple manipulation
hi everybody i want to add some html character to end of all links. i want to add three before each link closing tag my links are like this http://jquery.com>jquery i want to change it to http://jquery.com>jquery is it possible to do something like this in jquery ? thanks in advance.
[jQuery] Re: Slideshow for divs (with AJAX?)
On Thu, Feb 14, 2008 at 01:24:40PM -0800, Ariel Flesler wrote: > The newborn: http://plugins.jquery.com/project/SerialScroll Very nice, Ariel. This is pretty close to what I'm looking for. Is there a way to use it with AJAX? I'm trying to build a paginated view where the user can click on the right arrow, a new DIV is loaded from the web service and then scrolled to the left. Think of it as a slideshow where the DIVs are not yet present in the HTML page (perhaps even with preloading the images in the new DIV). I also experimented with the "cycle" plugin but wasn't very successful. Has anyone perhaps done something like that? Kindly Christoph -- [EMAIL PROTECTED] www.workaround.org JID: [EMAIL PROTECTED] gpg key: 79CC6586 fingerprint: 9B26F48E6F2B0A3F7E33E6B7095E77C579CC6586
[jQuery] I need some help with basic thing
$('a#addsuggest2').click(function() { alert('working'); }); $('a#addsuggest').click(function() { //alert('working'); $('#message').html('add'); }); Add what is wrong? When I click on second add link (addsuggest2) nothing happens
[jQuery] IE/Opera problem using ClueTip
i was using clueTip to create a tooltip like netflix. i just ClueTip's ajax based approach to load other html files in tooltip. its working perfect in FF but not in IE and asked for username/pass in Opera. please check the link http://www.unirazz.com/tooltip.html thnx
[jQuery] Re: jquery tablesorter 2.0.1 with tr in thead
I had the same problem. This happens because cells are assigned as sorters for columns based on their index in the order they are declared. So for example, the 5th is assigned to the 5th column. If you use multiple header rows, colspans and rowspans then the indexes become misaligned. What this really needs is an elegant solution that calculates a best guess for each column taking into account rowspans and colspans but in the meantime there are two relatively easy workarounds. The first is to replace elements that should not be sortable with elements. You can assign them a class such as .th and style them up to look like header cells. If you don't want to mess around with your markup then I have written a small modification for the tablesorter that allows you to use metadata to specifically assign elements to certain columns. You just need to add something like class="{sortIndex: 5}" to your elements. Then you need to replace the buildHeaders function with the following: function buildHeaders(table) { if(table.config.debug) { var time = new Date(); } var meta = ($.metadata) ? true : false, tableHeadersRows = []; for(var i = 0; i < table.tHead.rows.length; i++) { tableHeadersRows[i]=0; }; $tableHeaders = $("thead th",table); $tableHeaders.each(function(index) { var sortIndex; if($.metadata && $(this).metadata().sortIndex) { sortIndex = $(this).metadata().sortIndex; } else { sortIndex = index; } this.count = 0; this.column = sortIndex; this.order = formatSortingOrder(table.config.sortInitialOrder); if(checkHeaderMetadata(this) || checkHeaderOptions(table,sortIndex)) this.sortDisabled = true; if(!this.sortDisabled) { $(this).addClass(table.config.cssHeader); } // add cell to headerList table.config.headerList[sortIndex]= this; }); if(table.config.debug) { benchmark("Built headers:", time); log($tableHeaders); } return $tableHeaders; }; Scott-221 wrote: > > > I have a complex table header that contains multiple elements in > the . An example is at http://donpoo.net/jquery/. The table > renders okay but sorting doesn't work correctly. Clicking on the > "Latency (ms)" column in the "Totals" group results in the column "Ops/ > s" in the "Read" group to get sorted. > > I think this is due to using col spans with multiple elements in > the . Is there a patch I can test out or does anyone have a > suggestion on how to fxi? > > -- View this message in context: http://www.nabble.com/jquery-tablesorter-2.0.1-with-tr-in-thead-tp15392363s27240p15502443.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: fastest way to load both jquery & thickbox
thanks for the help charles. I can't for the life of me get the minify working. I've got some screenshots up of my folder structure and the code i'm using here - http://www.vocle.com/pic.html i've gone over and over the user guide trying every way of getting it working but i can't get my css and javascripts to load through the minify.php? am i not doing something properly?
[jQuery] Re: jQuery Cycle Plugin help needed
testing ... On Jan 25, 6:18 pm, visitorQ <[EMAIL PROTECTED]> wrote: > thanks mike i'll try that and get back to you guys! you're all > great > > On Jan 25, 3:40 pm, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > > > > image and have it say 'read article >' and a user could click it. then > > > when the image fades, the link does also, until the next image fades > > > in, with it's own text link to its own article. i'm not having much > > > luck since i need to write each link it's own class in the stylesheet > > > because they need to be positioned a little differently from eachother > > > over their images. how would i do this? the plugin doesn't like to see > > > div tags after each image. it doesn't like it when i put text within > > > the image tags. what do you think i should do? > > > Q, you just need to think outside the box a little bit. The thing to > > remember is that Cycle will treat each immediate child element of the > > container as a slide. A slide can be whatever you want (img, div, p, etc) > > and can contain whatever you need. For example: > > > > > > > > > Whatever > > blah blah blah > > > > > > > > Whatever > > blah blah blah > > > > > > > The markup above would drive a two-slide slideshow. You then just need to > > apply the appropriate CSS to the container and slides to make your markup > > bow to your will. > > > Mike
[jQuery] returning variable from extension function
I know little about variable scope, have been reading up on OOP, but I don't understand why this would not work. I tried inserting "return objectArray" in various places to no avail... $('#button1').click(function(b){ $().loadXML2array('url','var'); alert(objectArray); // does not work }); jQuery.fn.extend({ loadXML2array: function(url,variable) { return this.each(function() { $.get(url,{xml:variable}, function(data){ objectArray = new Array(); $(data).find('row').each(function(i){ rowObj = new Object(); rowObj.col1 = $(this).children('col_1').text(); rowObj.col2 = $(this).children('col_2').text(); rowObj.col3 = $(this).children('col_3').text(); objectArray.push(rowObj); }); }); }); } });
[jQuery] Is this possible with jQuery?
Hi, I have a website with some images.The size of these pictures are ok for the most of users but some of users, who use higher screen resolution, complain about the poor quality picture details. Would it be possible to use jQuery to enlarge pictures depending on users screen resolution? Or what other solution would you suggest? Thank you for your help L.
[jQuery] jQuery UI bug (sortable)
when using sortable with options "connectWith", it will have IE z- index bug.
[jQuery] Re: a small accessibility rant
In a moment of delusion on Feb 15, 11:49 am, I wrote: > if (parseInt($("body").css("fontSize")) > 20) { // font-size in pixels > > // replace img with higher res source > > } On second thought... what event, exactly, is supposed to trigger this? Where is my onfontsizechange? --Chris
[jQuery] why would an extension function not return the value?
I posed something similar before, and got some good anwers, so I am trying again because I'm still stuck... $('#button1').click(function(b){ $().loadXML2array('url','var'); alert(objectArray); });
[jQuery] Re: div select and change it's css
Here is what I have, but the key event do not work? .section { border:1px solid silver; background:#EEE; margin:-5px; } .highlight { border: 1px solid red; background: #FFCC99; } $(function(){ // selected Item function var selectedItem = null; var setSelectedItem = function(item) { selectedItem = item; if (selectedItem === null){ return; } if (selectedItem < 0) { selectedItem = 0; } if (selectedItem >= $('ul .switcher').find('li').length){ selectedItem = $('ul .switcher').find('li').length - 1; } $(' ul .switcher').find('li').removeClass('highlight') .eq(selectedItem).addClass('highlight'); }; // key events up/down $('ul .switcher li').keyup(function(event) { if (event.keyCode == 38 && selectedItem !== null){ //user pressed up arrow setSelectedItem(selectedItem - 1); alert('up'); } else if (event.keyCode == 40 && selectedItem !== null){ //user pressed up arrow setSelectedItem(selectedItem + 1); } else if (event.keyCode == 27 && selectedItem !== null){ //user pressed esc key setSelectedItem(null); } }); $('.switcher li').click(function() { $('.switcher .section').removeClass('highlight'); $(this).addClass('highlight'); setSelectedItem($(this).length); alert($(this).length); }); }); Stuff Stuff2 Stuff3 Stuff4 Stuff5 On Feb 16, 6:48 am, yabado <[EMAIL PROTECTED]> wrote: > Can someone suggest a way to add some keycode events to this? > > up-arrow and down-arrow actions? > > On Feb 16, 6:31 am, yabado <[EMAIL PROTECTED]> wrote: > > > Michael, > > > I had to change some things but this works... > > > > > $(function(){ > > > $('#switcher .section').click(function() { > > $('#switcher .section').removeClass('highlight'); > > $(this).addClass('highlight'); > > > }); > > }); > > > > > > On Feb 15, 8:46 am, Michael Price <[EMAIL PROTECTED]> wrote: > > > > yabadowrote: > > > > Stuff > > > > Stuff > > > > Stuff > > > > Stuff > > > > Stuff > > > > If this isn't pseudo-code then you've got your IDs and classes the wrong > > > way round here, I think... > > > > Anyway, the way I usually do it (and someone will be along shortly with > > > a better method, I don't doubt, but it works for me) is have the CSS for > > > the highlight in a new class. Then on click I REMOVE this class from all > > > of them, then I ADD the class to the clicked DIV. Code for basic idea > > > follows: > > > > $(".section").click(function() { > > > $(".section").removeClass(".highlight"); > > > $(this).addClass(".highlight"); > > > > } > > > > jQuery being what it is, there's bound to be a way of doing > > > this in one line, though :) > > > > Regards, > > > Michael Price
[jQuery] Re: How to dynamically load jQuery plugins?
Read the documentation for jQuery.getScript(); it does exactly what you want. On Feb 15, 12:12 pm, Nazgulled <[EMAIL PROTECTED]> wrote: > Hi, > I make good use of various jQuery plugins that are available, however, > I don't like the idea of having the tag of the page filled with >
[jQuery] Re: a small accessibility rant
Just a quick note, jQuery.Accessible's main use is not the validator shown in the demo, that's just an addition. What I really wished to do is to actually improve accessibility with slight modifications of the dom. The plugin doesn't have many of those, 2 or 3. I hoped some people would contribute, but well :) Well, that's it. Cheers Ariel Flesler On Feb 14, 4:51 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Wow, I really appreciate both of your quick replies! > > Benjamin, I have seen yours & Richard's contributions - knowing I'm > not all alone is what's keeping me motivated ;) > > From the accessibility plugin's demo page, it serves an accessibility > reminder. Which is a start :) > > @JMoore - my point is this: My friend's computer is *her* computer. > How can it be right to say she shouldn't choose to make use of its > built-in capabilities to read what's on the screen?? > You may as well say that using a magnifier to read the newspaper is a > hack . > > On Feb 14, 6:23 pm, "Benjamin Sterling" > > > > <[EMAIL PROTECTED]> wrote: > > Cherry, > > There are quite a few of us that would agree with you, Richard Worth and > > myself to name two, there is plugin but could not find it right away that > > help with accessibility. Everything I do has to be 508 compliant and not > > just because I feel it is the right thing to do, but I would with the Gov't, > > ie. epa, army.mil, and so on. So I understand your point of view and the > > best suggestion is to keep doing what you are doing and always keep > > accessibility on the front burner. > > -- > > Benjamin > > Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.comhttp://www.benjam...- > > Hide quoted text - > > - Show quoted text -
[jQuery] Re: div select and change it's css
Can someone suggest a way to add some keycode events to this? up-arrow and down-arrow actions? On Feb 16, 6:31 am, yabado <[EMAIL PROTECTED]> wrote: > Michael, > > I had to change some things but this works... > > > $(function(){ > > $('#switcher .section').click(function() { > $('#switcher .section').removeClass('highlight'); > $(this).addClass('highlight'); > > }); > }); > > > > On Feb 15, 8:46 am, Michael Price <[EMAIL PROTECTED]> wrote: > > > yabadowrote: > > > Stuff > > > Stuff > > > Stuff > > > Stuff > > > Stuff > > > If this isn't pseudo-code then you've got your IDs and classes the wrong > > way round here, I think... > > > Anyway, the way I usually do it (and someone will be along shortly with > > a better method, I don't doubt, but it works for me) is have the CSS for > > the highlight in a new class. Then on click I REMOVE this class from all > > of them, then I ADD the class to the clicked DIV. Code for basic idea > > follows: > > > $(".section").click(function() { > > $(".section").removeClass(".highlight"); > > $(this).addClass(".highlight"); > > > } > > > jQuery being what it is, there's bound to be a way of doing > > this in one line, though :) > > > Regards, > > Michael Price
[jQuery] Re: div select and change it's css
Michael, I had to change some things but this works... $(function(){ $('#switcher .section').click(function() { $('#switcher .section').removeClass('highlight'); $(this).addClass('highlight'); }); }); On Feb 15, 8:46 am, Michael Price <[EMAIL PROTECTED]> wrote: > yabadowrote: > > Stuff > > Stuff > > Stuff > > Stuff > > Stuff > > If this isn't pseudo-code then you've got your IDs and classes the wrong > way round here, I think... > > Anyway, the way I usually do it (and someone will be along shortly with > a better method, I don't doubt, but it works for me) is have the CSS for > the highlight in a new class. Then on click I REMOVE this class from all > of them, then I ADD the class to the clicked DIV. Code for basic idea > follows: > > $(".section").click(function() { > $(".section").removeClass(".highlight"); > $(this).addClass(".highlight"); > > } > > jQuery being what it is, there's bound to be a way of doing > this in one line, though :) > > Regards, > Michael Price
[jQuery] Re: div select and change it's css
Thanks, exactly what I needed. :-) On Feb 15, 8:46 am, Michael Price <[EMAIL PROTECTED]> wrote: > yabadowrote: > > Stuff > > Stuff > > Stuff > > Stuff > > Stuff > > If this isn't pseudo-code then you've got your IDs and classes the wrong > way round here, I think... > > Anyway, the way I usually do it (and someone will be along shortly with > a better method, I don't doubt, but it works for me) is have the CSS for > the highlight in a new class. Then on click I REMOVE this class from all > of them, then I ADD the class to the clicked DIV. Code for basic idea > follows: > > $(".section").click(function() { > $(".section").removeClass(".highlight"); > $(this).addClass(".highlight"); > > } > > jQuery being what it is, there's bound to be a way of doing > this in one line, though :) > > Regards, > Michael Price
[jQuery] Re: Change stylesheets if images are off
Interesting idea Cherry, Have you noticed whether the imagefree.css starts to load anyway before the href is changed to gotimages.css? (I'd expect the if- statement to run before the load() callback function). In IE you could try the error event as the alternative condition. Can't remember what the alternative would be in FF etc. Also, to save on markup could you use a closure for your imagecheck value instead of an element? (eg: var imagecheck = false; at the start of your imagesOn function) Just some initial thoughts. Cheers, George On Feb 15, 11:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I finally finished it > > // detect whether images are on > // and change styles accordingly > jQuery.imagesOn = function(){ > > $('' > ).load(function() { > > $('#noimages').attr("href", '/styles/gotimages.css'); > $('.imagecheck').html('On'); > }); > > if ( $('.imagecheck').val() != 'On' ) { > $('#noimages').attr("href", '/styles/imagefree.css'); > } > > } > > (hack: there is a hidden paragraph to hold the 'variable') > > Cherryhttp://jquery.cherryaustin.com