[jQuery] Re: Better way to trim whitespace from input?
ok, one more shorter try: it works! $(document).ready(function(){ $(#couponCode).blur(function(){ $(#couponCode).val($(this).val().toUpperCase().replace(/\s+ $/,'')); }); }); On May 13, 12:53 pm, jckos johncar...@gmail.com wrote: Hi, I need to transform all characters entered in an input field to uppercase and trim trailing whitespace. This script works, but I'm wondering if there's a better way to do it. script $(document).ready(function(){ $(input).keyup(function (e) { $(#couponCode).val($(this).val().toUpperCase()); }); $(button).click(function () { var couponCode = $(#couponCode).val(); couponCode = jQuery.trim(couponCode); }); }); /script Any suggestions? Thanks in advance.
[jQuery] Re: .ajax GET not working correctly at webhost
I can check that, but as I said before, it works perfectly fine on my local webserver, it's when the script is run on my webhost the issue occurs. The database seems to be very slow there at the moment. Ill check with firebug and post the results here. On May 14, 9:00 pm, James james.gp@gmail.com wrote: Sorry, I mean all HTTP header data. On May 14, 9:00 am, James james.gp@gmail.com wrote: Have you tried using the Firebug add-on for Firefox to debug whether the AJAX request was actually sent in the first place? It's very helpful because it'll show you the exact URL that it requests, the GET/POST data it sends, all HTTP data, and the response you receive. On May 13, 8:21 pm, Nahaz pierre.christoffer...@gmail.com wrote: Ah sorry about that. It doesn't cause an error, it looks like it sends data because ? nick=nick appears in your url but it does not get into the database somehow. If you call /data.php?nick=nick it will work, it's when it's called via $.ajax(); that the issue occurs. I havn't confirmed but it seems to occasionally work in IE7 but not FF or Chrome. I also tried to add cache: false and my own random generator to the url but it won't get posted to the url, only the ?nick=nick comes up. I will fix public access after work so you can see the problem in action. On May 13, 8:01 pm, James james.gp@gmail.com wrote: Define what not working correctly means. Does it cause an error? Does the request get sent but nothing happens? Does the request get sent without the GET data? ... etc. On May 12, 12:00 pm, Nahaz pierre.christoffer...@gmail.com wrote: I have this snippet: function ajaxAdd() { $('form').submit(function() { var nick = document.register.nick.value; $(':submit', this).attr('value', 'Adding...'); $(':submit', this).attr('disabled', 'disabled'); $.ajax({ type: 'GET', url: 'data.php', data: 'nick=' + nick, success: function() { $(':submit', this).removeAttr('disabled'); $('#status').load('output.php'); } }); }); } that is sent when a very simple form (one value and button) is sent. The thing is, it works on my local webserver, but when I upload it to my webhost, it wont work. It works if add data.php?nick=Test, then the data will be added into my database but not when called from .ajax.- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: Matching Columns with JQuery
Hi, You're right, I didn't give enough information. Sorry, just a bit of panic setting in on my part! The script works locally on my PC, so here is what I've done - I have created a Wordpress theme called test inside of which is a folder called js. This folder contains two files - jquery-1.2.6.pack and jquery.brenelz.equalHeight As far as I can tell, I've referenced this correctly in the head area of the index file as follows - script type=text/javascript src=?php bloginfo ('template_directory'); ?/js/jquery.brenelz.equalHeight.js/script script type=text/javascript src=http://really-valid-info.com/blog/ wp-content/themes/test/js/jquery-1.2.6.pack.js $(function(){ $('.column').equalHeight(); }); /script This outputs html code as: script type=text/javascript src=http://really-valid-info.com/blog/ wp-content/themes/test/js/jquery.brenelz.equalHeight.js/script script type=text/javascript src=http://really-valid-info.com/blog/ wp-content/themes/test/js/jquery-1.2.6.pack.js $(function(){ $('.column').equalHeight(); }); /script The url is: http://really-valid-info.com/blog/ It seems I've done something wrong though as the script is not getting triggered. I Would appreciate any help to get this working. Myles On May 14, 10:31 pm, MorningZ morni...@gmail.com wrote: 1. No... the file could be named foobar.js for all that matters 2. It's hard to help get your script working without knowing what the issue actually is... doesn't work does not help someone help you On May 14, 12:13 pm, mylessincl...@googlemail.com mylessincl...@googlemail.com wrote: Hello, I came across JQuery when searching for a solution to get matching column height with Divs. I have downloaded JQuery which appears to be one file named jquery-1.3.2.min I also have the following short script that I found, which I believe goes in the head area of the page. The script works with jquery. script language=javascript type=text/javascript src=../../js/ jquery/jquery.js/script script function equalHeight(group) { tallest = 0; group.each(function() { thisHeight = $(this).height(); if(thisHeight tallest) { tallest = thisHeight; } }); group.height(tallest);} $(document).ready(function() { equalHeight($(.column));}); /script I'm a complete novice at Javascript, but hopefully someone can advise on the following questions. 1. I assume I need to rename my download file jquery-1.3.2.min to jquery.js ? 2. Do I need to edit the jquery file somehow in order to get the above script to work? Hope someone can advise. Many thanks Myles- Hide quoted text - - Show quoted text -
[jQuery] Re: A better way of writing this code?
But CSS :hover will not work in IE6. So better use script On May 15, 9:26 am, RobG rg...@iinet.net.au wrote: On May 15, 11:35 am, Calvin cstephe...@gmail.com wrote: Hi, I was able to get this script to work and was wondering if there was a better/proper/more efficient way of writing it. Here is the script: $(document).ready(function() { $('li.a').hover(function() { $(this).addClass('move'); }); $('li.a').mouseLeave(function() { $(this).removeClass('move'); )}; )}; Use the CSS a:hover pseudo-class and set your style rules there, no script required. li a:hover { /* insert rules */ } URL:http://www.w3.org/TR/CSS2/selector.html#x32 -- Rob
[jQuery] Re: How to add a cookie to toggleclass
Hi, use createCookie(key, value) method to store value in cookie. to fetch the stored value in cookie use readCookie(key); method. Karthik. On May 14, 11:10 pm, KD ess33...@yahoo.com wrote: Hi, I'm using Wordpress and each post will have a table. I'm using the following script to allow users to highlight a table cell when they click on it. It works with jQuery ui extension and the effects core plugin: jQuery(document).ready(function() {jQuery(td).click(function() { jQuery(this).toggleClass('highlight', 300);});}); I've been trying to incorporate the cookie plugin (by Klaus Hartl), but have gotten no where. I want users to be able to click on different posts, but would like the highlighted table cells to remain as they click to another post and then come back. Hope that makes sense! Thanks all
[jQuery] Re: A better way of writing this code?
$(function() { $(#myid).hover(function() { // when mouse is over element }, function() { // else }); }); On Fri, May 15, 2009 at 9:22 AM, Karthikraj karthik271...@gmail.com wrote: But CSS :hover will not work in IE6. So better use script On May 15, 9:26 am, RobG rg...@iinet.net.au wrote: On May 15, 11:35 am, Calvin cstephe...@gmail.com wrote: Hi, I was able to get this script to work and was wondering if there was a better/proper/more efficient way of writing it. Here is the script: $(document).ready(function() { $('li.a').hover(function() { $(this).addClass('move'); }); $('li.a').mouseLeave(function() { $(this).removeClass('move'); )}; )}; Use the CSS a:hover pseudo-class and set your style rules there, no script required. li a:hover { /* insert rules */ } URL:http://www.w3.org/TR/CSS2/selector.html#x32 -- Rob
[jQuery] Re: A better way of writing this code?
:hover does work in IE6, it's just limited to a elements. Jonathan Karthikraj wrote: But CSS :hover will not work in IE6. So better use script On May 15, 9:26 am, RobG rg...@iinet.net.au wrote: On May 15, 11:35 am, Calvin cstephe...@gmail.com wrote: Hi, I was able to get this script to work and was wondering if there was a better/proper/more efficient way of writing it. Here is the script: $(document).ready(function() { $('li.a').hover(function() { $(this).addClass('move'); }); $('li.a').mouseLeave(function() { $(this).removeClass('move'); )}; )}; Use the CSS a:hover pseudo-class and set your style rules there, no script required. li a:hover { /* insert rules */ } URL:http://www.w3.org/TR/CSS2/selector.html#x32 -- Rob
[jQuery] Re: A better way of writing this code?
On May 15, 5:22 pm, Karthikraj karthik271...@gmail.com wrote: But CSS :hover will not work in IE6. So better use script Rubbish. The OP wants to use it on an A element, which supports :hover in probably every browser since Navigator and IE 4, if not older. -- Rob
[jQuery] Re: JQGrid...Delete Button?
Hello, Currently It is not possible to put the add/edit/delete in one form. Regards Tony On May 15, 12:01 am, Rick Dwyer rdw...@quick-link.com wrote: Hello List. Playing around with jqgrid and the documentation describes the implementation of bSubmit and a bCancel button. However, how do I display a Submit, Cancel and a Delete button in the same window? So in the code below, I can change bSubmit to a value of Delete, but I lose my Submit value. Adding an extra bSubmit:'Delete', does not work. Is this possible? Thanks, --Rick jQuery.jgrid.edit = { addCaption: Add Record, editCaption: Edit Record, bSubmit: Submit, bCancel: Cancel, processData: Processing..., msg: {
[jQuery] Re: JQGrid...Delete Button?
On May 15, 2009, at 6:49 AM, Tony wrote: Hello, Currently It is not possible to put the add/edit/delete in one form. That's going to be problematic. Thank you though for clarifying. --Rick Regards Tony On May 15, 12:01 am, Rick Dwyer rdw...@quick-link.com wrote: Hello List. Playing around with jqgrid and the documentation describes the implementation of bSubmit and a bCancel button. However, how do I display a Submit, Cancel and a Delete button in the same window? So in the code below, I can change bSubmit to a value of Delete, but I lose my Submit value. Adding an extra bSubmit:'Delete', does not work. Is this possible? Thanks, --Rick jQuery.jgrid.edit = { addCaption: Add Record, editCaption: Edit Record, bSubmit: Submit, bCancel: Cancel, processData: Processing..., msg: {
[jQuery] Conflicts between scripts
Hello, all. I am a fairly new web designer and I have the following attached scripts on my page. Alone, they (lightbox and jQuery/ interface) work great. But together, depending on their order in the head, I get one to work but not the other. Can anyone tell me if I am seriously missing something or using outdated scripts... I am at a loss here. Thanks in advance. !--includes-- script type=text/javascript src=scripts/prototype.js/script script type=text/javascript src=scripts/scriptaculous.js? load=effects,builder/script script type=text/javascript src=scripts/lightbox.js/script !--for lightbox-- script type=text/javascript src=scripts/jquery-1.3.2.min.js/ script script type=text/javascript src=scripts/interface.js/script !--for interface/fisheye-- link href=css/style.css rel=stylesheet type=text/css /!--for interface/fisheye-- link rel=stylesheet href=css/lightbox.css type=text/css media=screen /!--for lightbox-- link rel=shortcut icon href=images/site_logo.ico link href=css/photoshop.css rel=stylesheet type=text/css /!-- for page layout-- !--end includes--
[jQuery] Re: Closing jqModal from inside of content loaded with AJAX
Hi Dude, below is the solution for it: lets say ajax load page contains a href='#' onclick='parent.CloseAjaxPage();'Close Ajax/a And on parent page implement this code: CloseAjaxPage = function(){ $(#modalClose).click(); } I hope this is clear Please let me know if u have any issues Happy JQuerying.. On Thu, May 14, 2009 at 9:08 PM, wardenik radek.anton...@gmail.com wrote: Hi, I have a standard page loaded with jqmodal box that is loading a form via ajax. Now I want to close that modal after submit from the inside of page that was loaded, depending on the form result. I've tried parent.$(.jqmAlert).jqmHide(); and many other versions but I always get h is undefined or some other errors. Maybe somebody had this problem and can give me a hint? Thanks!
[jQuery] problems with each() and JSON
Hi Folks, i have a big roblem with a little getJSON request. At first..this is my code: === HTML === buttondicken ajax-request ausführen!/button ul id=myList /ul /body === JavaScript == $(function(){ $(button).click(function(){ $.getJSON(myJson.js, myCallback); function myCallback (jsonObject){ $(jsonObject.aString).each(function(){ $(#myList).append(li + this + /li); }); } }); }); === The JSON document === { anInt: , aFloat: 55.055, aString: testing, aBoolean: true, anArray: [ 1, 2, 3.34, dog ], anObject: { prop1: a value, prop2: another value, prop3: - }, aNull: null } you can also see this online at http://pattentrick.de/my_jquery_json/index.html So here is finally my problem. I can just get numbers or bools of this JSON document. When i am trying to get a string e.g. nothing happens. No fanncy things, and no errors in my firebug console. I think its a problem with the each() function. I tried everything i could imagine till now. But nothing seems to work. Is there somone in this mailinglist who could help me...please? Kind Regards, The Pattentrick
[jQuery] Conflicts between scripts
Hello, all. I am a fairly new web designer and I have the following attached scripts on my page. Alone, they (lightbox and jQuery/ interface) work great. But together, depending on their order in the head, I get one to work but not the other. Can anyone tell me if I am seriously missing something or using outdated scripts... I am at a loss here. Thanks in advance. !--includes-- script type=text/javascript src=scripts/prototype.js/script script type=text/javascript src=scripts/scriptaculous.js? load=effects,builder/script script type=text/javascript src=scripts/lightbox.js/script !--for lightbox-- script type=text/javascript src=scripts/jquery-1.3.2.min.js/ script script type=text/javascript src=scripts/interface.js/script !--for interface/fisheye-- link href=css/style.css rel=stylesheet type=text/css /!--for interface/fisheye-- link rel=stylesheet href=css/lightbox.css type=text/css media=screen /!--for lightbox-- link rel=shortcut icon href=images/site_logo.ico link href=css/photoshop.css rel=stylesheet type=text/css /!-- for page layout-- !--end includes--
[jQuery] Re: Fairly new to animation. Hold my hand please, hehe?
Hey Ricardo, I thought this might be the case. Nothing to clarify on the jQuery website that I could find. Thanks for the tip - I'll bear that in mind for the future. Cheers, L On May 14, 11:25 pm, Ricardo ricardob...@gmail.com wrote: dude, you can't animate from inline to block. For any width/height animation to work correctly the element needs display:block from the start. On May 14, 10:08 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Hey guys, Got a little script I've written. Would like to animate the appearance of the #sidebar2 to it's new block element state if possible ($ ('#sidebar2').css('display', 'block');). // 'get a quote!' button is clicked $('.contactQuote').click(function(){ $('#content').css('width', '33%'); $('#sidebar2').css('display', 'block'); $('.wpcf7').css('border', '3px solid #6ABC00'); return false; }); $('.wpcf7 input').focus(function(){ $('.wpcf7').css('border', 'none'); }); }); What I've been experimenting with isn't working unfortunately :[ // 'get a quote!' button is clicked $('.contactQuote').click(function(){ $('#content').css('width', '33%'); $('#sidebar2').animate({display: block}, 1000); $('.wpcf7').css('border', '3px solid #6ABC00'); return false; }); $('.wpcf7 input').focus(function(){ $('.wpcf7').css('border', 'none'); }); }); Any tips? Cheers dudes, L
[jQuery] Re: jquery cycle plugin - first cycle not in correct position unless you reload the site
Thanks for your help the issue is solved. One question to Mike: on the jqery site the newest version is 2.34, why did you not put your actual version 2.63 - the one that solved my problem - to the jquery site? Fair question - sorry about the confusion. I don't update that page very often but I just added a note indicating where to find the latest version.
[jQuery] Re: problems with each() and JSON
So here is finally my problem. I can just get numbers or bools of this JSON document. When i am trying to get a string e.g. nothing happens. No fanncy things, and no errors in my firebug console. I think its a problem with the each() function. I tried everything i could imagine till now. But nothing seems to work. Is there somone in this mailinglist who could help me...please? What exactly are you expecting this to do? Essentially, your code is doing the following: var someString = testing. $(someString).each(function() ... each is not going to iterating anything because there is nothing to iterate (unless you have testing elements).
[jQuery] Re: .ajax GET not working correctly at webhost
You need to add return false to your submit handler. $('form').submit(function() { // do ajaxy stuff return false; }); On May 15, 2:25 am, Nahaz pierre.christoffer...@gmail.com wrote: I can check that, but as I said before, it works perfectly fine on my local webserver, it's when the script is run on my webhost the issue occurs. The database seems to be very slow there at the moment. Ill check with firebug and post the results here. On May 14, 9:00 pm, James james.gp@gmail.com wrote: Sorry, I mean all HTTP header data. On May 14, 9:00 am, James james.gp@gmail.com wrote: Have you tried using the Firebug add-on for Firefox to debug whether the AJAX request was actually sent in the first place? It's very helpful because it'll show you the exact URL that it requests, the GET/POST data it sends, all HTTP data, and the response you receive. On May 13, 8:21 pm, Nahaz pierre.christoffer...@gmail.com wrote: Ah sorry about that. It doesn't cause an error, it looks like it sends data because ? nick=nick appears in your url but it does not get into the database somehow. If you call /data.php?nick=nick it will work, it's when it's called via $.ajax(); that the issue occurs. I havn't confirmed but it seems to occasionally work in IE7 but not FF or Chrome. I also tried to add cache: false and my own random generator to the url but it won't get posted to the url, only the ?nick=nick comes up. I will fix public access after work so you can see the problem in action. On May 13, 8:01 pm, James james.gp@gmail.com wrote: Define what not working correctly means. Does it cause an error? Does the request get sent but nothing happens? Does the request get sent without the GET data? ... etc. On May 12, 12:00 pm, Nahaz pierre.christoffer...@gmail.com wrote: I have this snippet: function ajaxAdd() { $('form').submit(function() { var nick = document.register.nick.value; $(':submit', this).attr('value', 'Adding...'); $(':submit', this).attr('disabled', 'disabled'); $.ajax({ type: 'GET', url: 'data.php', data: 'nick=' + nick, success: function() { $(':submit', this).removeAttr('disabled'); $('#status').load('output.php'); } }); }); } that is sent when a very simple form (one value and button) is sent. The thing is, it works on my local webserver, but when I upload it to my webhost, it wont work. It works if add data.php?nick=Test, then the data will be added into my database but not when called from .ajax.- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: [autocomplete] Can I validate and update the entered value before doing the search?
On 5/14/09 8:58 AM, Ulf Renman ulf.ren...@gmail.com wrote: When typing data into the autocomplete-field the list of matches is updated at every key pressed. Is it possible in any way to check and correct the data before doing the match. Or could you alter the way the match is done. The perfect example is when you have lots of users entering decimal values into a filed. Some people uses comma and some decimal-point. So you would like to permit both 2.23 and 2,23 to be matched against 2.23 in the list. I have some other usecases aswell so I would really like some suggestions on this. it allows you to format the suggestions from the backend but i'm not aware of the plugin having any feature for processing the field value before sending it to the backend. can't you do that processing in the backend itself?
[jQuery] Re: problems with each() and JSON
Thanks for your example. Now its working like it should :-D
[jQuery] Superfish menu - drop shadow .png not loading in Firefox and IE
Hi, I've got Superfish set up and running fine, except that the shadow.png isn't showing in Firefox or IE - can't work out why the hell not! Sorry for the noobieness... Cheers in advance, iFlicks www.i-flicks.net Here's the CSS: www.i-flicks.net/superfish.css
[jQuery] activeSlide class doesn't update
Hi Mike, I created slide-show and want to use the pager with auto-transition. So the images will transition, but the user will also have the option to click on a different images. For some reason, when the slideshow works in a auto mode, the activeSlide class doesn't update and changes to the active pager. The class appears only on one image pager, and when the image transition, the class is gone, not moving to the next pager. here is my code: $(function() { $('#slide_wrraper').before('div id=nav').cycle({ fx: 'fade', speed: '2500', timeout: 3500, pager: '#nav' }); }); Any idea why it happens? Thanks, Mor
[jQuery] Re: activeSlide class doesn't update
I checked your website : http://jquery.malsup.com/cycle/int2.html and it seems that when you use the pager, the class doesn't change there as well.
[jQuery] Re: Fairly new to animation. Hold my hand please, hehe?
Think of it logically. To animate a property, the computer needs to work out the in-between stages (tweening) to show: e.g animate width from 10 to 20 = 11,12,13,14, etc to animate opacity from 40% to 100% = 41%, 42%, 43%, etc You can also animate colours*, because behind-the-scenes they go from #00 to #FF = 00, 01, 02..09, 0A, 0B..0F, 10, 11, etc What would you reckon the tweens from inline to block were ? L ldexterldesign wrote: Hey Ricardo, I thought this might be the case. Nothing to clarify on the jQuery website that I could find. Thanks for the tip - I'll bear that in mind for the future. Cheers, L On May 14, 11:25 pm, Ricardo ricardob...@gmail.com wrote: dude, you can't animate from inline to block. For any width/height animation to work correctly the element needs display:block from the start. On May 14, 10:08 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Hey guys, Got a little script I've written. Would like to animate the appearance of the #sidebar2 to it's new block element state if possible ($ ('#sidebar2').css('display', 'block');). // 'get a quote!' button is clicked $('.contactQuote').click(function(){ $('#content').css('width', '33%'); $('#sidebar2').css('display', 'block'); $('.wpcf7').css('border', '3px solid #6ABC00'); return false; }); $('.wpcf7 input').focus(function(){ $('.wpcf7').css('border', 'none'); }); }); What I've been experimenting with isn't working unfortunately :[ // 'get a quote!' button is clicked $('.contactQuote').click(function(){ $('#content').css('width', '33%'); $('#sidebar2').animate({display: block}, 1000); $('.wpcf7').css('border', '3px solid #6ABC00'); return false; }); $('.wpcf7 input').focus(function(){ $('.wpcf7').css('border', 'none'); }); }); Any tips? Cheers dudes, L No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.329 / Virus Database: 270.12.31/2116 - Release Date: 05/15/09 06:16:00
[jQuery] Re: IE: select change triggers pop-up blocker
Is it possible that IE7 8 see html as a reserved word ? Try changing the hmtl variable in both function(html) and $('#nav_admin').html(html) to something else L brian wrote: On Thu, May 14, 2009 at 10:14 PM, brian bally.z...@gmail.com wrote: I have a wee bit of code that handles a select list change to load some content via AJAX. In IE 7 8 (works a treat in 6!), clicking on the select list triggers the pop-up blocker thingy. My code certainly does not open a new window or anything like that: $('#group_nav').change(function() { var group_id = $(this).val(); $.ajax({ url: '/admin/sections/alternative_nodes/' + group_id, success: function(html) { $('#nav_admin').html(html); /* re-bind everything */ adminNavSetup(); } }); return false; }); adminNavSetup() is the function this block of code resides in. However, commenting that out has no effect. Note that the select list doesn't even open; a click is all it takes. Also, no request is made to the server. Anyone have an idea why the pop-up defense would be triggered like that? I forgot to mention that IE says, To see this pop-up or additional options click here... However, there's no way to see this pop-up (which would be nice for debugging because I'd like to know where it's coming from) and I've set the option to Turn off pop-up blocker. However, it continues to badger me with this thing. ~sigh~ Has Firefox reached 75% market share yet? I'm so sick of this crap. No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.329 / Virus Database: 270.12.31/2116 - Release Date: 05/15/09 06:16:00
[jQuery] Re: A better way of writing this code?
as rob said, unless the OP is using the anchor's class itself in conjunction with some other jquery selector at that point, the OP would be better off just using :hover. jquery is awesome, but using it to do stuff CSS already does better is considerably less awesome. On May 15, 9:22 am, RobG rg...@iinet.net.au wrote: On May 15, 5:22 pm, Karthikraj karthik271...@gmail.com wrote: But CSS :hover will not work in IE6. So better use script Rubbish. The OP wants to use it on an A element, which supports :hover in probably every browser since Navigator and IE 4, if not older. -- Rob
[jQuery] Only works in FF
This works great in firefox, why doesn't this work in any other browser? Can the attribute onblur be added another way to work in all browsers? jQuery('#'+nameHex[0].replace(' ','__')+'_qty #'+fields[c].id).attr ('onblur' ,'setQtys();');
[jQuery] How to check if jquery is working?
Hi, I want to try incorporate jquery in my site, but I'm having some problems. The site is drawn together from various files in PHP. I have added the jquery script which I would expect to work fine regardless of the PHPness earlier because it is a client side script. Unfortunately nothing happens. If I save the page directly to my desktop then the script works fine, so I think there must be some problems with the dynamic pages. Does anyone have any idea why this might be occuring? The following is what gets put onto the page in the header if I view source. script type=text/javascript src=jquery.js/script script type=text/javascript $(document).ready(function(){ $(pHello world!/p).appendTo(body); $(#onlineresources).hide(); $(#onlineresourcesbutton).click(function(){ $(#onlineresources).slideDown(slow); return false; }); }); /script Thanks, Josh
[jQuery] JavaScript magician needed
Hi All! I am looking for JavaScript gurus for 4-6 month contract or full-time position. Please send me your resume if you are guru and interested. Best regards Alex
[jQuery] jQuery Countdown, can anyone get it to work??
Hi, I'm messing with http://keith-wood.name/countdown.html I must say it's a very nice script and heads up to anyone who can get it to work. I'm trying to get the basic script to run and countdown for 2 days like in the relative example Here's the last piece of code which is way out, any help appreciated: html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 titlejQuery Countdown/title script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/jquery/1.3.2/jquery.min.js/script script type=text/javascript src=jquery.countdown.js/script script type=text/javascript $(function () { var new Date = new Date(2010, 1 - 1, 1); $('#until2d').countdown({until: '+2d'}); }); /script style type=text/css @import jquery.countdown.css; #countdown { width: 240px; height: 45px; } /style /head body h1jQuery Countdown Basics/h1 pThis page/p pCounting down to 26 January span id=year2010/span./p div id=countdown/div /body /html
[jQuery] Re: Only works in FF
This works great in firefox, why doesn't this work in any other browser? Can the attribute onblur be added another way to work in all browsers? jQuery('#'+nameHex[0].replace(' ','__')+'_qty #'+fields[c].id).attr ('onblur' ,'setQtys();'); jQuery('#'+nameHex[0].replace(' ','__')+'_qty #'+fields[c].id).blur (setQtys);
[jQuery] Re: A better way of writing this code?
On May 15, 3:24 pm, ryan.j ryan.joyce...@googlemail.com wrote: as rob said, unless the OP is using the anchor's class itself in conjunction with some other jquery selector at that point, the OP would be better off just using :hover. jquery is awesome, but using it to do stuff CSS already does better is considerably less awesome. And less efficient which was a primary concern of the OP :)
[jQuery] Re: Conflicts between scripts
There is a problem with loading prototype and jquery on the same page. One trick that you can do is bulk replace in interface.js the '$' with 'jQuery'. Update all your scripts that use jQuery to replace the '$'. Also, remember that on your pages to use 'jquery' rather than '$' when referencing the jquery components/functions. This is b/c you have both prototype and jquery invoked on the same page. On May 15, 1:14 am, jmCom jasonmont...@new.rr.com wrote: Hello, all. I am a fairly new web designer and I have the following attached scripts on my page. Alone, they (lightbox and jQuery/ interface) work great. But together, depending on their order in the head, I get one to work but not the other. Can anyone tell me if I am seriously missing something or using outdated scripts... I am at a loss here. Thanks in advance. !--includes-- script type=text/javascript src=scripts/prototype.js/script script type=text/javascript src=scripts/scriptaculous.js? load=effects,builder/script script type=text/javascript src=scripts/lightbox.js/script !--for lightbox-- script type=text/javascript src=scripts/jquery-1.3.2.min.js/ script script type=text/javascript src=scripts/interface.js/script !--for interface/fisheye-- link href=css/style.css rel=stylesheet type=text/css /!--for interface/fisheye-- link rel=stylesheet href=css/lightbox.css type=text/css media=screen /!--for lightbox-- link rel=shortcut icon href=images/site_logo.ico link href=css/photoshop.css rel=stylesheet type=text/css /!-- for page layout-- !--end includes--
[jQuery] Click-Event in Options/defaults
Hy My jQuery-Plugin shoud produce two buttons with a onclick-event. Problem: The onclick-event got fired, when I call the plugin, without clicking on the button. Why got the click-event fired without clicking the button? Here my (shorted) plugin: (function($) { $.fn.rte = function(options) { $.fn.rte.defaults = { button : { bold : { alt:' bold ', // Problem: Got fired, before I click on the Button! click : function(){ alert('Bold!'); return false; } }, ul :{ alt:' ul ', // Problem: Got fired, before I click on the Button! click : function(){ alert('UL!'); return false; } } } }; var opts = $.extend(true, $.fn.rte.defaults, options); // iterate and construct the RTEs return this.each(function(){ $.each(opts.button, function(i, n){ var button = $('img /') .attr(n); $(#rtfButtons).append(button); }); }); }; })(jQuery);
[jQuery] Re: IE8 error: Invalid Argument
Alright, Incase anyone stumbles into this looking for an answer you can try the following: I updated to the latest version of UI and found that the dialog loaded without my html form. So, I simply removed the height option and everything loaded just fine in IE. FF appeared to not be affected by the height removal. I hope someone finds this helpful.
[jQuery] Re: Sortable accordion-like widget
Example? Im very new to jQuery, the old code was partially provided by someone else with a few edits, so not sure how to create that new level you was talking about. --- On Thu, 5/14/09, Richard D. Worth rdwo...@gmail.com wrote: From: Richard D. Worth rdwo...@gmail.com Subject: [jQuery] Re: Sortable accordion-like widget To: jquery-en@googlegroups.com Date: Thursday, May 14, 2009, 10:12 PM You'll need to add an extra level: section divs containing each related h3 and content div. Then you can call .sortable() the main div#accordion1 - Richard On Thu, May 14, 2009 at 9:38 PM, DanN danny_no...@yahoo.co.uk wrote: Got this coded, its an accordion like tool. It functions just how I need it, except id love to make it sortable. Anyone help with the code update? jQuery : $(function() { $(#accordion1).addClass(ui-accordion ui-widget ui-helper-reset) .find(h3) .addClass(ui-accordion-header ui-helper-reset ui-state-default ui- corner-top ui-corner-bottom) .prepend('span class=ui-icon ui-icon-triangle-1-e/') .hover(function() { $(this).addClass(ui-state-hover); }, function() { $(this).removeClass(ui-state-hover); }) .click(function() { $(this).toggleClass(ui-accordion-header-active).toggleClass(ui- state-active) .toggleClass(ui-state-default).toggleClass(ui-corner-bottom) .find( .ui-icon).toggleClass(ui-icon-triangle-1-e).toggleClass (ui-icon-triangle-1-s) .end().next().toggleClass(ui-accordion-content-active).toggle(); return false; }) .next().addClass(ui-accordion-content ui-helper-reset ui-widget- content ui-corner-bottom).hide(); }) HTML: div id=accordion1 h3a href=#DRAW2/a/h3 div CONTENT /div h3a href=#DRAW2/a/h3 div CONTENT /div /div Help appreciated in advance.
[jQuery] Re: Conflicts between scripts
You can avoid this conflict altogether (and reduce downloads considerably) using slimbox or thickbox http://www.digitalia.be/software/slimbox (lightbox clone for jQuery) http://jquery.com/demo/thickbox/ (can use to achieve lightbox effect, but much more versatile - can handle anything - not just images) on 15/05/2009 14:51 Mike said:: There is a problem with loading prototype and jquery on the same page. One trick that you can do is bulk replace in interface.js the '$' with 'jQuery'. Update all your scripts that use jQuery to replace the '$'. Also, remember that on your pages to use 'jquery' rather than '$' when referencing the jquery components/functions. This is b/c you have both prototype and jquery invoked on the same page. On May 15, 1:14 am, jmCom jasonmont...@new.rr.com wrote: Hello, all. I am a fairly new web designer and I have the following attached scripts on my page. Alone, they (lightbox and jQuery/ interface) work great. But together, depending on their order in the head, I get one to work but not the other. Can anyone tell me if I am seriously missing something or using outdated scripts... I am at a loss here. Thanks in advance. !--includes-- script type=text/javascript src=scripts/prototype.js/script script type=text/javascript src=scripts/scriptaculous.js? load=effects,builder/script script type=text/javascript src=scripts/lightbox.js/script !--for lightbox-- script type=text/javascript src=scripts/jquery-1.3.2.min.js/ script script type=text/javascript src=scripts/interface.js/script !--for interface/fisheye-- link href=css/style.css rel=stylesheet type=text/css /!--for interface/fisheye-- link rel=stylesheet href=css/lightbox.css type=text/css media=screen /!--for lightbox-- link rel=shortcut icon href=images/site_logo.ico link href=css/photoshop.css rel=stylesheet type=text/css /!-- for page layout-- !--end includes--
[jQuery] Re: How to animate background images or background of div
bump
[jQuery] how to uncheck the check box
Hi all Can u tell me , how to uncheck the check box , when i check another check box, for example having 4 check boxes, be default check box is checked ,. when i check the check box 2 , then need to uncheck the checked one , How to do this in jquery , Thanks -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINION http://bharanikumariyerphp.site88.net/bharanikumar/
[jQuery] Re: A better way of writing this code?
Hi Calvin, I think what you're looking for is something like this, as James said. $(li a).hover(function(){ $(this).addClass(move); }, function() { $(this).removeClass(move); }); Of course, include document ready function. -Jon Thomas On May 14, 8:35 pm, Calvin cstephe...@gmail.com wrote: Hi, I was able to get this script to work and was wondering if there was a better/proper/more efficient way of writing it. Here is the script: $(document).ready(function() { $('li.a').hover(function() { $(this).addClass('move'); }); $('li.a').mouseLeave(function() { $(this).removeClass('move'); )}; )}; Thanks for your time, Calvin Stephens
[jQuery] Re: how to uncheck the check box
bharani kumar wrote: Hi all Can u tell me , how to uncheck the check box , when i check another check box, for example having 4 check boxes, be default check box is checked ,. when i check the check box 2 , then need to uncheck the checked one , How to do this in jquery , Thanks Maybe you should use radio buttons instead? Jonathan -- www.tnt.be http://www.tnt.be/?source=emailsig *Jonathan Vanherpe* jonat...@tnt.be mailto:jonat...@tnt.be - www.tnt.be http://www.tnt.be/?source=emailsig - tel.: +32 (0)9 3860441
[jQuery] Re: how to uncheck the check box
add a click handler to each checkbox (you could use a selector and loop through with $.each). when clicked, the function could use the same selected and loop through again making sure the others are off. Eric On May 15, 10:38 am, bharani kumar bharanikumariyer...@gmail.com wrote: Hi all Can u tell me , how to uncheck the check box , when i check another check box, for example having 4 check boxes, be default check box is checked ,. when i check the check box 2 , then need to uncheck the checked one , How to do this in jquery , Thanks -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINIONhttp://bharanikumariyerphp.site88.net/bharanikumar/
[jQuery] Re: Only works in FF
Instead of .attr('onblur'. fn) Try .blur(fn) Tobeyt23 wrote: This works great in firefox, why doesn't this work in any other browser? Can the attribute onblur be added another way to work in all browsers? jQuery('#'+nameHex[0].replace(' ','__')+'_qty #'+fields[c].id).attr ('onblur' ,'setQtys();'); No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.329 / Virus Database: 270.12.31/2116 - Release Date: 05/15/09 06:16:00
[jQuery] Re: jQuery Countdown, can anyone get it to work??
where is theuntil2dobject? eric
[jQuery] Jquery/Jqrid Developer In CT Need for project work
Looking for a freelance developer who knows the in's and out's of jquery's jgrid very well. Must be onsite here in Branford, CT. Please email me with per hour rate at: rdwyer...@gmail.com
[jQuery] Re: Click-Event in Options/defaults
Keep in mind this recursively calls attr( key, value ) or attr ( key, fn ), so if one of the properties you are passing is a function, the function will be evaluated and not stored as the attribute itself. Question: The function should NOT will be evaluated... Any idea? Thanks!
[jQuery] Re: Matching Columns with JQuery
Just a quick update. I've managed to get this working now, although having problems trying out a different script. I'll keep trying before coming back for help! Many thanks, Myles On May 15, 8:17 am, mylessincl...@googlemail.com mylessincl...@googlemail.com wrote: Hi, You're right, I didn't give enough information. Sorry, just a bit of panic setting in on my part! The script works locally on my PC, so here is what I've done - I have created a Wordpress theme called test inside of which is a folder called js. This folder contains two files - jquery-1.2.6.pack and jquery.brenelz.equalHeight As far as I can tell, I've referenced this correctly in the head area of the index file as follows - script type=text/javascript src=?php bloginfo ('template_directory'); ?/js/jquery.brenelz.equalHeight.js/script script type=text/javascript src=http://really-valid-info.com/blog/ wp-content/themes/test/js/jquery-1.2.6.pack.js $(function(){ $('.column').equalHeight(); }); /script This outputs html code as: script type=text/javascript src=http://really-valid-info.com/blog/ wp-content/themes/test/js/jquery.brenelz.equalHeight.js/script script type=text/javascript src=http://really-valid-info.com/blog/ wp-content/themes/test/js/jquery-1.2.6.pack.js $(function(){ $('.column').equalHeight(); }); /script The url is:http://really-valid-info.com/blog/ It seems I've done something wrong though as the script is not getting triggered. I Would appreciate any help to get this working. Myles On May 14, 10:31 pm, MorningZ morni...@gmail.com wrote: 1. No... the file could be named foobar.js for all that matters 2. It's hard to help get your script working without knowing what the issue actually is... doesn't work does not help someone help you On May 14, 12:13 pm, mylessincl...@googlemail.com mylessincl...@googlemail.com wrote: Hello, I came across JQuery when searching for a solution to get matching column height with Divs. I have downloaded JQuery which appears to be one file named jquery-1.3.2.min I also have the following short script that I found, which I believe goes in the head area of the page. The script works with jquery. script language=javascript type=text/javascript src=../../js/ jquery/jquery.js/script script function equalHeight(group) { tallest = 0; group.each(function() { thisHeight = $(this).height(); if(thisHeight tallest) { tallest = thisHeight; } }); group.height(tallest);} $(document).ready(function() { equalHeight($(.column));}); /script I'm a complete novice at Javascript, but hopefully someone can advise on the following questions. 1. I assume I need to rename my download file jquery-1.3.2.min to jquery.js ? 2. Do I need to edit the jquery file somehow in order to get the above script to work? Hope someone can advise. Many thanks Myles- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: How to display additional text along with link
This calls for a function, where you can hide the gory details. Use a selector to gather up the a elements, and pass that as the argument to the function. pseudocode: var linksToChange = JQuery Selector; function changeLinks( linksToChange ){ either: a for loop to step through the object links ToChangelike an array probably an if conditional in every iteration see:http://tinyurl.com/3sdkgl also check out jquery's .each() iterator in the Utilities section of the docs or: a switch statement see: http://tinyurl.com/osezq2 } On May 14, 3:18 pm, vmrao maheshpav...@gmail.com wrote: OK. I was able to add the text as well as apply special style to it using the following code. $(a[href$='.doc']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.doc' + ) )); $(a[href$='.docx']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.docx' + ) )); $(a[href$='.xls']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.xls' + ) )); $(a[href$='.xlsx']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.xlsx' + ) )); $(a[href$='.ppt']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.ppt' + ) )); $(a[href$='.pptx']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.pptx' + ) )); $(a[href$='.pdf']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.pdf' + ) )); $(a[href$='.mpg']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.mpg' + ) )); However, I am not sure if there is scope to minimize the above code (as you see one line for every file extension). On May 14, 2:42 pm, vmrao maheshpav...@gmail.com wrote: I think it is not clear. Here is my code. $(a[href$='.doc']).after( ( + '.doc' + ) ); $(a[href$='.docx']).after( ( + '.docx' + ) ); $(a[href$='.xls']).after( ( + '.xls' + ) ); $(a[href$='.xlsx']).after( ( + '.xlsx' + ) ); $(a[href$='.ppt']).after( ( + '.ppt' + ) ); $(a[href$='.pptx']).after( ( + '.pptx' + ) ); $(a[href$='.pdf']).after( ( + '.pdf' + ) ); $(a[href$='.mpg']).after( ( + '.mpg' + ) ); I would like to know if it is possible to have a one-line code which replaces all the above code. Also, for the extra text (ex: .doc) being added, I need to add a special CSS style. I tried this and it does not work. $(a[href$='.doc']).after( ( + '.doc' + ) ).addClass (fileExtension); On May 14, 2:00 pm, waseem sabjee waseemsab...@gmail.com wrote: here i modified my code for class adding var obj = $(a); for(var i = 0; i obj.length; i++) { obj.eq(i).wrap(span/span ); // wrap the hyperlink in a span tag obj.parent().eq(i).prepend('span class=beforeThis is text before the hyperlink/span'); obj.parent().eq(i).append('span class=afterThis is text after the hyperlink/span'); } On Thu, May 14, 2009 at 7:58 PM, waseem sabjee waseemsab...@gmail.comwrote: var obj = $(a); for(var i = 0; i obj.length; i++) { obj.eq(i).wrap(span/span); // wrap the hyperlink in a span tag obj.parent().eq(i).prepend(This is text before the hyperlink); obj.parent().eq(i).append('This is text after the hyperlink'); } use the above common method and you can furthur change this script to look for hyperlinks with a specific class by saying : var obj = $(a.myclass); or var obj = $(a#myid); may be even var obj = $(h2 a); On Thu, May 14, 2009 at 7:46 PM, vmrao maheshpav...@gmail.com wrote: Also, I would like to apply a specific CSS style to the text being added. Here is my CSS. .fileExtension { padding-left:0pt; font-family: Arial, Helvetica, sans-serif; font-size: 7pt; font-weight: normal; color: #354963; } On May 14, 1:18 pm, vmrao maheshpav...@gmail.com wrote: Thanks. How about if I want to make it dynamic ? Say, I have several links on the page with different extensions (Ex: .doc, .docx, .ppt, .pptx, .pdf, .mpg). Can I accomplish the above with one statement rather than hard coding what text to append for each extension ? On May 14, 12:23 pm, brian bally.z...@gmail.com wrote: $(a[href$='.pdf']).after(' (pdf)'); On Thu, May 14, 2009 at 11:55 AM, vmrao maheshpav...@gmail.com wrote: I would like to display file extension along with the file links on a web page. For example, I would like to append (pdf) next to any pdf links. The following code works to some extent but not as I intended. $(a[href$='.pdf']).append( ( + 'pdf' + ) ); If I use the above code, (pdf) is also underlined being part of the link. I want (pdf) next to the link and not as part of the link.- Hide quoted text -
[jQuery] Re: A better way of writing this code?
what about that ? $(li a).hover(function(){ $(this).toggleClass(move); }); On May 15, 4:42 pm, Jthomas wjthom...@yahoo.com wrote: Hi Calvin, I think what you're looking for is something like this, as James said. $(li a).hover(function(){ $(this).addClass(move); }, function() { $(this).removeClass(move); }); Of course, include document ready function. -Jon Thomas On May 14, 8:35 pm, Calvin cstephe...@gmail.com wrote: Hi, I was able to get this script to work and was wondering if there was a better/proper/more efficient way of writing it. Here is the script: $(document).ready(function() { $('li.a').hover(function() { $(this).addClass('move'); }); $('li.a').mouseLeave(function() { $(this).removeClass('move'); )}; )}; Thanks for your time, Calvin Stephens
[jQuery] Re: A better way of writing this code?
While $(li a).hover(function(){ $(this).addClass(move); }, function() { $(this).removeClass(move); }); works well in theory, I've found that $(li a).hover(function(){ $(li a).removeClass(move); $(this).addClass(move); }, function() { $(this).removeClass(move); }); is necessary in practice. Assuming of course that you can't use the CSS solution which is obviously preferable. _jason On May 15, 8:09 am, benoit v. benv...@gmail.com wrote: what about that ? $(li a).hover(function(){ $(this).toggleClass(move); }); On May 15, 4:42 pm, Jthomas wjthom...@yahoo.com wrote: Hi Calvin, I think what you're looking for is something like this, as James said. $(li a).hover(function(){ $(this).addClass(move); }, function() { $(this).removeClass(move); }); Of course, include document ready function. -Jon Thomas On May 14, 8:35 pm, Calvin cstephe...@gmail.com wrote: Hi, I was able to get this script to work and was wondering if there was a better/proper/more efficient way of writing it. Here is the script: $(document).ready(function() { $('li.a').hover(function() { $(this).addClass('move'); }); $('li.a').mouseLeave(function() { $(this).removeClass('move'); )}; )}; Thanks for your time, Calvin Stephens
[jQuery] jCarousel with php paging
Hello, I am trying to use jCarousel in my php script to show all records on the same page. like this http://sorgalla.com/projects/jcarousel/examples/static_simple.html I have form where user has to logged in and then on his/her page he/ she can see these record. i have page where user is logged in. where this JS is not working. then i copied my same code with different name and tried there. its working. but the small difference is the page was not having userid. i mean that is not interlinked page with login page and other. we can say it was dummy page of profile.php i know little bit of JS. can anyone here tell me why this is happening. and whats wrong with my code. if anyone ll try this code there it ll work. i am quite sure about it. then why its not working with when user is logged in.( to top of it i have to show my database selection into this.. so i need to consider here this logged in thing.) here is my code !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head titleBlogAdda - Profile of ?if($blogdata-fullname==){echo ucwords (strtolower($blogdata-username));}else{ echo ucwords(strtolower ($blogdata-fullname));}; ?/title meta http-equiv=content-type content=text/html; charset=iso-8859-1 / meta name=keywords content= / meta name=description content= / link rel=stylesheet type=text/css href=?=$retpath;?/includes/ adda2.css media=screen / script type=text/javascript language=javascript src=?=$retpath;? /includes/functions.js/script !-- jQuery library -- script type=text/javascript src=lib/jquery-1.2.3.pack.js/ script !-- jCarousel library -- script type=text/javascript src=lib/jquery.jcarousel.pack.js/ script !-- jCarousel core stylesheet -- link rel=stylesheet type=text/css href=lib/ jquery.jcarousel.css / !-- jCarousel skin stylesheet -- link rel=stylesheet type=text/css href=skins/tango/skin.css / style type=text/css /** * Overwrite for having a carousel with dynamic width. */ .jcarousel-skin-tango .jcarousel-container-horizontal { width: 100%; } .jcarousel-skin-tango .jcarousel-clip-horizontal { width: 100%; } /style script type=text/javascript jQuery(document).ready(function() { jQuery('#mycarousel').jcarousel({ visible: 4 }); }); /script /head body div id=wrapper div id=header? include(templates/header.tpl); ?/div !-- Header ends -- ? include(templates/banner.tpl); ? div id=mainContent div class=blogcontainer h3 class=interestTextRecent Visitor's/h3 div class=NewArrivals div id=New_Arrivalsthum1 ul id=mycarousel class=jcarousel-skin-tango li ? $sqlpage= $op-runsql(SELECT a.username,a.avatar,r.visitor_id,r.visiting_count,TIMESTAMPDIFF (MINUTE, r.recent_visited, NOW()) AS MinsSinceLastVisit FROM recent_visitor as r ,author as a WHERE (r.visitor_id = a.id) AND r.profile_owner = '$blogdata-author' ORDER BY r.recent_visited DESC LIMIT $start, $limit_value); if(mysql_num_rows($sqlpage) 0){ ? p class=msgTextTotal strong?=$total_records;?/strong?if ($total_records 1){ ? Recent Visitor's?}else{? Recent Visitor?}}?/p ? if(mysql_num_rows($sqlpage) 0){ while($row1 = $op-select($sqlpage)){ $minutes_dif = $row1['MinsSinceLastVisit']; $imagearr = explode(,,$row1['avatar']); $imagearr[0]= preg_replace(/\/avatar\//,/small/, $imagearr [0]); ? a href='/profile/?=$blog-spacereplace($row1['username']);?/' title=?=$row1['username']?img src=?=$retpath;?/?=$imagearr [0];? width=40 height=40 alt=?=$row1['username']?//a? $minutes_dif = $row1['MinsSinceLastVisit']; $Ymin = 60 * 24 * 365; $Mmin = 60 * 24 * 30; $Wmin = 60 * 24 * 7; $Dmin = 60 * 24; $Hmin = 60; $Y = (int)($minutes_dif / $Ymin); $minutes_dif = $minutes_dif % $Ymin; $MON = (int)($minutes_dif / $Mmin); $minutes_dif = $minutes_dif % $Mmin; $W = (int)($minutes_dif / $Wmin); $minutes_dif = $minutes_dif % $Wmin; $D = (int)($minutes_dif / $Dmin); $minutes_dif = $minutes_dif % $Dmin; $H = (int)($minutes_dif / $Hmin); $minutes_dif = $minutes_dif % $Hmin; if($Y 0 ){ echo $Y year(s) ; }else if($MON 0){ echo $MON month(s) ; } else if($W 0){ echo $W week(s) ; } else if($D 0){ echo $D day(s) ; } else if($H 0){ echo $H hour(s) ; } else if($minutes_dif 0) echo $minutes_dif minute(s) ; echo ago; ?(?=$row1['visiting_count']?visits)? echo\t; $i++; } } /*--Paging starts-*/ $redirect = /profile/$usrname;
[jQuery] tablesorter with multiple tables problem
Hi, I am trying to use the plugin tablesorter that has a pager, for one table in a page it works fine, but when I put two tables, the pager links [next, previous,] for the first table is moved under the second table. Please your help is appreciated. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en-us head titlejQuery plugin: Tablesorter 2.0 - Pager plugin/title link rel=stylesheet href=css/jq.css type=text/css media=print, projection, screen / link rel=stylesheet href=../themes/blue/style.css type=text/ css media=print, projection, screen / script type=text/javascript src=../jquery-latest.js/script script type=text/javascript src=../jquery.tablesorter.js/ script script type=text/javascript src=../addons/pager/ jquery.tablesorter.pager.js/script script type=text/javascript src=js/chili/chili-1.8b.js/script script type=text/javascript src=js/docs.js/script script type=text/javascript $(function() { $(table) .tablesorter({widthFixed: true, widgets: ['zebra']}) .tablesorterPager({container: $(#pager)}); }); /script /head body div id=main h1First Table/h1 table cellspacing=1 class=tablesorter thead tr thCurrent Reviewer/th thArrival Date/th thProposal #/th thRouting #/th thDeadline Date/th thDays/th thOSP administrator/th thPI/th thLead Unit/th thPgogram Ann Number/th thSponsor Name/th /tr /thead tbody tr tdjimewhite/td td5/8/09 08:14/td td5638/td td1/td td05/15/09/td td0/td tdDeNutte, Kara L/td tdNorwak, Michael/td tdKavli Inst for Astr/td tdNNH09ZDA001N/td tdNAZA-wHASHINGTON/td /tr more ..trtd./td/tr /tbody /table div id=pager class=pager form img src=../addons/pager/icons/first.png class=first/ img src=../addons/pager/icons/prev.png class=prev/ input type=text class=pagedisplay/ img src=../addons/pager/icons/next.png class=next/ img src=../addons/pager/icons/last.png class=last/ select class=pagesize option selected=selected value=1010/option option value=2020/option option value=3030/option option value=4040/option /select /form /div h1Second table/h1 table cellspacing=1 class=tablesorter thead tr thCurrent Reviewer/th thArrival Date/th thProposal #/th thRouting #/th thDeadline Date/th thDays/th thOSP administrator/th thPI/th thLead Unit/th thPgogram Ann Number/th thSponsor Name/th /tr /thead tbody tr tdJohn/td td5/8/09 08:14/td td5638/td td1/td td05/15/09/td td0/td tdDeNutte, Kara L/td tdNorwak, Michael/td tdKavli Inst for Astr/td tdNNH09ZDA001N/td tdNAZA-wHASHINGTON/td /tr more ...trtd./td/tr /tbody /table div id=pager class=pager form img src=../addons/pager/icons/first.png class=first/ img src=../addons/pager/icons/prev.png class=prev/ input type=text class=pagedisplay/ img src=../addons/pager/icons/next.png class=next/ img src=../addons/pager/icons/last.png class=last/ select class=pagesize option selected=selected value=1010/option option value=2020/option option value=3030/option option value=4040/option /select /form /div /div /body /html
[jQuery] semi-synchronous ajax request?
Hi, I'm trying to implement a client side cache for an ajax based application but I'm not sure how to deal with the asynchronous nature of ajax calls in jquery. What I'm basically trying is to create a function getList() that fetches a snippet of text from the server and stores it in a variable so that future invocations of getList() no longer have to contact the server but can immediately return the content of the cache-variable. The problem is that two subsequent invocations of getList() result in both calls contacting the server because the ajax call of the first invocation hasn't finished yet when the second call to getList() happens. At first i thought about using the async option but according to the docs this blocks the entire browser. What I'm really looking for is a way to only make the particular thread synchronous so that I can store the result before returning from the first getList() call. What is the proper way to handle such a situation i jquery? Regards, Dennis
[jQuery] Re: Click-Event in Options/defaults
This works, but is there no better way? $.each(opts.button, function(i, n){ var func = n.click; delete(n.click); var button = $('img /') .attr(n) .click(func); $(#rtfButtons).append(button); });
[jQuery] Re: how to uncheck the check box
There are a few ways to do this. You can select by class, in which case you give a group of checkboxes the same class $(function(){ // attach a click event to each checkbox whose class is 'onechecked' $(':checkbox.onechecked').click(function(){ // if the clicked checkbox is checked (no need to do anything if it is being unchecked) if (this.checked) { // loop through all other checkboxes with the same class $(':checkbox.onechecked').each(function(){ // uncheck all of them this.checked = false; }); // re-check the one clicked this.checked = true; } }); }); HTML: fieldset input type=checkbox checked=checked name=cb1 class=onechecked / input type=checkbox name=cb2 class=onechecked / input type=checkbox name=cb3 class=onechecked / input type=checkbox name=cb4 class=onechecked / /fieldset you can also use the name attribute of the checkbox to group them - this could work for multiple groups of checkboxes - this example assumes that each group of checkboxes has the same name attribute, and those you want to limit to one selection are prefixed 'limit' $(function(){ // attach a click event to each checkbox whose name begins with 'limit' $(':checkbox[name^=limit]').click(function(){ // store the name of the checkbox which has been clicked var inputname = $(this).attr(name); // if the clicked checkbox is checked (no need to do anything if it is being unchecked) if (this.checked) { // loop through all other checkboxes with the same name attribute as the one clicked $(':checkbox[name='+inputname+']').each(function(){ // uncheck all of them this.checked = false; }); // re-check the one clicked this.checked = true; } }); }); HTML: fieldset input type=checkbox checked=checked name=limit1 / input type=checkbox name=limit1 / input type=checkbox name=limit1 / input type=checkbox name=limit1 / /fieldset fieldset input type=checkbox checked=checked name=limit2 / input type=checkbox name=limit2 / input type=checkbox name=limit2 / input type=checkbox name=limit2 / /fieldset There are other ways as well, but this should give you some idea about some of the possibilities. on 15/05/2009 15:48 elubin said:: add a click handler to each checkbox (you could use a selector and loop through with $.each). when clicked, the function could use the same selected and loop through again making sure the others are off. Eric On May 15, 10:38 am, bharani kumar bharanikumariyer...@gmail.com wrote: Hi all Can u tell me , how to uncheck the check box , when i check another check box, for example having 4 check boxes, be default check box is checked ,. when i check the check box 2 , then need to uncheck the checked one , How to do this in jquery , Thanks -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINIONhttp://bharanikumariyerphp.site88.net/bharanikumar/
[jQuery] Re: activeSlide class doesn't update
Works fine for me: http://jquery.malsup.com/cycle/pager4.html http://jquery.malsup.com/cycle/pager8.html On May 15, 8:52 am, MVimmer mor.vim...@gmail.com wrote: I checked your website :http://jquery.malsup.com/cycle/int2.htmland it seems that when you use the pager, the class doesn't change there as well.
[jQuery] Re: How to display additional text along with link
Is this what you're looking for? $(a:not[href^=http]).each(function(){ var ext=$(this).attr(href).match(/\.[^\.]*$/); if (ext) $(this).after(span class='fileExtension'(+ext.slice (1)+)/span); } ); On May 15, 8:09 am, infoaddicted jack.lapla...@gmail.com wrote: This calls for a function, where you can hide the gory details. Use a selector to gather up the a elements, and pass that as the argument to the function. pseudocode: var linksToChange = JQuery Selector; function changeLinks( linksToChange ){ either: a for loop to step through the object links ToChangelike an array probably an if conditional in every iteration see:http://tinyurl.com/3sdkgl also check out jquery's .each() iterator in the Utilities section of the docs or: a switch statement see:http://tinyurl.com/osezq2 } On May 14, 3:18 pm, vmrao maheshpav...@gmail.com wrote: OK. I was able to add the text as well as apply special style to it using the following code. $(a[href$='.doc']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.doc' + ) )); $(a[href$='.docx']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.docx' + ) )); $(a[href$='.xls']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.xls' + ) )); $(a[href$='.xlsx']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.xlsx' + ) )); $(a[href$='.ppt']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.ppt' + ) )); $(a[href$='.pptx']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.pptx' + ) )); $(a[href$='.pdf']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.pdf' + ) )); $(a[href$='.mpg']:not(a[href^='http'])).after($('span/').attr ('class','fileExtension').html( ( + '.mpg' + ) )); However, I am not sure if there is scope to minimize the above code (as you see one line for every file extension). On May 14, 2:42 pm, vmrao maheshpav...@gmail.com wrote: I think it is not clear. Here is my code. $(a[href$='.doc']).after( ( + '.doc' + ) ); $(a[href$='.docx']).after( ( + '.docx' + ) ); $(a[href$='.xls']).after( ( + '.xls' + ) ); $(a[href$='.xlsx']).after( ( + '.xlsx' + ) ); $(a[href$='.ppt']).after( ( + '.ppt' + ) ); $(a[href$='.pptx']).after( ( + '.pptx' + ) ); $(a[href$='.pdf']).after( ( + '.pdf' + ) ); $(a[href$='.mpg']).after( ( + '.mpg' + ) ); I would like to know if it is possible to have a one-line code which replaces all the above code. Also, for the extra text (ex: .doc) being added, I need to add a special CSS style. I tried this and it does not work. $(a[href$='.doc']).after( ( + '.doc' + ) ).addClass (fileExtension); On May 14, 2:00 pm, waseem sabjee waseemsab...@gmail.com wrote: here i modified my code for class adding var obj = $(a); for(var i = 0; i obj.length; i++) { obj.eq(i).wrap(span/span ); // wrap the hyperlink in a span tag obj.parent().eq(i).prepend('span class=beforeThis is text before the hyperlink/span'); obj.parent().eq(i).append('span class=afterThis is text after the hyperlink/span'); } On Thu, May 14, 2009 at 7:58 PM, waseem sabjee waseemsab...@gmail.comwrote: var obj = $(a); for(var i = 0; i obj.length; i++) { obj.eq(i).wrap(span/span); // wrap the hyperlink in a span tag obj.parent().eq(i).prepend(This is text before the hyperlink); obj.parent().eq(i).append('This is text after the hyperlink'); } use the above common method and you can furthur change this script to look for hyperlinks with a specific class by saying : var obj = $(a.myclass); or var obj = $(a#myid); may be even var obj = $(h2 a); On Thu, May 14, 2009 at 7:46 PM, vmrao maheshpav...@gmail.com wrote: Also, I would like to apply a specific CSS style to the text being added. Here is my CSS. .fileExtension { padding-left:0pt; font-family: Arial, Helvetica, sans-serif; font-size: 7pt; font-weight: normal; color: #354963; } On May 14, 1:18 pm, vmrao maheshpav...@gmail.com wrote: Thanks. How about if I want to make it dynamic ? Say, I have several links on the page with different extensions (Ex: .doc, .docx, .ppt, .pptx, .pdf, .mpg). Can I accomplish the above with one statement rather than hard coding what text to append for each extension ? On May 14, 12:23 pm, brian bally.z...@gmail.com wrote: $(a[href$='.pdf']).after(' (pdf)'); On Thu, May 14, 2009 at 11:55 AM, vmrao maheshpav...@gmail.com wrote: I would like to display file extension along with the file links on a
[jQuery] Re: Conflicts between scripts
Thanks for all the insight and advice. Thanks also for not being smug like many bloggers/posters. I actually used jQuery-lightbox.0.5 which works/plays well with the older interface.js and Voila! Problem solved. Again, you guys are a huge help and I appreciate it! jmCom
[jQuery] Re: UI Tabs Back button history
I'm really interested in this too. The docs say there is a rewrite coming to the history plugin that will bring forward/back back into the functionality by default. So i don't know of any other way for this to work On May 1, 4:40 pm, DB deadbud...@gmail.com wrote: Has anyone been able to get back button history to work with UI Tabs. or any way to make the back button work with previous visited tabs. I tried using the history plug but im not sure how to make it work with ajax created tabs. any help would be appreciated.
[jQuery] Re: jQuery Countdown, can anyone get it to work??
HI Eric, I'm lost on that. I've tried many different variations and now feel like crying. Great script :) but poor documentation :( I'll keep trying On May 15, 3:53 pm, elubin elu...@yahoo.com wrote: where is the until2d object? eric
[jQuery] Re: how to uncheck the check box
If you absolutely must use a checkbox you could do the following: when you click on a check box, set the checked attribute of the other checkboxes in the same group to 湴 cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-828-355-5544 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: Danny Nolan danny_no...@yahoo.co.uk To: jquery-en@googlegroups.com Date: 05/15/2009 11:48 AM Subject:[jQuery] Re: how to uncheck the check box Change to a standard radio group? --- On Fri, 5/15/09, bharani kumar bharanikumariyer...@gmail.com wrote: From: bharani kumar bharanikumariyer...@gmail.com Subject: [jQuery] how to uncheck the check box To: jquery-en@googlegroups.com Date: Friday, May 15, 2009, 9:38 AM Hi all Can u tell me , how to uncheck the check box , when i check another check box, for example having 4 check boxes, be default check box is checked ,. when i check the check box 2 , then need to uncheck the checked one , How to do this in jquery , Thanks -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINION http://bharanikumariyerphp.site88.net/bharanikumar/ inline: graycol.gifinline: ecblank.gif
[jQuery] Re: Sortable accordion-like widget
Sure, here you go: http://jsbin.com/aqeca You can edit this example here: http://jsbin.com/aqeca/edit It's not perfect, since when you sort one, it also toggles it, but it's a start. - Richard On Fri, May 15, 2009 at 10:19 AM, Danny Nolan danny_no...@yahoo.co.ukwrote: Example? Im very new to jQuery, the old code was partially provided by someone else with a few edits, so not sure how to create that new level you was talking about. --- On *Thu, 5/14/09, Richard D. Worth rdwo...@gmail.com* wrote: From: Richard D. Worth rdwo...@gmail.com Subject: [jQuery] Re: Sortable accordion-like widget To: jquery-en@googlegroups.com Date: Thursday, May 14, 2009, 10:12 PM You'll need to add an extra level: section divs containing each related h3 and content div. Then you can call .sortable() the main div#accordion1 - Richard On Thu, May 14, 2009 at 9:38 PM, DanN danny_no...@yahoo.co.ukhttp://mc/compose?to=danny_no...@yahoo.co.uk wrote: Got this coded, its an accordion like tool. It functions just how I need it, except id love to make it sortable. Anyone help with the code update? jQuery : $(function() { $(#accordion1).addClass(ui-accordion ui-widget ui-helper-reset) .find(h3) .addClass(ui-accordion-header ui-helper-reset ui-state-default ui- corner-top ui-corner-bottom) .prepend('span class=ui-icon ui-icon-triangle-1-e/') .hover(function() { $(this).addClass(ui-state-hover); }, function() { $(this).removeClass(ui-state-hover); }) .click(function() { $(this).toggleClass(ui-accordion-header-active).toggleClass(ui- state-active) .toggleClass(ui-state-default).toggleClass(ui-corner-bottom) .find( .ui-icon).toggleClass(ui-icon-triangle-1-e).toggleClass (ui-icon-triangle-1-s) .end().next().toggleClass(ui-accordion-content-active).toggle(); return false; }) .next().addClass(ui-accordion-content ui-helper-reset ui-widget- content ui-corner-bottom).hide(); }) HTML: div id=accordion1 h3a href=#DRAW2/a/h3 div CONTENT /div h3a href=#DRAW2/a/h3 div CONTENT /div /div Help appreciated in advance.
[jQuery] Re: how to uncheck the check box
Change to a standard radio group? --- On Fri, 5/15/09, bharani kumar bharanikumariyer...@gmail.com wrote: From: bharani kumar bharanikumariyer...@gmail.com Subject: [jQuery] how to uncheck the check box To: jquery-en@googlegroups.com Date: Friday, May 15, 2009, 9:38 AM Hi all Can u tell me , how to uncheck the check box , when i check another check box, for example having 4 check boxes, be default check box is checked ,. when i check the check box 2 , then need to uncheck the checked one , How to do this in jquery , Thanks -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINION http://bharanikumariyerphp.site88.net/bharanikumar/
[jQuery] Adding new table rows on the fly?
Do you know if you can clone() and then appendTo() a tr http://www.perturb.org/tmp/test.html I want to something like $(#second).clone().appendTo('#second'); It works, but it doesn't render like I want it to. I want it to be a NEW row. Any ideas? - Scott
[jQuery] [validate] Validation by Remote: Passing in Data Alongside elementName
$(#Form).validate({ rules: { storename_name: { required: true, remote: { url: /intranet/trunk/app/index.php/storeform/ findValidstorename, type: post, data: { foo: bar } } }, Will this send the variable foo containing the value bar into the POST alongside the #storename_name value? If I take out the 'data:{}' piece of the code, it all works fine. The way I have it coded above it does not work at all. I need to get an additional value sent into the url listed.
[jQuery] getting ID number when using jquery form plugin
I'm trying to use the jquery form plugin to post form data to a mysql database. At the same time, I'm loading another page in which I need to use the mysql_insert_id(). How can I get that ID number and send it to my page I'm loading. I'm trying to post it to a Javascript var but I don't know how I can grab it from my update.php (which is where I submit the form data to) I hope that makes sense.
[jQuery] problem with horizontal menu style
I've just installed this extension, but i'm having some problems. Need to implement a horizontal menu style in user4, or user 3 positions on rhuk_milkyway template. When the menu drops down, it's not visible. what can i do? Thanks and regards Rui
[jQuery] :contains selector error/bug in IE
I am loading an XML doc with the jQuery ajax call and then trying to search it using this statement. var myRow = $(myXML).find('Cell:contains(0100)') This works just fine in FireFox and Chrome but I get 0 results in IE Can someone suggest an alternate way to accomplish this same search that works in IE? Thank you, Art Details --- WinXP IE7 jQuery 1.3.2
[jQuery] Coda Slider with Fade Transition
I am looking to use the Coda Slider plugin, but instead of the Sliding effect, I'd like to make it fade in-between slides instead. I have found a couple discussions that you can use onbefore or the onafter parameters to accomplish this but nobody has listed a definite solution to this. Here is the plugin: http://www.ndoherty.com/blog/category/coda-slider
[jQuery] ClueTip and ActiveX control...
Hi, I have a web page which contains a legacy ActiveX control (I know...) and am having a problem with the ClueTip plugin. Whenever a tooltip is displayed which should obscure the ActiveX it instead is drawn behind the ActiveX control. I have tried setting the value of cluezIndex to 1000, and also tried adding param name=wmode value=transparent / to the object tag as explained on the FAQ page for a flash object but neither change had any effect. Is there another way that I can try to make the ClueTip appear on top of the ActiveX control? Thanks.
[jQuery] Re: IE: select change triggers pop-up blocker
On Fri, May 15, 2009 at 9:03 AM, Liam Byrne l...@onsight.ie wrote: Is it possible that IE7 8 see html as a reserved word ? Try changing the hmtl variable in both function(html) and $('#nav_admin').html(html) to something else No, there's no difference. There's also no request made to the server, in any case. This occurs with just a single click on the select list (ie. no change). I'm using 1.3.2, btw. Stupid of me to forget that. I'm going to whip up a minimal test page to see if I can isolate this.
[jQuery] Re: Adding new table rows on the fly?
This is assuming #second is a tr tag $(#second).clone().after('#second'); http://docs.jquery.com/Manipulation On May 15, 12:48 pm, ScottChiefBaker scott.ba...@gmail.com wrote: Do you know if you can clone() and then appendTo() a tr http://www.perturb.org/tmp/test.html I want to something like $(#second).clone().appendTo('#second'); It works, but it doesn't render like I want it to. I want it to be a NEW row. Any ideas? - Scott
[jQuery] Re: Modify iframe with jquery
If you cannot change the scrolling by modifying the iframe, then do it by modifying the document inside the iframe. I don't remember the syntax for accessing the document/body elements inside an iframe, so I'll just use pseudo-code here. You should be able to find the correct syntax easily... $(#iframe)[0].document.$(body).css({ overflow: hidden; }); This will work as long as the iframe content is in the same domain as your parent page. If it is in a different domain, then browser security will prevent you from accessing the document inside the iframe. /Kevin On May 14, 1:56 pm, ripple ripple...@yahoo.com wrote: Thanks, but it's not the contents of the iframe that I'm looking for. It's altering the behavior(scrolling) of the iframe that i am trying to achieve. --- On Thu, 5/14/09, waseem sabjee waseemsab...@gmail.com wrote: From: waseem sabjee waseemsab...@gmail.com Subject: [jQuery] Re: Modify iframe with jquery To: jquery-en@googlegroups.com Date: Thursday, May 14, 2009, 4:48 PM $(#iframeid).contents.find(#elementid); $(#iframeid).contents.find(#elementid).text(); $(#iframeid).contents.find(#elementid).html(); I used this earlier today with some php where a wysiwyg editor had its html contents embedded in a Iframe and i hate to post the raw html to a database. worked like a charm. On Thu, May 14, 2009 at 10:43 PM, ripple ripple...@yahoo.com wrote: I have an iframe in a page that scrolls on initial load, but after clicking a link and loading a different page I have to remove the scroll(scrolling=no). When the 2nd page loads I set the attr on the the iframe to scrolling=no. $('#iframe').attr('scrolling','no'); But, This does not seem to work. Does anyone know? Is the iframe more of a static object after initial creation and load? Can it's parameters (except for src) not be changed? Thanks
[jQuery] Re: Matching Columns with JQuery
The main jQuery file need to be included before you include any scripts. Reorder your script tags to put jQuery.js before jquery.brenelz.equalHeight.js. Also I would recommend using 1.3.2 version of jQuery. On May 15, 8:05 am, mylessincl...@googlemail.com mylessincl...@googlemail.com wrote: Just a quick update. I've managed to get this working now, although having problems trying out a different script. I'll keep trying before coming back for help! Many thanks, Myles On May 15, 8:17 am, mylessincl...@googlemail.com mylessincl...@googlemail.com wrote: Hi, You're right, I didn't give enough information. Sorry, just a bit of panic setting in on my part! The script works locally on my PC, so here is what I've done - I have created a Wordpress theme called test inside of which is a folder called js. This folder contains two files - jquery-1.2.6.pack and jquery.brenelz.equalHeight As far as I can tell, I've referenced this correctly in the head area of the index file as follows - script type=text/javascript src=?php bloginfo ('template_directory'); ?/js/jquery.brenelz.equalHeight.js/script script type=text/javascript src=http://really-valid-info.com/blog/ wp-content/themes/test/js/jquery-1.2.6.pack.js $(function(){ $('.column').equalHeight(); }); /script This outputs html code as: script type=text/javascript src=http://really-valid-info.com/blog/ wp-content/themes/test/js/jquery.brenelz.equalHeight.js/script script type=text/javascript src=http://really-valid-info.com/blog/ wp-content/themes/test/js/jquery-1.2.6.pack.js $(function(){ $('.column').equalHeight(); }); /script The url is:http://really-valid-info.com/blog/ It seems I've done something wrong though as the script is not getting triggered. I Would appreciate any help to get this working. Myles On May 14, 10:31 pm, MorningZ morni...@gmail.com wrote: 1. No... the file could be named foobar.js for all that matters 2. It's hard to help get your script working without knowing what the issue actually is... doesn't work does not help someone help you On May 14, 12:13 pm, mylessincl...@googlemail.com mylessincl...@googlemail.com wrote: Hello, I came across JQuery when searching for a solution to get matching column height with Divs. I have downloaded JQuery which appears to be one file named jquery-1.3.2.min I also have the following short script that I found, which I believe goes in the head area of the page. The script works with jquery. script language=javascript type=text/javascript src=../../js/ jquery/jquery.js/script script function equalHeight(group) { tallest = 0; group.each(function() { thisHeight = $(this).height(); if(thisHeight tallest) { tallest = thisHeight; } }); group.height(tallest);} $(document).ready(function() { equalHeight($(.column));}); /script I'm a complete novice at Javascript, but hopefully someone can advise on the following questions. 1. I assume I need to rename my download file jquery-1.3.2.min to jquery.js ? 2. Do I need to edit the jquery file somehow in order to get the above script to work? Hope someone can advise. Many thanks Myles- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: If statement in form validation
Try changing it so it's: required: function() { return $([name=billing_addr]:checked).val() == 0; } and remove your click binding function. This makes the radio check done on runtime. Doing: return billing_address == 0; will probably only evaluate billing_address when the rules are defined (which is at the beginning of script execution), so it's probably 0, and your fields were always required, if I'm correct. Aside from that problem, here's some additional facts you can learn from. :) When you write: $(input.billing_addr_grp).click(function() { var billing_address = $([name=billing_addr]:checked).val(); }) Your variable billing_address will only be considered local, and valid inside only the scope of that click function because you defined the variable inside there (using var). This means that other code outside that function would not be able to see the value you're trying to set. Instead, you'd want to set a global variable. Do something like: var billing_address; // global variable; any code would be able to access this $(input.billing_addr_grp).click(function() { // this will write the value to the global variable billing_address = $([name=billing_addr]:checked).val(); }) On May 15, 5:55 am, choffman mountain@gmail.com wrote: Thanks James I appreciate you replying. I'm still having some trouble, even with your additions. I changed the checkbox to radio buttons. I added this code snippet to get the value of the checked radio. Yes == 1 and No == 0, if the user selects No (0) then the billling address fields need to be required. Does this make sense? $(input.billing_addr_grp).click(function() { var billing_address = $([name=billing_addr]:checked).val(); }) Then the rules: $('#transaction').validate({ rules: { first: required, last: required, billing_first: { required: function() { return billing_address == 0; } }, billing_last: { required: function() { return billing_address == 0; } } I still can't get them to only be required when the value of the radio button is 0. Any more thoughts? Thanks, MD On May 14, 6:19 pm, James james.gp@gmail.com wrote: Something like: rules: { first: required, last: required, .. billing_first: { required: function() { return billing_address == 1; } }, billing_last: { required: function() { return billing_address == 1; } }, billing_first: { required: function() { return billing_address == 1; } }, billing_address: { required: function() { return billing_address == 1; } }, . }, On May 14, 10:14 am, choffman mountain@gmail.com wrote: Hi There, I could use some help here. I need to place a conditionstatement (if) in thisformvalidationscript. For some reason, I just can't get it to work. Basically, when a user un-checks a particular box (billing_addr) additionalformfields slide down, those fields need to be validated. Ifthe box is checked the fields roll-up, become disable and can be skipped. What's the best way to accomplish this? Thanks, MD $(document).ready(function() { var billing_address = $(input[name='billing_addr']:!checked).val(); $.metadata.setType(validate); $('#mysampleform').validate({ rules: { first: required, last: required, address: required, city: required, state: required, country: required, zip: required, membertype: required, amount: required, state: required, mt: required, email: true, if(billing_address == 1) { alert(billing_address); billing_first: required, billing_last: required, billing_address: required, billing_city: required, billing_state: required, billing_zip: required, billing_email: true } }, messages: { first: Please enter your first name, } }); });
[jQuery] Re: How to check if jquery is working?
Try using tools like the Web Development toolbar add-on for Firefox to debug. Under Information View Javascript, you can view all of the Javascript that is loaded on the page, such as maybe other Javascript libraries that are overriding the $ variable. This will help you see what Javascript is on your page, and whether they are linked correctly or not. Additionally, also use the Firebug add-on to check whether your Javascript is spitting out any errors. Try also simplifying your code to something like: jQuery(document).ready(function(){ alert('test'); }); On May 15, 6:00 am, Charlie charlie...@gmail.com wrote: is jquery.js included on page and is it loading (ie is path valid to jquery.js)? heldtogether wrote:Hi, I want to try incorporate jquery in my site, but I'm having some problems. The site is drawn together from various files in PHP. I have added the jquery script which I would expect to work fine regardless of the PHPness earlier because it is a client side script. Unfortunately nothing happens. If I save the page directly to my desktop then the script works fine, so I think there must be some problems with the dynamic pages. Does anyone have any idea why this might be occuring? The following is what gets put onto the page in the header if I view source. script type=text/javascript src=jquery.js/script script type=text/javascript $(document).ready(function(){ $(pHello world!/p).appendTo(body); $(#onlineresources).hide(); $(#onlineresourcesbutton).click(function(){ $(#onlineresources).slideDown(slow); return false; }); }); /script Thanks, Josh
[jQuery] Re: Sortable accordion-like widget
Almost, I found it worked almost, except for the fact that the sortable affected only the UL-LI objects, the contents were static. How to get past that? --- On Fri, 5/15/09, Richard D. Worth rdwo...@gmail.com wrote: From: Richard D. Worth rdwo...@gmail.com Subject: [jQuery] Re: Sortable accordion-like widget To: jquery-en@googlegroups.com Date: Friday, May 15, 2009, 10:51 AM Sure, here you go: http://jsbin.com/aqeca You can edit this example here: http://jsbin.com/aqeca/edit It's not perfect, since when you sort one, it also toggles it, but it's a start. - Richard On Fri, May 15, 2009 at 10:19 AM, Danny Nolan danny_no...@yahoo.co.uk wrote: Example? Im very new to jQuery, the old code was partially provided by someone else with a few edits, so not sure how to create that new level you was talking about. --- On Thu, 5/14/09, Richard D. Worth rdwo...@gmail.com wrote: From: Richard D. Worth rdwo...@gmail.com Subject: [jQuery] Re: Sortable accordion-like widget To: jquery-en@googlegroups.com Date: Thursday, May 14, 2009, 10:12 PM You'll need to add an extra level: section divs containing each related h3 and content div. Then you can call .sortable() the main div#accordion1 - Richard On Thu, May 14, 2009 at 9:38 PM, DanN danny_no...@yahoo.co.uk wrote: Got this coded, its an accordion like tool. It functions just how I need it, except id love to make it sortable. Anyone help with the code update? jQuery : $(function() { $(#accordion1).addClass(ui-accordion ui-widget ui-helper-reset) .find(h3) .addClass(ui-accordion-header ui-helper-reset ui-state-default ui- corner-top ui-corner-bottom) .prepend('span class=ui-icon ui-icon-triangle-1-e/') .hover(function() { $(this).addClass(ui-state-hover); }, function() { $(this).removeClass(ui-state-hover); }) .click(function() { $(this).toggleClass(ui-accordion-header-active).toggleClass(ui- state-active) .toggleClass(ui-state-default).toggleClass(ui-corner-bottom) .find( .ui-icon).toggleClass(ui-icon-triangle-1-e).toggleClass (ui-icon-triangle-1-s) .end().next().toggleClass(ui-accordion-content-active).toggle(); return false; }) .next().addClass(ui-accordion-content ui-helper-reset ui-widget- content ui-corner-bottom).hide(); }) HTML: div id=accordion1 h3a href=#DRAW2/a/h3 div CONTENT /div h3a href=#DRAW2/a/h3 div CONTENT /div /div Help appreciated in advance.
[jQuery] Re: IE: select change triggers pop-up blocker
On Fri, May 15, 2009 at 1:22 PM, brian bally.z...@gmail.com wrote: On Fri, May 15, 2009 at 9:03 AM, Liam Byrne l...@onsight.ie wrote: Is it possible that IE7 8 see html as a reserved word ? Try changing the hmtl variable in both function(html) and $('#nav_admin').html(html) to something else No, there's no difference. There's also no request made to the server, in any case. This occurs with just a single click on the select list (ie. no change). I'm using 1.3.2, btw. Stupid of me to forget that. I'm going to whip up a minimal test page to see if I can isolate this. Same results using the following: $(function() { $('#test').change(function() { var test_id = $(this).val(); alert(test_id); return false; }); }); form action=# select id=test option value=11/option option value=22/option option value=33/option /select /form I've posted the full test page here: http://pastebin.com/m6b255635 I'm seeing it in: IE 8.0.6001.18702 some version of IE 7. I can't be more specific because the about... box won't open. I suspect this is related to having installed it through Multiple IEs. I suppose it's even possible that that's what is causing this bug, though I doubt it. Again, when the pop-up thingy comes up, I can go into options and see that pop-up blocking is supposedly disabled. I realise now that this is definitely an IE bug, not jQuery's (I never really suspected that), but thought I'd post this here for posterity. Someone else came across the same problem just last week. I wonder if a recent update introduced this bug. http://forums.shopplugin.net/topic/order-by-list-and-ie-8-popup-blocker
[jQuery] Re: Sortable accordion-like widget
Let me be more specific, this is the code I have: $(function() { $(#accordion1).addClass(ui-accordion ui-widget ui-helper-reset) .find(h3) .addClass(ui-accordion-header ui-helper-reset ui-state-default ui-corner-top ui-corner-bottom) .prepend('span class=ui-icon ui-icon-triangle-1-e/') .hover(function() { $(this).addClass(ui-state-hover); }, function() { $(this).removeClass(ui-state-hover); }) .click(function() { $(this).toggleClass(ui-accordion-header-active).toggleClass(ui-state-active) .toggleClass(ui-state-default).toggleClass(ui-corner-bottom) .find( .ui-icon).toggleClass(ui-icon-triangle-1-e).toggleClass(ui-icon-triangle-1-s) .end().next().toggleClass(ui-accordion-content-active).toggle(); return false; }) .next().addClass(ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom).hide(); //$(#accordion1).sortable(); }) Where am I going wrong? --- On Fri, 5/15/09, Richard D. Worth rdwo...@gmail.com wrote: From: Richard D. Worth rdwo...@gmail.com Subject: [jQuery] Re: Sortable accordion-like widget To: jquery-en@googlegroups.com Date: Friday, May 15, 2009, 10:51 AM Sure, here you go: http://jsbin.com/aqeca You can edit this example here: http://jsbin.com/aqeca/edit It's not perfect, since when you sort one, it also toggles it, but it's a start. - Richard On Fri, May 15, 2009 at 10:19 AM, Danny Nolan danny_no...@yahoo.co.uk wrote: Example? Im very new to jQuery, the old code was partially provided by someone else with a few edits, so not sure how to create that new level you was talking about. --- On Thu, 5/14/09, Richard D. Worth rdwo...@gmail.com wrote: From: Richard D. Worth rdwo...@gmail.com Subject: [jQuery] Re: Sortable accordion-like widget To: jquery-en@googlegroups.com Date: Thursday, May 14, 2009, 10:12 PM You'll need to add an extra level: section divs containing each related h3 and content div. Then you can call .sortable() the main div#accordion1 - Richard On Thu, May 14, 2009 at 9:38 PM, DanN danny_no...@yahoo.co.uk wrote: Got this coded, its an accordion like tool. It functions just how I need it, except id love to make it sortable. Anyone help with the code update? jQuery : $(function() { $(#accordion1).addClass(ui-accordion ui-widget ui-helper-reset) .find(h3) .addClass(ui-accordion-header ui-helper-reset ui-state-default ui- corner-top ui-corner-bottom) .prepend('span class=ui-icon ui-icon-triangle-1-e/') .hover(function() { $(this).addClass(ui-state-hover); }, function() { $(this).removeClass(ui-state-hover); }) .click(function() { $(this).toggleClass(ui-accordion-header-active).toggleClass(ui- state-active) .toggleClass(ui-state-default).toggleClass(ui-corner-bottom) .find( .ui-icon).toggleClass(ui-icon-triangle-1-e).toggleClass (ui-icon-triangle-1-s) .end().next().toggleClass(ui-accordion-content-active).toggle(); return false; }) .next().addClass(ui-accordion-content ui-helper-reset ui-widget- content ui-corner-bottom).hide(); }) HTML: div id=accordion1 h3a href=#DRAW2/a/h3 div CONTENT /div h3a href=#DRAW2/a/h3 div CONTENT /div /div Help appreciated in advance.
[jQuery] Re: semi-synchronous ajax request?
One possible goal is to make it so that a second getList() call would not be executed until the first is completed/failed. You can set aside a variable that holds a status. getList() can update that status before and after the call, and also does a check on that variable every time it's executed to determine whether it can perform another call or not. Something like below: var status = 0; function getList() { if (status == 0) { status = 1; // talking to server $.ajax({ beforeSend: function() { status = 1; }, // i'm gonna talk to the server success: function() { status = 0; }, // finished talking to server error: function() { status = 0; } // finished talking to server }); } } // call getList(); It'll be good to set a timeout on the ajax call also so it doesn't hold up any subsequent calls because it's taking too long for whatever reason. On May 15, 4:15 am, Dennis Jacobfeuerborn djacobfeuerb...@gmail.com wrote: Hi, I'm trying to implement a client side cache for an ajax based application but I'm not sure how to deal with the asynchronous nature of ajax calls in jquery. What I'm basically trying is to create a function getList() that fetches a snippet of text from the server and stores it in a variable so that future invocations of getList() no longer have to contact the server but can immediately return the content of the cache-variable. The problem is that two subsequent invocations of getList() result in both calls contacting the server because the ajax call of the first invocation hasn't finished yet when the second call to getList() happens. At first i thought about using the async option but according to the docs this blocks the entire browser. What I'm really looking for is a way to only make the particular thread synchronous so that I can store the result before returning from the first getList() call. What is the proper way to handle such a situation i jquery? Regards, Dennis
[jQuery] Re: IE: select change triggers pop-up blocker
On Fri, May 15, 2009 at 2:23 PM, brian bally.z...@gmail.com wrote: Someone else came across the same problem just last week. I wonder if a recent update introduced this bug. http://forums.shopplugin.net/topic/order-by-list-and-ie-8-popup-blocker My partner just opened that link and pointed out that the solution is linked to from there. For some reason, I'd only seen 2 comments loaded. A refresh got them all to load, which pointed me to: http://stackoverflow.com/questions/495767/ie-drop-down-menus-triggering-the-pop-up-blocker So, it is due to the multiple IE versions. That page pointed me to an alternative to Multiple IEs: http://finalbuilds.edskes.net/iecollection.htm The package was recently updated to fix this bug. Hope this helps someone else.
[jQuery] Re: problem with horizontal menu style
Link? On Fri, May 15, 2009 at 12:00 PM, rui mourato@gmail.com wrote: I've just installed this extension, but i'm having some problems. Need to implement a horizontal menu style in user4, or user 3 positions on rhuk_milkyway template. When the menu drops down, it's not visible. what can i do? Thanks and regards Rui -- Respectfully, Ethan Mateja +++ Packetforward www.packetforward.com
[jQuery] Re: If statement in form validation
Thanks James, I appreciate your explanations. After some fumbling around I got it work with basically the same thing: billing_first: { required: function() { return $([name=billing_addr]:checked).val() == 0; } } ... MD On May 15, 2009, at 12:11 PM, James wrote: Try changing it so it's: required: function() { return $([name=billing_addr]:checked).val() == 0; } and remove your click binding function. This makes the radio check done on runtime. Doing: return billing_address == 0; will probably only evaluate billing_address when the rules are defined (which is at the beginning of script execution), so it's probably 0, and your fields were always required, if I'm correct. Aside from that problem, here's some additional facts you can learn from. :) When you write: $(input.billing_addr_grp).click(function() { var billing_address = $([name=billing_addr]:checked).val(); }) Your variable billing_address will only be considered local, and valid inside only the scope of that click function because you defined the variable inside there (using var). This means that other code outside that function would not be able to see the value you're trying to set. Instead, you'd want to set a global variable. Do something like: var billing_address; // global variable; any code would be able to access this $(input.billing_addr_grp).click(function() { // this will write the value to the global variable billing_address = $([name=billing_addr]:checked).val(); }) On May 15, 5:55 am, choffman mountain@gmail.com wrote: Thanks James I appreciate you replying. I'm still having some trouble, even with your additions. I changed the checkbox to radio buttons. I added this code snippet to get the value of the checked radio. Yes == 1 and No == 0, if the user selects No (0) then the billling address fields need to be required. Does this make sense? $(input.billing_addr_grp).click(function() { var billing_address = $([name=billing_addr]:checked).val(); }) Then the rules: $('#transaction').validate({ rules: { first: required, last: required, billing_first: { required: function() { return billing_address == 0; } }, billing_last: { required: function() { return billing_address == 0; } } I still can't get them to only be required when the value of the radio button is 0. Any more thoughts? Thanks, MD On May 14, 6:19 pm, James james.gp@gmail.com wrote: Something like: rules: { first: required, last: required, .. billing_first: { required: function() { return billing_address == 1; } }, billing_last: { required: function() { return billing_address == 1; } }, billing_first: { required: function() { return billing_address == 1; } }, billing_address: { required: function() { return billing_address == 1; } }, . }, On May 14, 10:14 am, choffman mountain@gmail.com wrote: Hi There, I could use some help here. I need to place a conditionstatement (if) in thisformvalidationscript. For some reason, I just can't get it to work. Basically, when a user un-checks a particular box (billing_addr) additionalformfields slide down, those fields need to be validated. Ifthe box is checked the fields roll-up, become disable and can be skipped. What's the best way to accomplish this? Thanks, MD $(document).ready(function() { var billing_address = $(input[name='billing_addr']:! checked).val(); $.metadata.setType(validate); $('#mysampleform').validate({ rules: { first: required, last: required, address: required, city: required, state: required, country: required, zip: required, membertype: required, amount: required, state: required, mt: required, email: true, if(billing_address == 1) { alert(billing_address); billing_first: required, billing_last: required, billing_address: required, billing_city: required, billing_state: required, billing_zip: required, billing_email: true }
[jQuery] Re: Sortable accordion-like widget
What UI-LI objects? Your sample code (which I added an extra div level to) only has DIVs and H3s. - Richard On Fri, May 15, 2009 at 2:21 PM, Danny Nolan danny_no...@yahoo.co.ukwrote: Almost, I found it worked almost, except for the fact that the sortable affected only the UL-LI objects, the contents were static. How to get past that? --- On *Fri, 5/15/09, Richard D. Worth rdwo...@gmail.com* wrote: From: Richard D. Worth rdwo...@gmail.com Subject: [jQuery] Re: Sortable accordion-like widget To: jquery-en@googlegroups.com Date: Friday, May 15, 2009, 10:51 AM Sure, here you go: http://jsbin.com/aqeca You can edit this example here: http://jsbin.com/aqeca/edit It's not perfect, since when you sort one, it also toggles it, but it's a start. - Richard On Fri, May 15, 2009 at 10:19 AM, Danny Nolan danny_no...@yahoo.co.ukhttp://mc/compose?to=danny_no...@yahoo.co.uk wrote: Example? Im very new to jQuery, the old code was partially provided by someone else with a few edits, so not sure how to create that new level you was talking about. --- On *Thu, 5/14/09, Richard D. Worth rdwo...@gmail.comhttp://mc/compose?to=rdwo...@gmail.com * wrote: From: Richard D. Worth rdwo...@gmail.comhttp://mc/compose?to=rdwo...@gmail.com Subject: [jQuery] Re: Sortable accordion-like widget To: jquery-en@googlegroups.comhttp://mc/compose?to=jquery...@googlegroups.com Date: Thursday, May 14, 2009, 10:12 PM You'll need to add an extra level: section divs containing each related h3 and content div. Then you can call .sortable() the main div#accordion1 - Richard On Thu, May 14, 2009 at 9:38 PM, DanN danny_no...@yahoo.co.ukhttp://mc/compose?to=danny_no...@yahoo.co.uk wrote: Got this coded, its an accordion like tool. It functions just how I need it, except id love to make it sortable. Anyone help with the code update? jQuery : $(function() { $(#accordion1).addClass(ui-accordion ui-widget ui-helper-reset) .find(h3) .addClass(ui-accordion-header ui-helper-reset ui-state-default ui- corner-top ui-corner-bottom) .prepend('span class=ui-icon ui-icon-triangle-1-e/') .hover(function() { $(this).addClass(ui-state-hover); }, function() { $(this).removeClass(ui-state-hover); }) .click(function() { $(this).toggleClass(ui-accordion-header-active).toggleClass(ui- state-active) .toggleClass(ui-state-default).toggleClass(ui-corner-bottom) .find( .ui-icon).toggleClass(ui-icon-triangle-1-e).toggleClass (ui-icon-triangle-1-s) .end().next().toggleClass(ui-accordion-content-active).toggle(); return false; }) .next().addClass(ui-accordion-content ui-helper-reset ui-widget- content ui-corner-bottom).hide(); }) HTML: div id=accordion1 h3a href=#DRAW2/a/h3 div CONTENT /div h3a href=#DRAW2/a/h3 div CONTENT /div /div Help appreciated in advance.
[jQuery] Re: Sortable accordion-like widget
yep, took me a while to realize that :) Implemented the extra layer of divs and its working great! Thank you so much! UL-LIs was for the tabs above, not involved, my mistake :) --- On Fri, 5/15/09, Richard D. Worth rdwo...@gmail.com wrote: From: Richard D. Worth rdwo...@gmail.com Subject: [jQuery] Re: Sortable accordion-like widget To: jquery-en@googlegroups.com Date: Friday, May 15, 2009, 2:04 PM What UI-LI objects? Your sample code (which I added an extra div level to) only has DIVs and H3s. - Richard On Fri, May 15, 2009 at 2:21 PM, Danny Nolan danny_no...@yahoo.co.uk wrote: Almost, I found it worked almost, except for the fact that the sortable affected only the UL-LI objects, the contents were static. How to get past that? --- On Fri, 5/15/09, Richard D. Worth rdwo...@gmail.com wrote: From: Richard D. Worth rdwo...@gmail.com Subject: [jQuery] Re: Sortable accordion-like widget To: jquery-en@googlegroups.com Date: Friday, May 15, 2009, 10:51 AM Sure, here you go: http://jsbin.com/aqeca You can edit this example here: http://jsbin.com/aqeca/edit It's not perfect, since when you sort one, it also toggles it, but it's a start. - Richard On Fri, May 15, 2009 at 10:19 AM, Danny Nolan danny_no...@yahoo.co.uk wrote: Example? Im very new to jQuery, the old code was partially provided by someone else with a few edits, so not sure how to create that new level you was talking about. --- On Thu, 5/14/09, Richard D. Worth rdwo...@gmail.com wrote: From: Richard D. Worth rdwo...@gmail.com Subject: [jQuery] Re: Sortable accordion-like widget To: jquery-en@googlegroups.com Date: Thursday, May 14, 2009, 10:12 PM You'll need to add an extra level: section divs containing each related h3 and content div. Then you can call .sortable() the main div#accordion1 - Richard On Thu, May 14, 2009 at 9:38 PM, DanN danny_no...@yahoo.co.uk wrote: Got this coded, its an accordion like tool. It functions just how I need it, except id love to make it sortable. Anyone help with the code update? jQuery : $(function() { $(#accordion1).addClass(ui-accordion ui-widget ui-helper-reset) .find(h3) .addClass(ui-accordion-header ui-helper-reset ui-state-default ui- corner-top ui-corner-bottom) .prepend('span class=ui-icon ui-icon-triangle-1-e/') .hover(function() { $(this).addClass(ui-state-hover); }, function() { $(this).removeClass(ui-state-hover); }) .click(function() { $(this).toggleClass(ui-accordion-header-active).toggleClass(ui- state-active) .toggleClass(ui-state-default).toggleClass(ui-corner-bottom) .find( .ui-icon).toggleClass(ui-icon-triangle-1-e).toggleClass (ui-icon-triangle-1-s) .end().next().toggleClass(ui-accordion-content-active).toggle(); return false; }) .next().addClass(ui-accordion-content ui-helper-reset ui-widget- content ui-corner-bottom).hide(); }) HTML: div id=accordion1 h3a href=#DRAW2/a/h3 div CONTENT /div h3a href=#DRAW2/a/h3 div CONTENT /div /div Help appreciated in advance.
[jQuery] Re: Sortable accordion-like widget
Got that sorted, now for something tougher. Say I have two seperate accordions in two areas of a page (two seperate tabs), can I make items movable between those two accordions. Basically each accordion draw hosts a seperate tool my coworkers and I use daily, however every person uses a different set and I would love for each person to be able to display their faves on the front tab accordion, moving the others to the 2nd accordion on a separate tab, no memory or cache is needed.
[jQuery] Re: Sortable accordion-like widget
I wonder if this demo will give you some ideas: http://jqueryui.com/demos/sortable/#connect-lists-through-tabs It's sortable lists that are connected even though they're on separate tabs. If you decided to do something like this and need some help, here would be the place to ask: http://groups.google.com/group/jquery-ui - Richard On Fri, May 15, 2009 at 3:36 PM, DanN danny_no...@yahoo.co.uk wrote: Got that sorted, now for something tougher. Say I have two seperate accordions in two areas of a page (two seperate tabs), can I make items movable between those two accordions. Basically each accordion draw hosts a seperate tool my coworkers and I use daily, however every person uses a different set and I would love for each person to be able to display their faves on the front tab accordion, moving the others to the 2nd accordion on a separate tab, no memory or cache is needed.
[jQuery] Re: New Plugin with IE problem
On May 14, 5:17 am, sebastien creme sebastien.cr...@gmail.com wrote: Dynamic colspan setted via style property seems not work on IE. For some reason, jQuery currently maps rowspan-rowSpan, but not colspan-colSpan. http://dev.jquery.com/ticket/4397 Matt Kruse
[jQuery] help positioning color picker
Hi, i'm using this jquery color picker: http://www.eyecon.ro/colorpicker/ on my page here: www.akbars.net/eurisko/basic.html but i can't seem to position it in the toolbar with the rest of the buttons - its always on a new line... any suggestions? thanks imran
[jQuery] Re: Help with div, css selector, and form field...
Thanks waseem...you've put me on the right track! On May 11, 12:23 pm, waseem sabjee waseemsab...@gmail.com wrote: actually it might work var obj = $(#mdiv select); for(var i=0; i obj.length; i++) { obj.eq(i) } // the above method will get alll select tags within a div tag and loop then if you want to loop the options within them you can either make obj to be $(#mydiv select option); or you can run a loop within a loop like so var obj = $(#mdiv select); for(var i=0; i obj.length; i++) { var objtwo = obj.eq(i); var ops= (option, objtwo); for(var j = 0; j ops.length; i++) { if(ops.eq(i) == 0) { break; } else { // do stuff } } } this should be according to your new idea. but will this really work for you ? too much looping does use more memory. the simple click function i mentioned would use less memory since i set $(select) it would get the click of any select you do click. and it returns the value of the selected item. if you have a specific goal you want to achieve it would allow us to help you better if we knew. script $(function() { $(select).click(function() { var value = $(this).val(); if(val != 0) { // do what you need to do} else { alert(you have not selected an option); } }); }); /script On Mon, May 11, 2009 at 8:47 PM, Loony2nz loony...@gmail.com wrote: @Mike: Yeah that won't work. Most of the values aren't unique. On May 11, 11:43 am, Mean Mike mcgra...@gmail.com wrote: wouldn't it make more sense to just have one drop down menu with all school choices in it ? as long as all the schools differ in value I pretty sure that would make your life easier On May 11, 1:41 pm, Loony2nz loony...@gmail.com wrote: I had a better thought. How do I get the count of select options within a div? I can then loop thru the select options and see if any of them are value 0. Is this possible? On May 11, 10:09 am, waseem sabjee waseemsab...@gmail.com wrote: i suggest for this line option value=Select something/option you assign the value of 0 in order to retrieve this value use the following js script $(function() { $(select).click(function() { var value = $(this).val(); if(val != 0) { // do what you need to do} else { alert(you have not selected an option); } }); }); /script On Mon, May 11, 2009 at 6:55 PM, Loony2nz loony...@gmail.com wrote: I need some help with jquery's syntax for how to pop an error message when a select field is blank. There's a form that uses the same css class for all of it's form fields. However, I would like to check to see if at least one section of the form is not blank. Here's my code: div id=schoolchoices select name=9378_choice class=schoolDropList option value=Select something/option option value=1010/option option value=2020/option option value=3030/option option value=4040/option option value=5050/option /select br /br / select name=3483_choice class=schoolDropList option value=Select something/option option value=1010/option option value=2020/option option value=3030/option option value=4040/option option value=5050/option /select br /br / select name=2384_choice class=schoolDropList option value=Select something/option option value=1010/option option value=2020/option option value=3030/option option value=4040/option option value=5050/option /select /div I need to check to see if at least one of the above is not blank. Here's the catch. The list of school choices is variable. It can be 1 school choice, it could be 4 school choices. But it's dynamically generated and I need to create a jquery js function that will validate at least 1 of the x school choices are chosen. The value of the select statement is dynamically generated to use the school's database ID. There are other form elements to this sample code, but I only need this section of the form validated. Thoughts on how to progress? Thanks!
[jQuery] 2 Image Fade
Hi everyone. I am wondering how I can make a fade between two photos in the background of a body of text and then have the photos change every other photo (if that makes sense). Thanks for any help.
[jQuery] center align absolute positioned element
I want to align an absolute positioned image horizontally center inside its parent element. Is there any script or guide to do that ?
[jQuery] how to uncheck the check box
Thanks for your response , In my application i dont want default checked = checked , Then how i do Peter , Thanks There are a few ways to do this. You can select by class, in which case you give a group of checkboxes the same class $(function(){ // attach a click event to each checkbox whose class is 'onechecked' $(':checkbox.onechecked').click(function(){ // if the clicked checkbox is checked (no need to do anything if it is being unchecked) if (this.checked) { // loop through all other checkboxes with the same class $(':checkbox.onechecked').each(function(){ // uncheck all of them this.checked = false; }); // re-check the one clicked this.checked = true; } }); }); HTML: fieldset input type=checkbox checked=checked name=cb1 class=onechecked / input type=checkbox name=cb2 class=onechecked / input type=checkbox name=cb3 class=onechecked / input type=checkbox name=cb4 class=onechecked / /fieldset you can also use the name attribute of the checkbox to group them - this could work for multiple groups of checkboxes - this example assumes that each group of checkboxes has the same name attribute, and those you want to limit to one selection are prefixed 'limit' $(function(){ // attach a click event to each checkbox whose name begins with 'limit' $(':checkbox[name^=limit]').click(function(){ // store the name of the checkbox which has been clicked var inputname = $(this).attr(name); // if the clicked checkbox is checked (no need to do anything if it is being unchecked) if (this.checked) { // loop through all other checkboxes with the same name attribute as the one clicked $(':checkbox[name='+inputname+']').each(function(){ // uncheck all of them this.checked = false; }); // re-check the one clicked this.checked = true; } }); }); HTML: fieldset input type=checkbox checked=checked name=limit1 / input type=checkbox name=limit1 / input type=checkbox name=limit1 / input type=checkbox name=limit1 / /fieldset fieldset input type=checkbox checked=checked name=limit2 / input type=checkbox name=limit2 / input type=checkbox name=limit2 / input type=checkbox name=limit2 / /fieldset There are other ways as well, but this should give you some idea about some of the possibilities. on 15/05/2009 15:48 elubin said:: add a click handler to each checkbox (you could use a selector and loop through with $.each). when clicked, the function could use the same selected and loop through again making sure the others are off. Eric On May 15, 10:38 am, bharani kumar bharanikumariyer...@gmail.com wrote: Hi all Can u tell me , how to uncheck the check box , when i check another check box, for example having 4 check boxes, be default check box is checked ,. when i check the check box 2 , then need to uncheck the checked one , How to do this in jquery , Thanks -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINIONhttp://bharanikumariyerphp.site88.net/bharanikumar/ -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINION http://bharanikumariyerphp.site88.net/bharanikumar/
[jQuery] Plugin Newb: Internal Functions
First, a thousand pardons! I see several threads that kinda' address my question, but they're all a little over my head. On the makeGreen function below, is this an acceptable way to implement an internal function? If I'm guessing right, we're operating on an object, so arguments are passed by reference, and this is NOT a memory leak? (function(jQuery){ jQuery.fn.ajaxMemo = function(options){ var defaults = { receivingPage: '/ajax/async-home.php' }; var options = $.extend(defaults, options); return this.each(function(){ var obj = $(this); makeGreen(obj); }); function makeGreen(obj){ obj.click(function(){ obj.css(backgroundColor,green); }); } }; })(jQuery);
[jQuery] binding
Hi, How can I bind this function to all image tag ? var img_width = $('#slide img:visible').width(); var frame_width = $('#slide img:visible').parent().width(); var target_width = (frame_width-img_width)/2; $('#slide img:visible').css({'left':target_width}); appreciate the help.
[jQuery] jQuery iPhone Flick Action (for mouse)
I've been looking for a plugin to be able to use the mouse and eventually the iphone to flick and navigate through a page. Does anyone know if there are examples that exist currently. I think i'd probably have to implement it using the scrollTo plugin to do the scrolling. With luck i was able to find that there is an iPhone only flick type plugin already written but nothing yet for the mouse. Anyone have ideas?