[jQuery] Re: Obama's site jquery mystery
I took a quick look at the main page using Firebug. Switching languages makes an ajax post to this url: http://www.voteforchange.com/controller.php and posts these values: languagespanish namescurrent_page pagepre_intro_info perm_namescurrent_page perm_valuespre_intro_info skip0 updateLanguagetrue valuespre_intro_info vbm0 The response that comes back from the post is the HTML for the form, which then gets displayed. Here's a link to Firebug if you're not familiar with it: http://getfirebug.com/ - Jack stephen wrote: I've gone through voteforchange.com a thousand times over the past two days and I cannot figure out where the content is coming from--I can find the content of index.php, but everything else is a mystery--links never point anywhere. Is this jQuery in action, or is it something else to blame? Any ideas would be greatly appreciated-- I think I've checked over every .js and .css and the single .php I could find--and everything just leads into loops. I'm new at this, it seems. Thanks!
[jQuery] Re: jQModal loading separate urls into div
With so little data it's hard to really give an advise. do you populate the content inside the div via an ajax call? Then you need to bind their click event (after they have been loaded see livequery plugin), to a function that does ajax calls inside the div you could also use an iframe ( http://www.pixeline.be/blog/2008/javascript-loading-external-urls-in-jqmodal-jquery-plugin/ ) and for the links inside the loaded page, add the target attribute point to _self. cheers alex On Thu, Oct 23, 2008 at 12:04 AM, jalanbyers [EMAIL PROTECTED] wrote: Hi, I was wondering if anyone had luck with using as persistent modal window. In other words, I have a .jgmAddClose element inside the div but I also want other links within the div to actually load new url in the div rather than the 'parent'... Thanks for any insight..
[jQuery] Re: Looping not working for selectors?
On 22:12:19 Oct 22, Michael Geary wrote: There are many ways I could imagine a piece of code not working. Could you be more specific about what didn't work? :-) I did not want to be verbose. Your analysis is correct. I did not get the value I expected. I was getting the last value as reasoned by you. Does it get into your click function at all? What happens if you put an alert() inside the click function, before the .monitor code? It works but the value of i is wrong. Or does it get there, but the value of i is not what you expect? Why would i have the wrong value? This code has a single variable i. The variable starts with a value of 0, and after the for loop completes, the value of i is 10. When you click one of your items, the code will use the *current* value of i, which is 10. But that is not what I would expect. ;) You could fix it by introducing a function: for(i = 0; i 10; i++) clicker( i ); function clicker( i ) { $('.treeview:eq(' +i+ ')').click(function() { $('.monitor:eq(' +i+ ')').trigger('click'); }); } Does it involved the scary javascript closure concept? ;) Or you could let jQuery do some of the work for you, like this: $('.treeview:lt(10)').each( function( i ) { $(this).click(function() { $('.monitor:eq(' +i+ ')').trigger('click'); }); }); If you don't really need the limit of 10, you can omit the :lt(10) in the first line. I actually replaced my long code with this piece of beauty. ;) $('.treeview').each( function( i ) { $(this).click(function() { $('.monitor:eq(' +i+ ')').trigger('click'); }); }); And it works like a charm. ;) Many thanks Mike. Ever learning. -Girish
[jQuery] Re: [autocomplete] do search on input focus
Oups, I think it should be: $(function() { $(#category).focus(function(){this.autocomplete(do_search.php,{max:100,minChars:0,delay:10}) }); }); On Thu, Oct 23, 2008 at 12:16 AM, blasto333 [EMAIL PROTECTED] wrote: That didn't work either. If I double click in the field, the expected behavior occurs. On Oct 22, 10:41 am, Isaak Malik [EMAIL PROTECTED] wrote: I have no idea which autocomplete plugin you're using but does the following work for you? $(function() { $(#category).focus(function(){$(this).autocomplete(do_search.php,{max:1 00,minChars:0,delay:10}) }); }); On Wed, Oct 22, 2008 at 4:19 PM, blasto333 [EMAIL PROTECTED] wrote: Is there a way to force a field to do a search on focus of the input? (I basically want the user to be suggested a default set of items before typing anything. I tried this $(#category).autocomplete(do_search.php,{max:100,minChars:0,delay: 10}); -- Isaak Malik Web Developer -- Isaak Malik Web Developer
[jQuery] nooby question
Hi All, I want to change the border color of a div to white and at the same time change text inside to white. So Im doing something like this: $(#frame div).hover( function(){ $ (this).css({borderColor:#ff}).filter(h5).css({color:#fff}); }, function() { // another function }); Also going to add this: .end().filter(img).css({borderColor:#fff}); // not working too Can anyone help?
[jQuery] how to do it?
Hi, I'm trying to make a little different code than below. I would put on the bottom new tabs(id=fragment-5, id=fragment-5). Text from new tabs after clikc should be display in the same border as id=fragment-1 or 2, 3. It doesn't work well. U can see just copy the code? I dont need ul on the bottom enought is a. How to do it? Does anybody can help me? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head script src=http://code.jquery.com/jquery-latest.js;/script link rel=stylesheet href=http://dev.jquery.com/view/tags/ui/ latest/themes/flora/flora.all.css type=text/css media=screen title=Flora (Default) script type=text/javascript src=http://dev.jquery.com/view/tags/ ui/latest/ui/ui.core.js/script script type=text/javascript src=http://dev.jquery.com/view/tags/ ui/latest/ui/ui.tabs.js/script script $(document).ready(function(){ $(#example ul).tabs(); }); /script /head body div id=example class=flora ul lia href=#fragment-1spanOne/span/a/li lia href=#fragment-2spanTwo/span/a/li lia href=#fragment-3spanThree/span/a/li div id=fragment-1 pFirst tab is active by default:/p precode$('#example ul').tabs();/code/pre /div div id=fragment-2 SECOND Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. /div div id=fragment-3 THIRD Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. /div div id=fragment-4 FOUR Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. /div div id=fragment-5 FIVE Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. /div lia href=#fragment-4spanfour/span/a/li lia href=#fragment-5spanfive/span/a/li /ul /div /body /html
[jQuery] Uicalendar
Hi I'm new to this group and i use Jquery for a short time. I've used uicalendar and it run very well. I used the popup behavior in order to open the calendar when the user clic on a button. Now, i'de like to always show the calendar in a fixed div, not in a popup, in order to see it as soon as the page is open, not only on an user action. It is possible and if it, how can i do. Thanks in advance. Regards Alexandre
[jQuery] 44670 data() calls
hi, im trying to tackle a problem at the moment, that problem is working wit ha .net developer, but that aside, we're trying to ge to the bottom of a problem.the dveeloper has wired up the template and whenever we click a link on thepage it takes forever to rerender, ie we're on default.aspx and we click the link to go to default.aspx and it takes forever. the script hangs and reports an error with the data() call on line xxx of jquery.js, which corresponds to the line data function is on. i#'m pulling my hair out trying to work out what is happening as he doens't have any real knowledge of js/jquery or indeed modern techonologies so im wondering if anyone oculd shine some liht on this?!! i've tried running the profiler in firebug and it shows 44670 calls to data() and so on...is this abnormally high? nothing like this is happening on the static templates that i built and whilst im fairly new to jQuery i have a fair understanding of it. does anyone else have any experience of .net ajax with jQuery and possibly come across anyhting like this before? thanks very much in advance for any light shed on the matter!!! cheer,s tom
[jQuery] Re: How to stop change event from firing
Thanks for the tip, ricardo. I've decided to initialise the dropdowns with the existing form values before triggering a click event, but I've run into another problem. I can't seem to set the selected option. I've tried the following with a hardcoded value for state without any luck. $('#field-state').val(state); $(#field-state).val(state).attr(selected,selected); $(#field-state [EMAIL PROTECTED]).attr(selected,selected); Yet the dropdowns always have the first item in the options selected. Interestingly, the following works if you need to set the dropdown to select the ' ' option. $('#field-state').val(' '); Any other value just won't keep though. Seems like this is a common problem based on some googling. Anyone else encountered this and found a workaround? On Oct 17, 7:10 pm, ricardobeat [EMAIL PROTECTED] wrote: You can do $(#field-state).unbind('change'); when it starts being edited and bind the function again when it's done, or you can put everything in the function inside an IF statement which depends on the edit mode. - ricardo On Oct 17, 12:41 pm, newkid85 [EMAIL PROTECTED] wrote: I have a form with three dependent location select fields and a text field which lets a user add a new city if it is missing from the dropdown. The following function works fine when I create a new form. It puts the fields in sync to start with and keeps them that way when the user makes their selections. There is a problem though when the form is edited. This is because once the page loads the function below automatically puts the fields back in sync before the user does anything like on the initial creation. So the previously selected values are overwritten. When the form is being edited I would like to have thechangeevent only fire if the user actually changes any of the dropdowns themselves. I am able to check if the form is being edited or created but not sure how tochangemy function. function() { $(#update-button).hide(); if ($(#field-city-text).val() == '') { $(#field-city-text-wrapper).hide(); } $(#field-country).change(function () { var country = $(this).val(); $(#field-city-wrapper).hide(); $(#field-city).val(''); updateState(); }) .change(); $(#field-state).change(updateCity).change(addCity); $(#field-city).change(addCity); } Any thoughts appreciated.
[jQuery] Re: nooby question
Hello, You need to use .find() instead of .filter() for what you are trying to do. Another thing to consider would be to simply add and remove a class on hover, rather than applying the styles directly. Joel Birch.
[jQuery] .attr('height')
Hi all, I'm building a gallery, and so far it works in every browser except Internet Explorer, The problem is that IE (burns to hell) doesn't read these variables var height = $('#'+litebox+'img.lite').attr('height'); var width = $('#'+litebox+'img.lite').attr('width'); the alert (alert(litebox+'-'+height + '-'+width );) returns img1-0-0 and i really don't know why I tried to change the attributes height and width, in title and alt, giving the dimensions to the image in that way , and it works, but I cannot use title and alt to assign dimensions. I just want to understand why it does not work.. Below a part of the js code: $('.img_in li a ').click(function () { $('.bg_thumbs').show().css({'opacity':'0','z- index':'999'}).fadeTo(200,0.4) $('.thumbs_big ').css({ 'background-color':'#000', 'background-image':'url(css3/ajax-loader.gif)', 'background-repeat':'no-repeat', 'background-position':'center'}) var litebox = $(this).attr('rel'); var height = $('#'+litebox +'img.lite').attr('height'); var width = $('#'+litebox +'img.lite').attr('width'); $('#'+litebox).show().css('opacity',0).animate({ borderWidth : '4px', top :'50%', height : (height ) + 'px' , width : (width ) + 'px' , marginLeft : '-' +((width )/2) +'px', marginTop : '-' +((height )/2) +'px', opacity : 1 },600) alert(litebox+'-'+height + '-'+width ); $('#'+litebox).queue(function(){ $('.thumbs_big img').css({'opacity':'0' ,'display' : 'block'}).fadeTo(300,1) $('.thumbs_big ').css('background','#000') $('#'+litebox).dequeue() }); return false; }); and here a part of html code: li id=img_1 title=thumb_1 a href=# rel=img1img src=images/diegovalobra.jpg alt=prova width=200 height=139 id=thumb_1//a /li span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg alt=prova width=900 height=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span I've tested the code in firefox, opera, google chrome, safari(pc) and works fine... IE sucks every kind of help is appreciated, thanks to all :) Diego
[jQuery] Re: menu display slowly
Hello, The option you need to change is 'speed'. Try setting it to 'fast' or even 1 (which would be 1 millisecond) for effectively no animation. The 'delay' option only affects how long the submenus stay open after mouseout. Joel Birch.
[jQuery] Re: .attr('height')
hi, what about using: $('#'+litebox+'img.lite').width(); and $('#'+litebox+'img.lite').height(); ? -weidc On 23 Okt., 14:00, diego [EMAIL PROTECTED] wrote: Hi all, I'm building a gallery, and so far it works in every browser except Internet Explorer, The problem is that IE (burns to hell) doesn't read these variables var height = $('#'+litebox+'img.lite').attr('height'); var width = $('#'+litebox+'img.lite').attr('width'); the alert (alert(litebox+'-'+height + '-'+width );) returns img1-0-0 and i really don't know why I tried to change the attributes height and width, in title and alt, giving the dimensions to the image in that way , and it works, but I cannot use title and alt to assign dimensions. I just want to understand why it does not work.. Below a part of the js code: $('.img_in li a ').click(function () { $('.bg_thumbs').show().css({'opacity':'0','z- index':'999'}).fadeTo(200,0.4) $('.thumbs_big ').css({ 'background-color':'#000', 'background-image':'url(css3/ajax-loader.gif)', 'background-repeat':'no-repeat', 'background-position':'center'}) var litebox = $(this).attr('rel'); var height = $('#'+litebox +'img.lite').attr('height'); var width = $('#'+litebox +'img.lite').attr('width'); $('#'+litebox).show().css('opacity',0).animate({ borderWidth : '4px', top :'50%', height : (height ) + 'px' , width : (width ) + 'px' , marginLeft : '-' +((width )/2) +'px', marginTop : '-' +((height )/2) +'px', opacity : 1 },600) alert(litebox+'-'+height + '-'+width ); $('#'+litebox).queue(function(){ $('.thumbs_big img').css({'opacity':'0' ,'display' : 'block'}).fadeTo(300,1) $('.thumbs_big ').css('background','#000') $('#'+litebox).dequeue() }); return false; }); and here a part of html code: li id=img_1 title=thumb_1 a href=# rel=img1img src=images/diegovalobra.jpg alt=prova width=200 height=139 id=thumb_1//a /li span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg alt=prova width=900 height=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span I've tested the code in firefox, opera, google chrome, safari(pc) and works fine... IE sucks every kind of help is appreciated, thanks to all :) Diego
[jQuery] Re: .attr('height')
here an exemple http://www.pirolab.it/piro_09/index2.html the first three thumbs of the first box diego On 23 Ott, 14:00, diego [EMAIL PROTECTED] wrote: Hi all, I'm building a gallery, and so far it works in every browser except Internet Explorer, The problem is that IE (burns to hell) doesn't read these variables var height = $('#'+litebox+'img.lite').attr('height'); var width = $('#'+litebox+'img.lite').attr('width'); the alert (alert(litebox+'-'+height + '-'+width );) returns img1-0-0 and i really don't know why I tried to change the attributes height and width, in title and alt, giving the dimensions to the image in that way , and it works, but I cannot use title and alt to assign dimensions. I just want to understand why it does not work.. Below a part of the js code: $('.img_in li a ').click(function () { $('.bg_thumbs').show().css({'opacity':'0','z- index':'999'}).fadeTo(200,0.4) $('.thumbs_big ').css({ 'background-color':'#000', 'background-image':'url(css3/ajax-loader.gif)', 'background-repeat':'no-repeat', 'background-position':'center'}) var litebox = $(this).attr('rel'); var height = $('#'+litebox +'img.lite').attr('height'); var width = $('#'+litebox +'img.lite').attr('width'); $('#'+litebox).show().css('opacity',0).animate({ borderWidth : '4px', top :'50%', height : (height ) + 'px' , width : (width ) + 'px' , marginLeft : '-' +((width )/2) +'px', marginTop : '-' +((height )/2) +'px', opacity : 1 },600) alert(litebox+'-'+height + '-'+width ); $('#'+litebox).queue(function(){ $('.thumbs_big img').css({'opacity':'0' ,'display' : 'block'}).fadeTo(300,1) $('.thumbs_big ').css('background','#000') $('#'+litebox).dequeue() }); return false; }); and here a part of html code: li id=img_1 title=thumb_1 a href=# rel=img1img src=images/diegovalobra.jpg alt=prova width=200 height=139 id=thumb_1//a /li span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg alt=prova width=900 height=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span I've tested the code in firefox, opera, google chrome, safari(pc) and works fine... IE sucks every kind of help is appreciated, thanks to all :) Diego
[jQuery] .load() and relative links
I'm using .load(url) to add som contents from another page. Problem: after being loaded, the links included from the other page does not work anymore as they are relative to the path of the page. Is there a simple way/plugin to transform the URLs in the included page? Thanks, Koen
[jQuery] JQuery SEO Question
Hi I am creating a product page that has a jquery script that hides/ unhides divs to show the currently select product. I've just realised that we have too many products to load them all on the same page. Instead I want to load the content of each div in when they are selected. That means that the pages I am loading from will not be spidered as they are javascript loads. Doing a bit of reading I noticed that some people were talking about putting an anchor tag in too. What do I do, just put a load of anchor tags at the bottom to all the content that will be loaded via jquery, with no anchor text or something. So that the anchor tags are there for the spider bot but not for the user. ? Ed
[jQuery] Re: .attr('height')
The problem is that the my elements are 'display:none' that's why if i try your code the alert returns 0-0, i need to use .attr, height and width.. Diego On 23 Ott, 14:08, diego [EMAIL PROTECTED] wrote: here an exemplehttp://www.pirolab.it/piro_09/index2.html the first three thumbs of the first box diego On 23 Ott, 14:00, diego [EMAIL PROTECTED] wrote: Hi all, I'm building a gallery, and so far it works in every browser except Internet Explorer, The problem is that IE (burns to hell) doesn't read these variables var height = $('#'+litebox+'img.lite').attr('height'); var width = $('#'+litebox+'img.lite').attr('width'); the alert (alert(litebox+'-'+height + '-'+width );) returns img1-0-0 and i really don't know why I tried to change the attributes height and width, in title and alt, giving the dimensions to the image in that way , and it works, but I cannot use title and alt to assign dimensions. I just want to understand why it does not work.. Below a part of the js code: $('.img_in li a ').click(function () { $('.bg_thumbs').show().css({'opacity':'0','z- index':'999'}).fadeTo(200,0.4) $('.thumbs_big ').css({ 'background-color':'#000', 'background-image':'url(css3/ajax-loader.gif)', 'background-repeat':'no-repeat', 'background-position':'center'}) var litebox = $(this).attr('rel'); var height = $('#'+litebox +'img.lite').attr('height'); var width = $('#'+litebox +'img.lite').attr('width'); $('#'+litebox).show().css('opacity',0).animate({ borderWidth : '4px', top :'50%', height : (height ) + 'px' , width : (width ) + 'px' , marginLeft : '-' +((width )/2) +'px', marginTop : '-' +((height )/2) +'px', opacity : 1 },600) alert(litebox+'-'+height + '-'+width ); $('#'+litebox).queue(function(){ $('.thumbs_big img').css({'opacity':'0' ,'display' : 'block'}).fadeTo(300,1) $('.thumbs_big ').css('background','#000') $('#'+litebox).dequeue() }); return false; }); and here a part of html code: li id=img_1 title=thumb_1 a href=# rel=img1img src=images/diegovalobra.jpg alt=prova width=200 height=139 id=thumb_1//a /li span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg alt=prova width=900 height=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span I've tested the code in firefox, opera, google chrome, safari(pc) and works fine... IE sucks every kind of help is appreciated, thanks to all :) Diego
[jQuery] Re: nooby question
Cheers this works perfectly. On Oct 23, 12:44 pm, Joel Birch [EMAIL PROTECTED] wrote: Hello, You need to use .find() instead of .filter() for what you are trying to do. Another thing to consider would be to simply add and remove a class on hover, rather than applying the styles directly. Joel Birch.
[jQuery] JQuery SEO Question
Hi I am creating a product page that has a jquery script that hides/ unhides divs to show the currently select product. I've just realised that we have too many products to load them all on the same page. Instead I want to load the content of each div in when they are selected. That means that the pages I am loading from will not be spidered as they are javascript loads. Doing a bit of reading I noticed that some people were talking about putting an anchor tag in too. What do I do, just put a load of anchor tags at the bottom to all the content that will be loaded via jquery, with no anchor text or something. So that the anchor tags are there for the spider bot but not for the user. ? Ed
[jQuery] jQuery Form Plugin - success callback function isn't called
Hey guys, I'm working with the jQuery Form Plugin and I'm having some trouble with it. In my HTML I have a button, which, when clicked, inserts a form via jQuery. To then register the form's submit event, I use the livequery plugin in my (document).ready function: (document).ready(function($) { var options = { target: '#editable_content', // target element(s) to be updated with server response success: function(responseText, statusText) { alert(responseText); }, // post-submit callback }; $('.edit_contact').livequery('submit', function() { $(this).ajaxSubmit(options); return false; }); }); The form submits as it should, using an AJAX call. When I add a beforeSubmit callback function to the options array, that gets called as well, as it should. Only the success callback (the alert) isn't called and I don't know why. Can anyone help??? Regards, Sebastian
[jQuery] Re: Cycle: Direct link from another page
Alright, This is really messy, but it works. If anyone's got any tips on cleaning it up, have at it. if ($('body').is('#page-photography')) { //I only want it to fire on one page. Guessing I save some miniscule amount of overhead on the other pages. var loc = window.location.hash; // get the anchor from the link, sohttp://www.example.com/index.php#testwould give me #test loc = loc.replace(/\#/g,); // remove the pound symbol to give me just test var j = 0; // set a variable i'll be incrementing later. i have to do this because of some messy html later on. var goHere = 0; //set this so that, no matter what, the startingSlide parameter gets something $(#view-photos-block_1).children().children().each(function(i) { //i'm sure this could be cleaner. that might also be able to remove the j variable. if($(this).attr('id')) { //find out if there even is an id attribute; important because this is what controls j incrementin if($(this).attr('id') == loc) { //if the id and the anchor are the same, set goHere. this will later be used as the startingSlide parameter goHere = j; } j++; //increment j; this give me the real 0 index of the slide. } }) } I would think your code could be simplified down to something resembling this: var $slide = $(window.location.hash); if ($slide.length) { // found a match on hash id var $slideshow = $slide.parent(); var index = $slideshow.index($slide); $slideshow.cycle({ startindIndex: index }); }
[jQuery] cannot reset width value _ width(val)
Hi all, i'm trying to kill the last bugs of lisapram.com before letting the project go _ the issue i'm facing is that i can't manage or don't understand how to stop and reset the animation queue. To reproduce the issue please go here: http://www.lisapram.com/ click on one of the fifth line (big and fat) in the barcode at the center of the screen: it opens up to display a strip of images. Its width will gradually expand to 12900 px Now, click refresh , see the value of set number 5. It's gradually increasing to 12900px, fine. Now, hit one of the above keywords, e.g. experimental . It should reset the barcode. But it does not properly do it because the set 5 is still increasing its width, no matter what i try. I have a barcode.reset() function that should take care of that, here is the code so far, that does not work, the css width is not properly applied (as reported by my custom debugger ). barcode.reset = function() { barcode.canOpen = false; // unbind all click events $('#barcode li img').hide(); $('li', barcode.el).removeClass('active').addClass('notActive').unbind().css({ cursor: 'default', width: '1px' }).each(function(i) { //$('img', $(this)).hide(); if (barcode.allSets.length 0) { $(this).css({ width: barcode.allSets[i].smallWidth }); $(this).width(barcode.allSets[i].smallWidth); $.log('barcode reset of set ' + i + ' to width ' + barcode.allSets[i].smallWidth); //$.log('li nr' + i + '= ' + barcode.allSets[i].smallWidth); } if ($(this).is(':animated')) { $(this).stop(); $(this).css({ width: barcode.allSets[i].smallWidth }); $(this).width(barcode.allSets[i].smallWidth); } }); } What am i doing wrong? Thank you for your time, alexandre
[jQuery] Re: jsonp to WCF problem
If you're going to do cross-domain calls you can't do a POST, only a GET. I think even if you specify POST as your type jQuery will convert it to a GET if your datatype is jsonp (check their doc but I'm pretty sure that's the case). As for WCF the key is just making sure that you wrap your return in the callback method and write it to the Response. In other words, you can't simply have a WCF endpoint that returns a json-formatted object. Instead you need to write something like callbackMethodName( + yourJSONObject + ); to the Response. Once you've done this jQuery will execute the callback call, in which it will do an eval() on yourJSONObject and then call the success method, passing it the JSON object in the data parameter. At that point you will have dot notation on your JSON object. On Oct 22, 7:31 pm, RWF [EMAIL PROTECTED] wrote: I am using WCF too, have you done projects that require an $.ajax POST request to a WCF service cross site? If you have, how did come up with a server proxy to allow for cross site communication? On Oct 10, 2:01 pm, tenaciousd [EMAIL PROTECTED] wrote: Nevermind. The fundamental issue was that the json object wrapped in the callback name does, in fact, need to be written to the Response. I'm an idiot. Anyway, it's working now. If others hit the same jquery -jsonp- wcf issue let me know. On Oct 10, 12:07 pm, tenaciousd [EMAIL PROTECTED] wrote: I'm using jQuery $.ajax to make a cross-domainjsonpcall to a WCF service. The call is working fine, entering the service endpoint, but the callback method never fires. I've tried many permutations of changes and can't seem to get this to work. The WCF endpoint is returning a string (NOT doing a Response.Write) that contains a json object inside the callback wrapper (e.g. jsonp123( {Author:John Doe,Price:$35.90} ) ) and the content- type returned from the service is application/json; charset=utf-8. $.ajax call is below. Any help is much appreciated. var data = {ISBN : $(#isbn1).val()}; $.ajax({ type: GET, cache: false, url: http://localhost:63132/Widget.svc/GetProductInfo;, scriptCharset: utf-8, dataType: jsonp, data: data, success: function(data, textStatus){ alert(success); }, error: function(XMLHttpRequest, textStatus, errorThrown){ alert('error'); } });
[jQuery] Re: .attr('height')
mh ye i see. can't even change the attr in ie itself 'cause it always gets 0 again. maybe it doesn't like that in $('#'+litebox+'img.lite'). atm i don't see a mistake in your script. -weidc On 23 Okt., 14:27, diego [EMAIL PROTECTED] wrote: The problem is that the my elements are 'display:none' that's why if i try your code the alert returns 0-0, i need to use .attr, height and width.. Diego On 23 Ott, 14:08, diego [EMAIL PROTECTED] wrote: here an exemplehttp://www.pirolab.it/piro_09/index2.html the first three thumbs of the first box diego On 23 Ott, 14:00, diego [EMAIL PROTECTED] wrote: Hi all, I'm building a gallery, and so far it works in every browser except Internet Explorer, The problem is that IE (burns to hell) doesn't read these variables var height = $('#'+litebox+'img.lite').attr('height'); var width = $('#'+litebox+'img.lite').attr('width'); the alert (alert(litebox+'-'+height + '-'+width );) returns img1-0-0 and i really don't know why I tried to change the attributes height and width, in title and alt, giving the dimensions to the image in that way , and it works, but I cannot use title and alt to assign dimensions. I just want to understand why it does not work.. Below a part of the js code: $('.img_in li a ').click(function () { $('.bg_thumbs').show().css({'opacity':'0','z- index':'999'}).fadeTo(200,0.4) $('.thumbs_big ').css({ 'background-color':'#000', 'background-image':'url(css3/ajax-loader.gif)', 'background-repeat':'no-repeat', 'background-position':'center'}) var litebox = $(this).attr('rel'); var height = $('#'+litebox +'img.lite').attr('height'); var width = $('#'+litebox +'img.lite').attr('width'); $('#'+litebox).show().css('opacity',0).animate({ borderWidth : '4px', top :'50%', height : (height ) + 'px' , width : (width ) + 'px' , marginLeft : '-' +((width )/2) +'px', marginTop : '-' +((height )/2) +'px', opacity : 1 },600) alert(litebox+'-'+height + '-'+width ); $('#'+litebox).queue(function(){ $('.thumbs_big img').css({'opacity':'0' ,'display' : 'block'}).fadeTo(300,1) $('.thumbs_big ').css('background','#000') $('#'+litebox).dequeue() }); return false; }); and here a part of html code: li id=img_1 title=thumb_1 a href=# rel=img1img src=images/diegovalobra.jpg alt=prova width=200 height=139 id=thumb_1//a /li span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg alt=prova width=900 height=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span I've tested the code in firefox, opera, google chrome, safari(pc) and works fine... IE sucks every kind of help is appreciated, thanks to all :) Diego
[jQuery] Re: Combining selectors
All of them work. Thank you all. On Oct 22, 6:35 pm, ricardobeat [EMAIL PROTECTED] wrote: That should work, but it's worth noting that the '@' in front of attribute names has been deprecated. $('input[type=button],input[type=submit],input[type=reset]') jQuery also has pseudo-selectors for these elements: $(':button,:submit,:reset') []s - ricardo On Oct 22, 6:25 pm, Mauricio \(Maujor\) Samy Silva [EMAIL PROTECTED] wrote: Try: $([EMAIL PROTECTED]'button'], [EMAIL PROTECTED]'submit'], [EMAIL PROTECTED]'reset']).addClass(button); See:http://docs.jquery.com/Selectors/multiple#selector1selector2selectorN Mauricio - I need help in this compound selector problem. I have the following jQuery statements, which are working: $([EMAIL PROTECTED]'button']).addClass(button); $([EMAIL PROTECTED]'submit']).addClass(button); $([EMAIL PROTECTED]'reset']).addClass(button);
[jQuery] Re: .attr('height')
Hi weidc, look at this..i've changed the .attr : var litebox = $(this).attr('rel'); var altezza = $('#'+litebox+'img.lite').attr('alt'); and the html span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg title=900 alt=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span and it works in ie6/7 , i really don't understand.. http://www.pirolab.it/piro_09/index2.html On 23 Ott, 15:23, weidc [EMAIL PROTECTED] wrote: mh ye i see. can't even change the attr in ie itself 'cause it always gets 0 again. maybe it doesn't like that in $('#'+litebox+'img.lite'). atm i don't see a mistake in your script. -weidc On 23 Okt., 14:27, diego [EMAIL PROTECTED] wrote: The problem is that the my elements are 'display:none' that's why if i try your code the alert returns 0-0, i need to use .attr, height and width.. Diego On 23 Ott, 14:08, diego [EMAIL PROTECTED] wrote: here an exemplehttp://www.pirolab.it/piro_09/index2.html the first three thumbs of the first box diego On 23 Ott, 14:00, diego [EMAIL PROTECTED] wrote: Hi all, I'm building a gallery, and so far it works in every browser except Internet Explorer, The problem is that IE (burns to hell) doesn't read these variables var height = $('#'+litebox+'img.lite').attr('height'); var width = $('#'+litebox+'img.lite').attr('width'); the alert (alert(litebox+'-'+height + '-'+width );) returns img1-0-0 and i really don't know why I tried to change the attributes height and width, in title and alt, giving the dimensions to the image in that way , and it works, but I cannot use title and alt to assign dimensions. I just want to understand why it does not work.. Below a part of the js code: $('.img_in li a ').click(function () { $('.bg_thumbs').show().css({'opacity':'0','z- index':'999'}).fadeTo(200,0.4) $('.thumbs_big ').css({ 'background-color':'#000', 'background-image':'url(css3/ajax-loader.gif)', 'background-repeat':'no-repeat', 'background-position':'center'}) var litebox = $(this).attr('rel'); var height = $('#'+litebox +'img.lite').attr('height'); var width = $('#'+litebox +'img.lite').attr('width'); $('#'+litebox).show().css('opacity',0).animate({ borderWidth : '4px', top :'50%', height : (height ) + 'px' , width : (width ) + 'px' , marginLeft : '-' +((width )/2) +'px', marginTop : '-' +((height )/2) +'px', opacity : 1 },600) alert(litebox+'-'+height + '-'+width ); $('#'+litebox).queue(function(){ $('.thumbs_big img').css({'opacity':'0' ,'display' : 'block'}).fadeTo(300,1) $('.thumbs_big ').css('background','#000') $('#'+litebox).dequeue() }); return false; }); and here a part of html code: li id=img_1 title=thumb_1 a href=# rel=img1img src=images/diegovalobra.jpg alt=prova width=200 height=139 id=thumb_1//a /li span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg alt=prova width=900 height=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span I've tested the code in firefox, opera, google chrome, safari(pc) and works fine... IE sucks every kind of help is appreciated, thanks to all :) Diego
[jQuery] Re: .attr('height')
hi weidc, i've changed the .attr: var altezza = $('#'+litebox+'img.lite').attr('alt'); var larghezza = $('#'+litebox+'img.lite').attr('title'); span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg title=900 alt=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span and it works fine in ie6/7 http://www.pirolab.it/piro_09/index2.html but i can't use that attributes, i have to find a better way to do it. Any idea?? Diego On 23 Ott, 15:23, weidc [EMAIL PROTECTED] wrote: mh ye i see. can't even change the attr in ie itself 'cause it always gets 0 again. maybe it doesn't like that in $('#'+litebox+'img.lite'). atm i don't see a mistake in your script. -weidc On 23 Okt., 14:27, diego [EMAIL PROTECTED] wrote: The problem is that the my elements are 'display:none' that's why if i try your code the alert returns 0-0, i need to use .attr, height and width.. Diego On 23 Ott, 14:08, diego [EMAIL PROTECTED] wrote: here an exemplehttp://www.pirolab.it/piro_09/index2.html the first three thumbs of the first box diego On 23 Ott, 14:00, diego [EMAIL PROTECTED] wrote: Hi all, I'm building a gallery, and so far it works in every browser except Internet Explorer, The problem is that IE (burns to hell) doesn't read these variables var height = $('#'+litebox+'img.lite').attr('height'); var width = $('#'+litebox+'img.lite').attr('width'); the alert (alert(litebox+'-'+height + '-'+width );) returns img1-0-0 and i really don't know why I tried to change the attributes height and width, in title and alt, giving the dimensions to the image in that way , and it works, but I cannot use title and alt to assign dimensions. I just want to understand why it does not work.. Below a part of the js code: $('.img_in li a ').click(function () { $('.bg_thumbs').show().css({'opacity':'0','z- index':'999'}).fadeTo(200,0.4) $('.thumbs_big ').css({ 'background-color':'#000', 'background-image':'url(css3/ajax-loader.gif)', 'background-repeat':'no-repeat', 'background-position':'center'}) var litebox = $(this).attr('rel'); var height = $('#'+litebox +'img.lite').attr('height'); var width = $('#'+litebox +'img.lite').attr('width'); $('#'+litebox).show().css('opacity',0).animate({ borderWidth : '4px', top :'50%', height : (height ) + 'px' , width : (width ) + 'px' , marginLeft : '-' +((width )/2) +'px', marginTop : '-' +((height )/2) +'px', opacity : 1 },600) alert(litebox+'-'+height + '-'+width ); $('#'+litebox).queue(function(){ $('.thumbs_big img').css({'opacity':'0' ,'display' : 'block'}).fadeTo(300,1) $('.thumbs_big ').css('background','#000') $('#'+litebox).dequeue() }); return false; }); and here a part of html code: li id=img_1 title=thumb_1 a href=# rel=img1img src=images/diegovalobra.jpg alt=prova width=200 height=139 id=thumb_1//a /li span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg alt=prova width=900 height=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span I've tested the code in firefox, opera, google chrome, safari(pc) and works fine... IE sucks every kind of help is appreciated, thanks to all :) Diego
[jQuery] Re: [validate] -- newbie getting started
I know this is like the hello world of validate...can anyone see the issue? This is my first time using jquery and validate so my troubleshooting skills are not there yet. On Wed, Oct 22, 2008 at 10:11 AM, whitewaterbug [EMAIL PROTECTED]wrote: Thanks for the suggestions. I updated the form per suggestionsbut it still isn't doing the validation :( Here is the form now: -- html head script type=text/javascript src=jquery-1.2.6.min.js/script script type=text/javascript src=jquery.form.js/script script type=text/javascript src=jquery.validate.js/script script type=text/javascript src=jquery.metadata.js/script script type=text/javascript // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function //$('#myForm').ajaxForm(function() { //alert(Thank you for your comment!); $(#myForm).validate(); }); /script /head body FORM name=myForm2 id=myform ACTION= http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgihttp://www.cs.tut.fi/cgi-bin/run/%7Ejkorpela/echo.cgi METHOD=POST P Type something:BR TEXTAREA ROWS=5 COLS=72 NAME=Comments This is some text in several lines. /TEXTAREA p INPUT TYPE=checkbox NAME=box VALUE=yesCheck me! P email: INPUT Type=text name=myEmail class=required email INPUT TYPE=HIDDEN NAME=hiddenField VALUE=something INPUT name=mysubmit TYPE=SUBMIT VALUE=Send /FORM /body /html
[jQuery] Re: .attr('height')
oh my god this sucks. kind of frustrating huh? i'll keep on thinking about it. -weidc On 23 Okt., 15:56, diego [EMAIL PROTECTED] wrote: Hi weidc, look at this..i've changed the .attr : var litebox = $(this).attr('rel'); var altezza = $('#'+litebox+'img.lite').attr('alt'); and the html span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg title=900 alt=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span and it works in ie6/7 , i really don't understand.. http://www.pirolab.it/piro_09/index2.html On 23 Ott, 15:23, weidc [EMAIL PROTECTED] wrote: mh ye i see. can't even change the attr in ie itself 'cause it always gets 0 again. maybe it doesn't like that in $('#'+litebox+'img.lite'). atm i don't see a mistake in your script. -weidc On 23 Okt., 14:27, diego [EMAIL PROTECTED] wrote: The problem is that the my elements are 'display:none' that's why if i try your code the alert returns 0-0, i need to use .attr, height and width.. Diego On 23 Ott, 14:08, diego [EMAIL PROTECTED] wrote: here an exemplehttp://www.pirolab.it/piro_09/index2.html the first three thumbs of the first box diego On 23 Ott, 14:00, diego [EMAIL PROTECTED] wrote: Hi all, I'm building a gallery, and so far it works in every browser except Internet Explorer, The problem is that IE (burns to hell) doesn't read these variables var height = $('#'+litebox+'img.lite').attr('height'); var width = $('#'+litebox+'img.lite').attr('width'); the alert (alert(litebox+'-'+height + '-'+width );) returns img1-0-0 and i really don't know why I tried to change the attributes height and width, in title and alt, giving the dimensions to the image in that way , and it works, but I cannot use title and alt to assign dimensions. I just want to understand why it does not work.. Below a part of the js code: $('.img_in li a ').click(function () { $('.bg_thumbs').show().css({'opacity':'0','z- index':'999'}).fadeTo(200,0.4) $('.thumbs_big ').css({ 'background-color':'#000', 'background-image':'url(css3/ajax-loader.gif)', 'background-repeat':'no-repeat', 'background-position':'center'}) var litebox = $(this).attr('rel'); var height = $('#'+litebox +'img.lite').attr('height'); var width = $('#'+litebox +'img.lite').attr('width'); $('#'+litebox).show().css('opacity',0).animate({ borderWidth : '4px', top :'50%', height : (height ) + 'px' , width : (width ) + 'px' , marginLeft : '-' +((width )/2) +'px', marginTop : '-' +((height )/2) +'px', opacity : 1 },600) alert(litebox+'-'+height + '-'+width ); $('#'+litebox).queue(function(){ $('.thumbs_big img').css({'opacity':'0' ,'display' : 'block'}).fadeTo(300,1) $('.thumbs_big ').css('background','#000') $('#'+litebox).dequeue() }); return false; }); and here a part of html code: li id=img_1 title=thumb_1 a href=# rel=img1img src=images/diegovalobra.jpg alt=prova width=200 height=139 id=thumb_1//a /li span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg alt=prova width=900 height=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span I've tested the code in firefox, opera, google chrome, safari(pc) and works fine... IE sucks every kind of help is appreciated, thanks to all :) Diego
[jQuery] [autocomplete] How to show the list above the input
Hi there! Have a nice day! Well... I try the jQuery autocomplete plugin and work fine, but, I want to show the list of proposal terms above the input and not bellow the input. In the Show method of autocomplete plugin I try a lot of things, to change this line: top: offset.top + input.offsetHeight, For other like this: top: offset.top - options.scrollHeight, However, the results not is that I expected in every case. For example, the line above show the list in the place that I want, but, only if the list contain all of items, in other words, if the list contain only one or two items, the list appear much more above the input that trigger the autocomplete. How I can place the list of proposal words just above the input in any circumstances? Maybe anyone can help me in this issue, and maybe are possible to add to the plugin a new option: position (is a proposal) that can be use to place the autocomplete list bellow or about the input. In any case thanks very very much for the autocomplete plugin: work very fine and this issue maybe is a personal issue with no importance. Thanks in advance. And please sorry for my poor english.
[jQuery] New to Jquery : Using it on dynmaically created divs
Hi. At the moment I've creating 2 divs for each record in a database. One to first give a title for that piece of information and the second to be a show/hide div that gives furthur information upon clicking a little arrow. I generate both divs server side on an updatepanel refresh. I have them showing/hiding at the moment using this function... function divShowHide(divID, imgID){ // Hides/Shows the second div and changes arrow appearance var divToChange = document.getElementById(divID); if(divToChange.style.display == block) { divToChange.style.display = none; document.getElementById(imgID).src = Images/downarrow.png; } else { divToChange.style.display = block; document.getElementById(imgID).src = Images/uparrow.png; } } I was wandering if I could incorporate Jquery into this function to make it do the job , or if all the divs have to be created in the head section with jquery beforehand?? I have tried using the show/hide commands in the above function using Jquery but they don't seem to work. Each of my second divs have a unique ID, I just need to know if it's possible to do it in this way?? All the examples on the site use pre-defined names for divs but as I do not know the ammount of div sets before so can't do that. They are all called div2 + a unique identifyier. Any help would be greatly appreciated. Thanks, James
[jQuery] indicator.gif does not exist
Hello, First of all, congratulations for this great autocomplete plugin. I've noticed than on line 37 of the jquery.autocomplete.css , there is a call to some indicator.gif image : .ac_loading { background: white url('indicator.gif') right center no-repeat; } I haven't found any indicator.gif on the zip, I suggest to add it to the next release, or to change css definition to : .ac_loading { background-color: white; } Best regards, Eric Rogé
[jQuery] BlockUI unchecks checkboxes
Alright, so I saw that this issue had been raised before, but apparently never actually fixed. I only tested it in FF and Chrome. To reproduce: html: input type=checkbox value=3 id=mycheck / div id=return /div js: $(function() { $(input#mycheck).click(function() { // do something with ajax } $(#return).ajaxStart(function() { $.blockUI(); }) .ajaxStop(function() { $.unblockUI(); }); } The fix because I was in a hurry to get something done: blockui.js, ~ line 265: //var events = 'mousedown mouseup keydown keypress click'; //b ? $(document).bind(events, opts, handler) : $ (document).unbind(events, handler);
[jQuery] Re: [autocomplete] How to show the list above the input
Hi again, In case that anyone have problems to show the list of proposal words bellow the input, dont forget (like me) the option scrollHeight of the plugin. Not is the solution of the issue that I send before, but, can be help you. In my case, the list have a little scroll height value, and now the list not interfere with other controls, above the input. I want to say this for everyone that maybe deal with this (my) situation. Have a nice day! David 2008/10/23 David Esperalta (dec) [EMAIL PROTECTED]: Hi there! Have a nice day! Well... I try the jQuery autocomplete plugin and work fine, but, I want to show the list of proposal terms above the input and not bellow the input. In the Show method of autocomplete plugin I try a lot of things, to change this line: top: offset.top + input.offsetHeight, For other like this: top: offset.top - options.scrollHeight, However, the results not is that I expected in every case. For example, the line above show the list in the place that I want, but, only if the list contain all of items, in other words, if the list contain only one or two items, the list appear much more above the input that trigger the autocomplete. How I can place the list of proposal words just above the input in any circumstances? Maybe anyone can help me in this issue, and maybe are possible to add to the plugin a new option: position (is a proposal) that can be use to place the autocomplete list bellow or about the input. In any case thanks very very much for the autocomplete plugin: work very fine and this issue maybe is a personal issue with no importance. Thanks in advance. And please sorry for my poor english.
[jQuery] Re: jQModal loading separate urls into div
Sorry for the sparseness, that's exactly what I was speaking of... unfortunately there's no way to do this with jQModal alone.. I was hoping that I had overlooked something in the docs.. thanks for the response! On Oct 23, 2:29 am, Alexandre Plennevaux [EMAIL PROTECTED] wrote: With so little data it's hard to really give an advise. do you populate the content inside the div via an ajax call? Then you need to bind their click event (after they have been loaded see livequery plugin), to a function that does ajax calls inside the div you could also use an iframe (http://www.pixeline.be/blog/2008/javascript-loading-external-urls-in-... ) and for the links inside the loaded page, add the target attribute point to _self. cheers alex
[jQuery] Re: .attr('height')
weidc i found the bug, at the elements with css 'display:none' IE gives width and height = 0, that's why i have in return 0-0, i think i'll work on it, trying to overcome this IE bug.. Anyway thank you very much for support.. Diego On 23 Ott, 16:16, weidc [EMAIL PROTECTED] wrote: oh my god this sucks. kind of frustrating huh? i'll keep on thinking about it. -weidc On 23 Okt., 15:56, diego [EMAIL PROTECTED] wrote: Hi weidc, look at this..i've changed the .attr : var litebox = $(this).attr('rel'); var altezza = $('#'+litebox+'img.lite').attr('alt'); and the html span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg title=900 alt=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span and it works in ie6/7 , i really don't understand.. http://www.pirolab.it/piro_09/index2.html On 23 Ott, 15:23, weidc [EMAIL PROTECTED] wrote: mh ye i see. can't even change the attr in ie itself 'cause it always gets 0 again. maybe it doesn't like that in $('#'+litebox+'img.lite'). atm i don't see a mistake in your script. -weidc On 23 Okt., 14:27, diego [EMAIL PROTECTED] wrote: The problem is that the my elements are 'display:none' that's why if i try your code the alert returns 0-0, i need to use .attr, height and width.. Diego On 23 Ott, 14:08, diego [EMAIL PROTECTED] wrote: here an exemplehttp://www.pirolab.it/piro_09/index2.html the first three thumbs of the first box diego On 23 Ott, 14:00, diego [EMAIL PROTECTED] wrote: Hi all, I'm building a gallery, and so far it works in every browser except Internet Explorer, The problem is that IE (burns to hell) doesn't read these variables var height = $('#'+litebox+'img.lite').attr('height'); var width = $('#'+litebox+'img.lite').attr('width'); the alert (alert(litebox+'-'+height + '-'+width );) returns img1-0-0 and i really don't know why I tried to change the attributes height and width, in title and alt, giving the dimensions to the image in that way , and it works, but I cannot use title and alt to assign dimensions. I just want to understand why it does not work.. Below a part of the js code: $('.img_in li a ').click(function () { $('.bg_thumbs').show().css({'opacity':'0','z- index':'999'}).fadeTo(200,0.4) $('.thumbs_big ').css({ 'background-color':'#000', 'background-image':'url(css3/ajax-loader.gif)', 'background-repeat':'no-repeat', 'background-position':'center'}) var litebox = $(this).attr('rel'); var height = $('#'+litebox +'img.lite').attr('height'); var width = $('#'+litebox +'img.lite').attr('width'); $('#'+litebox).show().css('opacity',0).animate({ borderWidth : '4px', top :'50%', height : (height ) + 'px' , width : (width ) + 'px' , marginLeft : '-' +((width )/2) +'px', marginTop : '-' +((height )/2) +'px', opacity : 1 },600) alert(litebox+'-'+height + '-'+width ); $('#'+litebox).queue(function(){ $('.thumbs_big img').css({'opacity':'0' ,'display' : 'block'}).fadeTo(300,1) $('.thumbs_big ').css('background','#000') $('#'+litebox).dequeue() }); return false; }); and here a part of html code: li id=img_1 title=thumb_1 a href=# rel=img1img src=images/diegovalobra.jpg alt=prova width=200 height=139 id=thumb_1//a /li span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg alt=prova width=900 height=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span I've
[jQuery] Tabs - Preserve onclick on selected tab
Is it possible to click on the selected tab so as to reload this tab? thanks
[jQuery] Re: New to Jquery : Using it on dynmaically created divs
Hi James, Here's one way to rewrite it using jQuery: function divShowHide(divID, imgID) { var d = $('#' + divID).toggle(); $('#' + imageID).attr('src', 'Images/' + ( d.is(':visible') ? 'down' : 'up' ) + 'arrow.png' ); } Cheers, -Jonathan On Oct 23, 2008, at 8:42 AM, James2008 wrote: Hi. At the moment I've creating 2 divs for each record in a database. One to first give a title for that piece of information and the second to be a show/hide div that gives furthur information upon clicking a little arrow. I generate both divs server side on an updatepanel refresh. I have them showing/hiding at the moment using this function... function divShowHide(divID, imgID){ // Hides/Shows the second div and changes arrow appearance var divToChange = document.getElementById(divID); if(divToChange.style.display == block) { divToChange.style.display = none; document.getElementById(imgID).src = Images/downarrow.png; } else { divToChange.style.display = block; document.getElementById(imgID).src = Images/uparrow.png; } } I was wandering if I could incorporate Jquery into this function to make it do the job , or if all the divs have to be created in the head section with jquery beforehand?? I have tried using the show/hide commands in the above function using Jquery but they don't seem to work. Each of my second divs have a unique ID, I just need to know if it's possible to do it in this way?? All the examples on the site use pre-defined names for divs but as I do not know the ammount of div sets before so can't do that. They are all called div2 + a unique identifyier. Any help would be greatly appreciated. Thanks, James
[jQuery] Re: indicator.gif does not exist
create one here http://www.ajaxload.info/ 2008/10/23 Éric Rogé [EMAIL PROTECTED] Hello, First of all, congratulations for this great autocomplete plugin. I've noticed than on line 37 of the jquery.autocomplete.css , there is a call to some indicator.gif image : .ac_loading { background: white url('indicator.gif') right center no-repeat; } I haven't found any indicator.gif on the zip, I suggest to add it to the next release, or to change css definition to : .ac_loading { background-color: white; } Best regards, Eric Rogé
[jQuery] Re: .attr('height')
I've done it...i don't use display:none , instead i use visibility:hidden hideing the elements by js, works fine in all browser... http://www.pirolab.it/piro_09/index2.html tnx again Diego On 23 Ott, 16:46, diego [EMAIL PROTECTED] wrote: weidc i found the bug, at the elements with css 'display:none' IE gives width and height = 0, that's why i have in return 0-0, i think i'll work on it, trying to overcome this IE bug.. Anyway thank you very much for support.. Diego On 23 Ott, 16:16, weidc [EMAIL PROTECTED] wrote: oh my god this sucks. kind of frustrating huh? i'll keep on thinking about it. -weidc On 23 Okt., 15:56, diego [EMAIL PROTECTED] wrote: Hi weidc, look at this..i've changed the .attr : var litebox = $(this).attr('rel'); var altezza = $('#'+litebox+'img.lite').attr('alt'); and the html span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg title=900 alt=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span and it works in ie6/7 , i really don't understand.. http://www.pirolab.it/piro_09/index2.html On 23 Ott, 15:23, weidc [EMAIL PROTECTED] wrote: mh ye i see. can't even change the attr in ie itself 'cause it always gets 0 again. maybe it doesn't like that in $('#'+litebox+'img.lite'). atm i don't see a mistake in your script. -weidc On 23 Okt., 14:27, diego [EMAIL PROTECTED] wrote: The problem is that the my elements are 'display:none' that's why if i try your code the alert returns 0-0, i need to use .attr, height and width.. Diego On 23 Ott, 14:08, diego [EMAIL PROTECTED] wrote: here an exemplehttp://www.pirolab.it/piro_09/index2.html the first three thumbs of the first box diego On 23 Ott, 14:00, diego [EMAIL PROTECTED] wrote: Hi all, I'm building a gallery, and so far it works in every browser except Internet Explorer, The problem is that IE (burns to hell) doesn't read these variables var height = $('#'+litebox+'img.lite').attr('height'); var width = $('#'+litebox+'img.lite').attr('width'); the alert (alert(litebox+'-'+height + '-'+width );) returns img1-0-0 and i really don't know why I tried to change the attributes height and width, in title and alt, giving the dimensions to the image in that way , and it works, but I cannot use title and alt to assign dimensions. I just want to understand why it does not work.. Below a part of the js code: $('.img_in li a ').click(function () { $('.bg_thumbs').show().css({'opacity':'0','z- index':'999'}).fadeTo(200,0.4) $('.thumbs_big ').css({ 'background-color':'#000', 'background-image':'url(css3/ajax-loader.gif)', 'background-repeat':'no-repeat', 'background-position':'center'}) var litebox = $(this).attr('rel'); var height = $('#'+litebox +'img.lite').attr('height'); var width = $('#'+litebox +'img.lite').attr('width'); $('#'+litebox).show().css('opacity',0).animate({ borderWidth : '4px', top :'50%', height : (height ) + 'px' , width : (width ) + 'px' , marginLeft : '-' +((width )/2) +'px', marginTop : '-' +((height )/2) +'px', opacity : 1 },600) alert(litebox+'-'+height + '-'+width ); $('#'+litebox).queue(function(){ $('.thumbs_big img').css({'opacity':'0' ,'display' : 'block'}).fadeTo(300,1) $('.thumbs_big ').css('background','#000') $('#'+litebox).dequeue() }); return false; }); and here a part of html code: li id=img_1 title=thumb_1 a href=#
[jQuery] Having troubles accessing a variable in $.each
I am having troubles with my google maps conversion to jquery. My markers are being generated from a get json request and then each marker is being created using $.each. My trouble happen when creating a side bar with buttons to open the info windows. I can create the button but can not seem to pull the individual marker info to activate the info window. Here is my code so far: var map; $(document).ready(function() { if (GBrowserIsCompatible()) { // Initialize the map. var baseIcon = new GIcon(); baseIcon.image = http://redhattester.googlepages.com/ GmapIcon02.png; baseIcon.shadow = http://redhattester.googlepages.com/ GmapIcon02Shadow.png; baseIcon.iconSize = new GSize(45, 45); baseIcon.shadowSize = new GSize(42, 45); baseIcon.iconAnchor = new GPoint(18, 38); baseIcon.infoWindowAnchor = new GPoint(19, 2); map = new GMap2(document.getElementById(map)); // This sets up the and rest just sets up the controls map.addMapType(G_SATELLITE_3D_MAP); // For Google Earth map.addMapType(G_PHYSICAL_MAP); // Adds Satelite maps map.addControl(new GMenuMapTypeControl()); // This makes the choses a drop down menu map.addControl(new GLargeMapControl()); // Use large map controls map.setMapType(G_HYBRID_TYPE); // Hybrid map map.enableScrollWheelZoom(); // Allows for users to scroll zoom with their mouse wheel //console.log(Loading the JSON file) $.getJSON(GmapData.json,function(data){ var NewLat = data.items[0].lat; var NewLng = data.items[0].long; var NewPoint = new GLatLng(NewLat, NewLng); map.setCenter(NewPoint, 12); $.each(data.items,function(i,item){ var lat = item.lat; var lng = item.long; var name = item.name; var chapter = item.chapter; var locale = item.locale; var imageSm = item.ImageSm; var imageBg = item.ImageBg; var ContentSm = item.ContentSm; // Sets up the sorted out info from the json file var NormalContent = 'h3'+ name +'/h3div class=iwstyle01img src=' + imageSm + ' class=MiniPicpstrong class=ChapterName' + chapter + '/ strong - ' + locale + ' ' + ContentSm + '/pp class=miniInstrucClick the + symbol at the top of this bubble to see the image bigger./p/div'; var BiggieContent = 'div style=padding:10px 0 0 0;img src=' + imageBg + ' class=BigPicpstrong class=ChapterName' + chapter + '/strong - ' + locale + ' ' + ContentSm + '/p/div'; var point = new GLatLng(lat,lng); var marker = new GMarker(point,{icon:baseIcon}); // Create the marker. GEvent.addListener(marker, click, function() { marker.openInfoWindowHtml(NormalContent, {maxContent: BiggieContent, maxTitle: name}); }); map.addOverlay(marker); if (i==0) { // This will trigger open the newest story GEvent.trigger(marker, click); } $('#side_bar').append('lia href=javascript:myclick('+ i +')' + name + '/a/li'); }); }); // This function picks up the click and opens the corresponding info window function myclick(i) { GEvent.trigger(marker[i], click);
[jQuery] Disabling Enter key on the page
Hi, I'm not completely sure this is a jQuery issue or a javascript issue. Pardon me if I'm not in the right place. I have disabled the Enter key on the page like that : $(#body).keypress(function(e) { if (e.which == 13) { return false; } }); Now the issue I'm facing is that if the user is typing in a textarea control, she can't type the Enter key anymore to do a new line ! Does anyone know how i can get around that ? Thanks
[jQuery] Re: My first plugin ... need some help.
Thank you for your help and patience. It is working fine ... just a last question: I need to add an input with hidden value to each list item: ...input type=hidden name=myList value=values / The name of the input should be the name of the list passed. The following is what I have now, but I get an error on Firebug: $('li/li').appendTo(opt.list) .append(str) .append(' a href=#Remove class=RemoveRemover/a') .append(' input type=hidden name=' + opt.list.attr(name) + ' value = ' + str + ' /'); Shouldn't attr get the name of opt.list? How can I get the list name? Thanks, Miguel On Oct 23, 4:38 am, ricardobeat [EMAIL PROTECTED] wrote: Hi there, The '@' for attributes has been deprecated, and you can choose that by class also. Another try (hope google groups won't break it too much): $(document).ready(function() { $.fn.createList = function(opt){ var origin = this.eq(0).parents('form'); //get the parent form element var $fields = this; //save all inputs for later $('.remove') .livequery('click', function(event) { $(this).parent().remove(); }); $(opt.button,origin).bind('click',function(){ var str = [],cstr = []; $fields.not(':checkbox').each(function(){ //iterate over all inputs except checkboxes str.push($(this).val()); //add value to array 1 }).end().filter(':checkbox:checked').each(function(){ // iterate over all checked checkboxes cstr.push($(this).val()); //add value to array 2 }); str.push(cstr.join(', ')); // add commas to array 2 and push the resulting string into array 1 str = str.join('. '); // make array 1 into string, dot separated $('li/li').appendTo(opt.list).append(str).append(' a href=#remove class=removeRemove Item/a'); // etc return false; }); } $ ('input.name,select.country,input.newsletter').createList({ list:'#MyList', button: 'input.sendToList' }) }); On Oct 22, 10:24 pm, shapper [EMAIL PROTECTED] wrote: Hi again, I changed the join to a dot and added [EMAIL PROTECTED] as a selector of my CheckBoxes group. I am trying that the values of the selected checkboxes to be added in a Comma Separated format. This is not working? Could someone, please, help me with this thing? It is the last thing to finish it. Thanks, Miguel On Oct 23, 1:05 am, shapper [EMAIL PROTECTED] wrote: Hi, I solved problem 1 and updated my online example. I still have problems with the checkboxes and the display format ... any idea how to solve? Thanks, Miguel On Oct 23, 12:23 am, shapper [EMAIL PROTECTED] wrote: Hello, I uploaded the updated version:http://www.27lamps.com/Beta/List/List.html#remove There is only two problems: 1. The value of the select is not being added. 2. If i have multiple chekboxes on the same group I would like to add only the values of ones selected. The ideal would be to have the following format: Name. Country. 1st CheckBox selected, 2st CheckBox selected, ... This way I can understand that each dot separates an input and a comma separates the selected values of a check box group. How can I do this? Thanks, Miguel On Oct 22, 2:45 am, shapper [EMAIL PROTECTED] wrote: Hi, I will try it. Sorry, but I am no expert with JQuery and I am just trying to pull this off. I understand that a plugin should have many more options but my intention is to have this plugin so I can use across my projects and with time improve it. It would be easier to make this without being a plugin? I am not really sure how the code would change ... I was looking for such a plugin but I wasn't able to find any ... I think this is really useful. Just select the inputs, the button, the list and the format as the inputs values would be displayed. Then use something like: liBook Type. Book Name. Values of selected CheckBoxes separated by commasinput type=hidden name=myList value=Book Type. Book Name. Values of selected CheckBoxes separated by commas /a href=#removeclass=removeRemove Item/a/li Then I use the hidden inputs to read the info on the server after the form is submitted, parse the info and insert it into the database along with the other form info. Does this makes any sense? Yes, I could use Ajax but the form has a lot more information and these list info should be only saved into the database if the user submits the register form itself. So if i send this info through ajax there will no where to save it since the user didn't register yet. Is this what you meant? Thank You, Miguel On Oct 22, 1:45 am, ricardobeat [EMAIL PROTECTED] wrote: Install the Firebug extension for Firefox so you can debug your code
[jQuery] Am I rewriting something jQuery already does?
I'm new to jquery and I'm writing some code but I'd like to make sure I'm not rewriting something that already exists. Basically, I'd like to be able to do: $(#myAnchor).addBehavior($(#targetDiv, new MyNewBehavior); I implement a few functions for MyNewBehavior such as buildURL and stuffToDoAfter. When myAnchor is clicked on, an ajax request is made to buildUrl (which might be a static URL or might build the URL from parameters), then targetDiv is filled with the html fragment that is sent to the success function, and finally stuffToDoAfter() is executed in case you want to manipulate the newly added elements. So it abstracts away the click() call, the ajax call, the targetDiv.innerHTML = ajaxResponse, etc. Anyone know if something like this already exists?
[jQuery] Re: Jeditable and TinyMCE
I am trying to use tinyMCE with the jEditable plugin and sometimes get an error. the html editor won't show up and i get the error t.win.document is null. anyone know what this is and if it's an MCE issue or jEditable? thanks Jeff On Sep 14, 4:02 pm, Mika Tuupola [EMAIL PROTECTED] wrote: On Sep 14, 2008, at 3:37 AM, ph4nt0m wrote: http://sam.curren.ws/index.cfm/2008/6/12/jEditable-TinyMCE-Plugin but i seem to have come across a slight problem, it the data is posted to a URL and not a function as per Sam's example, the posted data never gets returned to the div on submit, it loads the default text of Click Here To Edit, What does the URL you are posting to return? I'd be really grateful for a little help with this or for someone to confirm that this is actually a bug ? I will take a look. Do you have example code somewhere online? -- Mika Tuupolahttp://www.appelsiini.net/
[jQuery] Drawing Associations
Hi All, I have a requirement where I am dropping two (or more) tables onto a droppable surface, what I need to be able to do is to create a visable association between two a row in each of the tables? A good example of where this is used is to create joins when connecting two database tables. Does anyone have any ideas of how to get started or can point me to a resource which could help (bearing in mind, I am looking on Google too!) Much Apprciated Phill
[jQuery] Image Display with Brightness Control?
Hey Folks, So, a project involving allowing users to view scanned photos of historic structures has recently run into the problem that some of the photos are a bit dark relative to the originals, with some details being impossible to see in the jpg. When viewed on desktop, this is usually dealt with by users just tweaking the brightness in their quick and easy photo viewer of choice. I'm trying to replicate that functionality for a web interface we're developing. Does anyone know of an image control jquery plugin that allows brightness control, or has anyone dealt with similar issues? Optimally, it'd be something lightbox-esque, with FF3/IE7+ compatability, but I'd love to see any examples at all. Poking around, I've found a few potential leads if I have to try to build something, but I'm hoping someone out there has beaten me to it. In case anyone is curious, the leads I ran across were: FF Only: http://people.mozilla.com/~schrep/image12.html and: http://www.nihilogic.dk/labs/imagefx/ and lastly: processing.js seems to have similar capabilities, but I've never done anything with it and thus have no idea how easy/nightmarish it'd be to add a brightness slider or +/-10% button to an image. Also, compatibility is problematic. Thanks a lot, josh
[jQuery] Re: Disabling Enter key on the page
You can check the target of the keypress, by e.target. Something like this (untested): $(#body).keypress(function(e) { if (e.which == 13 !$(e.target).is(textarea)) { return false; } }); - Richard On Thu, Oct 23, 2008 at 12:37 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I'm not completely sure this is a jQuery issue or a javascript issue. Pardon me if I'm not in the right place. I have disabled the Enter key on the page like that : $(#body).keypress(function(e) { if (e.which == 13) { return false; } }); Now the issue I'm facing is that if the user is typing in a textarea control, she can't type the Enter key anymore to do a new line ! Does anyone know how i can get around that ? Thanks
[jQuery] Re: JQuery SEO Question
edzah wrote on 10/23/2008 6:56 AM: I am creating a product page that has a jquery script that hides/ unhides divs to show the currently select product. I've just realised that we have too many products to load them all on the same page. Instead I want to load the content of each div in when they are selected. That means that the pages I am loading from will not be spidered as they are javascript loads. Doing a bit of reading I noticed that some people were talking about putting an anchor tag in too. What do I do, just put a load of anchor tags at the bottom to all the content that will be loaded via jquery, with no anchor text or something. So that the anchor tags are there for the spider bot but not for the user. One solution would be to wrap the anchors on the page in noscript so bots and those not using JavaScript can find the content. Another would be to use CSS to { display: none } the anchors so that the anchors are still viewable to bots, but not to browsers. Another would be to by default show anchors and not your content, then use javascript to hide the anchors and show the content. Another would be to use Sitemaps and list the Sitemap in your robots.txt file: http://www.sitemaps.org/protocol.php#submit_robots There are probably other ways too. - Bil
[jQuery] Re: jQuery.getScript problems on IE 7
Yes, I already use noConflict() function. I don't have any conflict, I just said the jQuery.getScript can't eval protoculous-effects-shrinkvars.js causing error in script. Can you help me please? On 22 out, 20:15, Karl Rudd [EMAIL PROTECTED] wrote: Have followed the advice athttp://docs.jquery.com/Using_jQuery_with_Other_Libraries? Karl Rudd On Wed, Oct 22, 2008 at 11:01 PM, Alexsandro_xpt [EMAIL PROTECTED] wrote: Nobody know what happen with .getScript getting prototype framework? On 22 out, 00:57, Alexsandro_xpt [EMAIL PROTECTED] wrote: My IE 7 and 6 get a error while load protoculous-effects-shrinkvars.js by jQuery.getScript method. IE popup this error message: Line: 310750026 Char: 72353 Error: 'null' is null or not an object Code: 0 How to fix it using jQuery.getScript? Prototype Framework doesn't like jQuery? PS.: In FF work very well.
[jQuery] Re: Cycle actions that happen faster than the javascript transitions
Fade in, fade out, slide, shuffle. Whatever cycle plugin i'm using. On Oct 13, 8:24 pm, ricardobeat [EMAIL PROTECTED] wrote: What exactly are javascript transitions? If you mean the fadeIn and fadeOut functions, a stop() will stop all current animations. - ricardo On Oct 13, 5:50 pm,sorahn[EMAIL PROTECTED] wrote: For actions that happen faster than the javascript transitions, is there a way to make the javascript break it's current loop, and start doing the new action?
[jQuery] Re: can someone please help with dynamic links problem?
you're welcome! On Oct 22, 7:45 pm, Flavio333 [EMAIL PROTECTED] wrote: Thank You so much, after playing around with it ... it works!!! Thank You SO SO Much!!! RotinPain wrote: Sure, how i could miss that! I would assign the categories Id number (like $catid) in the Id attribute of the link. Then using it as a GET parameter for the load function. It would give: # class=generate2?=$catname;? Then modify the function i wrote (based on the classname) using: $(#myobj).load(products.php?idctg_ctg= + $(this).attr(id) ) Here's the complete script (tested!) from your source: [SCRIPT] !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http:// www.w3.org/TR/html4/loose.dtd html head script src=scripts/jquery.js/script script $(document).ready(function(){ $(.generate2).each ( function () { $( this ).bind ( click, function() { $(#myobj).fadeOut(fast); $(#myobj).slideToggle(slow); $(#myobj).load(products.php?idctg_ctg= + $(this).attr('id') ); // id will be the one of the clicked link }//function );//bind }//function );//each }); /script style type=text/css !-- #myobj { background-color: #CC; height: 300px; width: 500px; } -- /style /head body div id=myobj align=center ?php do { ? # ?php echo $row_categorys['name_ctg']; ? br ?php } while ($row_categorys = mysql_fetch_assoc($categorys)); ? /div /body /html ?php mysql_free_result($categorys); ? But you can have a look at ricardobeat link ;) On 21 oct, 20:57, Flavio333 [EMAIL PROTECTED] wrote: I tried what you said but it does not work... now both links go to the same page when clicked... RotinPain wrote: the problem is quite simple i think, all your links have the same id (generate2) And the jquery function is attached to a link with this id (generate2) So only 1 link will be responding to the function. You need to use each() to attach an event to each links. Like $(#generate2).each ( function () { $( this ).bind ( click, function(){ //dosomething your stuff here }//function );//bind }//function );//each This should normally work. But note that only one unique ID per page is acceptable (see W3C recommandations). Better to use class name filtering instead (there could be more than 1 time the same class on the page but only 1 unique id). It will only change the first line: $(.generate2).each ( ... And the HTML will looks like # ... On Oct 21, 3:56 pm, Flavio333 [EMAIL PROTECTED] wrote: Hello, I an quite new to jquery and hope someone can help with my problem. I am trying to load dynamic content in to a div(myobj)... the code i have so far is more or less as follows. it creates a box with 2 links, that it gets from 'name_ctg'. the links, are category names and when clicked should load products.php, with the right product, as was determined by the link that was clicked. I hope that make sense... now the problem is that only the first link works, the second link does nothing. I hope someone can help. script src=jquery.js/script script $(document).ready(function(){ $(#generate2).click(function(){ $(#myobj).fadeOut(fast); $(#myobj).slideToggle(slow); $(#myobj).load(products.php?idctg_ctg=?php echo $row_categorys['idctg_ctg']; ?); }); }); /script style type=text/css !-- #myobj { background-color: #CC; height: 300px; width: 500px;} -- /style /head body div id=myobj align=center ?php do { ? a href=# id=generate2 ?php echo $row_categorys['name_ctg']; ? br ?php } while ($row_categorys = mysql_fetch_assoc($categorys)); ? /div /body /html ?php mysql_free_result($categorys); ? -- View this message in context:http://www.nabble.com/can-someone-please-help-with-dynamic-links-prob... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context:http://www.nabble.com/can-someone-please-help-with-dynamic-links-prob... Sent from the jQuery General Discussion mailing list archive at Nabble.com.- Masquer le texte des messages précédents - - Afficher le texte des messages précédents - :clap::clap::clap::clap: -- View this message in context:http://www.nabble.com/can-someone-please-help-with-dynamic-links-prob... Sent from the jQuery General Discussion mailing list archive at Nabble.com.- Hide quoted text - - Show quoted text -
[jQuery] trying to get ajaxForm to use a dynamic class or id to prependTo
This code at this moment prependTo to a static id. But I need to get it to use something like this $(this).parents('.review_blocks').find('.review_list2:first') However no matter what I do, I can not get ajaxForm to hold a var like sort like this $('.new_review').ajaxForm(function() { var up_id = $(this).attr(id); var update_id = '#review_206'; var update_id = '#review_'+up_id; }); In fact if I add in function() to ajaxForm( it totaly ignores the function name passed to it. Or callbacks. Below is what I have for now. options = {success: addToReviewList }; $('form.new_review').ajaxForm(options); function addToReviewList(responseText){ console.log(rr); $(responseText).prependTo(#review_206).effect(highlight, {}, 9000); } -- View this message in context: http://www.nabble.com/trying-to-get-ajaxForm-to-use-a-dynamic-class-or-id-to-prependTo-tp20135944s27240p20135944.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Cycle actions that happen faster than the javascript transitions
fuck u all motherfuckers.. just remove me from your list... On Thu, Oct 23, 2008 at 10:53 PM, sorahn [EMAIL PROTECTED] wrote: Fade in, fade out, slide, shuffle. Whatever cycle plugin i'm using. On Oct 13, 8:24 pm, ricardobeat [EMAIL PROTECTED] wrote: What exactly are javascript transitions? If you mean the fadeIn and fadeOut functions, a stop() will stop all current animations. - ricardo On Oct 13, 5:50 pm,sorahn[EMAIL PROTECTED] wrote: For actions that happen faster than the javascript transitions, is there a way to make the javascript break it's current loop, and start doing the new action?
[jQuery] Re: trying to get ajaxForm to use a dynamic class or id to prependTo
Can you post a link that shows the problem that you're having. I didn't really understand your explanation. Mike On Oct 23, 1:36 pm, tripdragon [EMAIL PROTECTED] wrote: This code at this moment prependTo to a static id. But I need to get it to use something like this $(this).parents('.review_blocks').find('.review_list2:first') However no matter what I do, I can not get ajaxForm to hold a var like sort like this $('.new_review').ajaxForm(function() { var up_id = $(this).attr(id); var update_id = '#review_206'; var update_id = '#review_'+up_id; }); In fact if I add in function() to ajaxForm( it totaly ignores the function name passed to it. Or callbacks. Below is what I have for now. options = { success: addToReviewList }; $('form.new_review').ajaxForm(options); function addToReviewList(responseText){ console.log(rr); $(responseText).prependTo(#review_206).effect(highlight, {}, 9000); } -- View this message in context:http://www.nabble.com/trying-to-get-ajaxForm-to-use-a-dynamic-class-o... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Cycle actions that happen faster than the javascript transitions
Can you give me an example of that scenario? Thanks. On Oct 13, 4:50 pm, sorahn [EMAIL PROTECTED] wrote: For actions that happen faster than the javascript transitions, is there a way to make the javascript break it's current loop, and start doing the new action?
[jQuery] Re: trying to get ajaxForm to use a dynamic class or id to prependTo
malsup wrote: Can you post a link that shows the problem that you're having. I didn't really understand your explanation. Mike So here is what ntasfi and I worked on last night. By view of it it looks like it would work despite a typo thats in there http://www.pastie.org/299081 I have been re testing older code from the first message. In this case, vars like var up_id = $(this).attr(id); to not send to the function -- View this message in context: http://www.nabble.com/trying-to-get-ajaxForm-to-use-a-dynamic-class-or-id-to-prependTo-tp20135944s27240p20136372.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] img load event not working
I can't get this to work for anything. I'm trying to set up an event to fire a trigger when an image is done loading. Neither of the following snippets end up ever calling the OnImageLoaded function. $(...).load(OnImageLoaded) $(...).bind(load, OnImageLoaded) I've cleared the cache to ensure it's not a caching thing. Can anyone see what I'm missing here? --- Jim ---
[jQuery] Re: cannot reset width value _ width(val)
Could anybody take a look at my problem please? I haven't made any progress so far :( On Thu, Oct 23, 2008 at 3:17 PM, pixeline [EMAIL PROTECTED] wrote: Hi all, i'm trying to kill the last bugs of lisapram.com before letting the project go _ the issue i'm facing is that i can't manage or don't understand how to stop and reset the animation queue. To reproduce the issue please go here: http://www.lisapram.com/ click on one of the fifth line (big and fat) in the barcode at the center of the screen: it opens up to display a strip of images. Its width will gradually expand to 12900 px Now, click refresh , see the value of set number 5. It's gradually increasing to 12900px, fine. Now, hit one of the above keywords, e.g. experimental . It should reset the barcode. But it does not properly do it because the set 5 is still increasing its width, no matter what i try. I have a barcode.reset() function that should take care of that, here is the code so far, that does not work, the css width is not properly applied (as reported by my custom debugger ). barcode.reset = function() { barcode.canOpen = false; // unbind all click events $('#barcode li img').hide(); $('li', barcode.el).removeClass('active').addClass('notActive').unbind().css({ cursor: 'default', width: '1px' }).each(function(i) { //$('img', $(this)).hide(); if (barcode.allSets.length 0) { $(this).css({ width: barcode.allSets[i].smallWidth }); $(this).width(barcode.allSets[i].smallWidth); $.log('barcode reset of set ' + i + ' to width ' + barcode.allSets[i].smallWidth); //$.log('li nr' + i + '= ' + barcode.allSets[i].smallWidth); } if ($(this).is(':animated')) { $(this).stop(); $(this).css({ width: barcode.allSets[i].smallWidth }); $(this).width(barcode.allSets[i].smallWidth); } }); } What am i doing wrong? Thank you for your time, alexandre
[jQuery] Re: trying to get ajaxForm to use a dynamic class or id to prependTo
To add to it. Here a different example http://www.pastie.org/299106 It sort of holds the var but can not find where it is in the dom, or it does not use $(this) -- View this message in context: http://www.nabble.com/trying-to-get-ajaxForm-to-use-a-dynamic-class-or-id-to-prependTo-tp20135944s27240p20136884.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] jCarousel callbacks with custom data
(Reposting because I failed to finish the subject line last time.) Is there a way to pass custom data to the jCarousel callbacks without creating a global? Ideally I'd like to be able to create arbitrary properties on the jCarousel object when it is initialized and then read them from the object in the callbacks. Something like this to construct the jcarousel that allows the normal properties as well as custom ones: jQuery('#mycarousel').jcarousel({ size: that.mycarousel_itemList.length, itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback} arbitraryData: { some:Data }, otherArbitraryData: Hello World }); Then in the callback you would be able to access the custom data through the jcarousel object.
[jQuery] IE7, .find, .each, XML problem
It is simple...it works in FF and Chrome (haven't tried other browsers). Here is the basic code: $(messages).find('item').each( function(){ alert($(this).attr('id')); }); If I alert the messages before this you can see the XML data in all browsers. For some reason IE 7 will not go into the each part. Thanks for the help.
[jQuery] having trouble with scrolling in IE6
Hi there, I'm relatively new to jQuery and hoping you can help me. We've implemented a scrolling slideshow on the upper right part of this page: http://test.fakeclothing.net The left and right arrow buttons scroll the slides fine in IE7, FF2 and 3, etc. but it doesn't seem to work in IE6. From what I've read and seen jQuery seems to work fine in IE6 so my apologies if I'm missing something obvious. Thanks! Ben
[jQuery] Re: [autocomplete] do search on input focus
Try this: $(...).autocomplete(url, { minChars: 0 }).focus(function() { $(this).click(); }); Jörn On Thu, Oct 23, 2008 at 9:38 PM, blasto333 [EMAIL PROTECTED] wrote: Still no luck, the plugin I am using is: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ On Oct 23, 6:21 am, Isaak Malik [EMAIL PROTECTED] wrote: Oups, I think it should be: $(function() { $(#category).focus(function(){this.autocomplete(do_search.php,{max:100,minChars:0,delay:10}) }); }); On Thu, Oct 23, 2008 at 12:16 AM, blasto333 [EMAIL PROTECTED] wrote: That didn't work either. If I double click in the field, the expected behavior occurs. On Oct 22, 10:41 am, Isaak Malik [EMAIL PROTECTED] wrote: I have no idea which autocomplete plugin you're using but does the following work for you? $(function() { $(#category).focus(function(){$(this).autocomplete(do_search.php,{max:1 00,minChars:0,delay:10}) }); }); On Wed, Oct 22, 2008 at 4:19 PM, blasto333 [EMAIL PROTECTED] wrote: Is there a way to force a field to do a search on focus of the input? (I basically want the user to be suggested a default set of items before typing anything. I tried this $(#category).autocomplete(do_search.php,{max:100,minChars:0,delay: 10}); -- Isaak Malik Web Developer -- Isaak Malik Web Developer
[jQuery] Re: Image Display with Brightness Control?
I'm no expert on this, but I have a feeling you may have better luck in Flash for this purpose. Or maybe find a generic brightness setting that's good for all the images and just to a batch process on them and re-upload. Not an idea solutions, but I don't think any Javascript (that I know of anyway) will be able to manipulate pixels in an existing image. On Oct 23, 11:56 am, Josh Rosenthal [EMAIL PROTECTED] wrote: Hey Folks, So, a project involving allowing users to view scanned photos of historic structures has recently run into the problem that some of the photos are a bit dark relative to the originals, with some details being impossible to see in the jpg. When viewed on desktop, this is usually dealt with by users just tweaking the brightness in their quick and easy photo viewer of choice. I'm trying to replicate that functionality for a web interface we're developing. Does anyone know of an image control jquery plugin that allows brightness control, or has anyone dealt with similar issues? Optimally, it'd be something lightbox-esque, with FF3/IE7+ compatability, but I'd love to see any examples at all. Poking around, I've found a few potential leads if I have to try to build something, but I'm hoping someone out there has beaten me to it. In case anyone is curious, the leads I ran across were: FF Only:http://people.mozilla.com/~schrep/image12.html and:http://www.nihilogic.dk/labs/imagefx/ and lastly: processing.js seems to have similar capabilities, but I've never done anything with it and thus have no idea how easy/nightmarish it'd be to add a brightness slider or +/-10% button to an image. Also, compatibility is problematic. Thanks a lot, josh
[jQuery] Re: .attr('height')
jQuery is supposed to briefly show the element to get its height/ width, then hide it again, this shouldn't be happening. Is your page valid xhtml? Couldn't you set the height and width inline attributes for the image? - ricardo On Oct 23, 1:51 pm, diego [EMAIL PROTECTED] wrote: I've done it...i don't use display:none , instead i use visibility:hidden hideing the elements by js, works fine in all browser... http://www.pirolab.it/piro_09/index2.html tnx again Diego On 23 Ott, 16:46, diego [EMAIL PROTECTED] wrote: weidc i found the bug, at the elements with css 'display:none' IE gives width and height = 0, that's why i have in return 0-0, i think i'll work on it, trying to overcome this IE bug.. Anyway thank you very much for support.. Diego On 23 Ott, 16:16, weidc [EMAIL PROTECTED] wrote: oh my god this sucks. kind of frustrating huh? i'll keep on thinking about it. -weidc On 23 Okt., 15:56, diego [EMAIL PROTECTED] wrote: Hi weidc, look at this..i've changed the .attr : var litebox = $(this).attr('rel'); var altezza = $('#'+litebox+'img.lite').attr('alt'); and the html span class=thumbs_big id=img1 img src=images/diegovalobra_b.jpg title=900 alt=585 class=lite/ span class=thumbs_close title=chiudiimg src=css3/close.png alt=prova width=30 height=30 //span /span and it works in ie6/7 , i really don't understand.. http://www.pirolab.it/piro_09/index2.html On 23 Ott, 15:23, weidc [EMAIL PROTECTED] wrote: mh ye i see. can't even change the attr in ie itself 'cause it always gets 0 again. maybe it doesn't like that in $('#'+litebox+'img.lite'). atm i don't see a mistake in your script. -weidc On 23 Okt., 14:27, diego [EMAIL PROTECTED] wrote: The problem is that the my elements are 'display:none' that's why if i try your code the alert returns 0-0, i need to use .attr, height and width.. Diego On 23 Ott, 14:08, diego [EMAIL PROTECTED] wrote: here an exemplehttp://www.pirolab.it/piro_09/index2.html the first three thumbs of the first box diego On 23 Ott, 14:00, diego [EMAIL PROTECTED] wrote: Hi all, I'm building a gallery, and so far it works in every browser except Internet Explorer, The problem is that IE (burns to hell) doesn't read these variables var height = $('#'+litebox+'img.lite').attr('height'); var width = $('#'+litebox+'img.lite').attr('width'); the alert (alert(litebox+'-'+height + '-'+width );) returns img1-0-0 and i really don't know why I tried to change the attributes height and width, in title and alt, giving the dimensions to the image in that way , and it works, but I cannot use title and alt to assign dimensions. I just want to understand why it does not work.. Below a part of the js code: $('.img_in li a ').click(function () { $('.bg_thumbs').show().css({'opacity':'0','z- index':'999'}).fadeTo(200,0.4) $('.thumbs_big ').css({ 'background-color':'#000', 'background-image':'url(css3/ajax-loader.gif)', 'background-repeat':'no-repeat', 'background-position':'center'}) var litebox = $(this).attr('rel'); var height = $('#'+litebox +'img.lite').attr('height'); var width = $('#'+litebox +'img.lite').attr('width'); $('#'+litebox).show().css('opacity',0).animate({ borderWidth : '4px', top :'50%', height : (height ) + 'px' , width : (width ) + 'px' , marginLeft : '-' +((width )/2) +'px', marginTop : '-' +((height )/2) +'px', opacity : 1 },600) alert(litebox+'-'+height + '-'+width ); $('#'+litebox).queue(function(){ $('.thumbs_big img').css({'opacity':'0'
[jQuery] More efficient animation for multiple elements
A cool effect I picked up from my Mootools days was the Elements.FX, see a demo here: http://demos111.mootools.net/Fx.Elements Basically it's a bunch of elements, you mouse over one and it gets larger while all the others shrink. A pretty cool effect for navigation menus. Here's what I wrote in jQuery, and it works fine, but it seems very inefficient. I noticed with larger lists, it seems to chug a bit (especially in IE!) $(document).ready(function() { var subNormal=5, subSmall=3, subLarge=15, subSpeed=350, subTrans=easeOutExpo, j=[]; var subNavs = $(#subNavigationlia).each(function(i){ j[this] = i; $(this).hover(function(){ subNavs.each(function(){ whichPadding = (j[this]==i) ? subLarge : subSmall; $ (this).animate({paddingLeft:whichPadding,paddingRight:whichPadding},subSpeed,subTrans).dequeue(); }); }, function(){ subNavs.animate({paddingLeft:subNormal,paddingRight:subNormal},subSpeed,subTrans).dequeue(); }); }); }); Any ideas on how to re-write this in a more efficient way?
[jQuery] Re: indicator.gif does not exist
It's just a placeholder name to show you where to put your own image. On Oct 23, 11:18 am, Éric Rogé [EMAIL PROTECTED] wrote: Hello, First of all, congratulations for this great autocomplete plugin. I've noticed than on line 37 of the jquery.autocomplete.css , there is a call to some indicator.gif image : .ac_loading { background: white url('indicator.gif') right center no-repeat; } I haven't found any indicator.gif on the zip, I suggest to add it to the next release, or to change css definition to : .ac_loading { background-color: white; } Best regards, Eric Rogé
[jQuery] Re: can jquery slide a whole page up and down?
This is a great plugin for that: http://flesler.blogspot.com/2007/10/jquerylocalscroll-10.html It's called LocalScroll, you set up the markup, include the necessary scripts, a simple call and it turns your site into a cool site. Here's one awesome site using it: (by Alex Willcocks) http://www.engageinteractive.co.uk/ Cheers -- Ariel Flesler http://flesler.blogspot.com On Oct 22, 6:46 pm, caturn88 [EMAIL PROTECTED] wrote: I have been to websites in the past which I remember had no scroll bars, relying on buttons to navigate the site. I got the impression the whole site was a massive page, so only one section could be viewed at a time. The really nice thing was that going to a new page would slide there, instead of refreshing and blinking the whole browser window as with HTML. Can jquery do this?
[jQuery] Re: New to Jquery : Using it on dynmaically created divs
A more resilient solution is to use class names instead, you can't just drop/ignore the IDs altogether: div class=titleProduct 8234/div (with background-image: url(downarrow.gif) on CSS) div class=descriptionbla bla bla bla/div $('div.title').click(function(){ var arrow = ( $(this).next('.description').is(':visible') ) ? 'url(downarrow.gif')' : 'url(uparrow.gif')'; $(this).css('backgroundImage',arrow); $(this).next('.description').slideToggle(); }); - ricardo On Oct 23, 1:31 pm, Jonathan Sharp, Out West Media jquery- [EMAIL PROTECTED] wrote: Hi James, Here's one way to rewrite it using jQuery: function divShowHide(divID, imgID) { var d = $('#' + divID).toggle(); $('#' + imageID).attr('src', 'Images/' + ( d.is(':visible') ? 'down' : 'up' ) + 'arrow.png' ); } Cheers, -Jonathan On Oct 23, 2008, at 8:42 AM, James2008 wrote: Hi. At the moment I've creating 2 divs for each record in a database. One to first give a title for that piece of information and the second to be a show/hide div that gives furthur information upon clicking a little arrow. I generate both divs server side on an updatepanel refresh. I have them showing/hiding at the moment using this function... function divShowHide(divID, imgID){ // Hides/Shows the second div and changes arrow appearance var divToChange = document.getElementById(divID); if(divToChange.style.display == block) { divToChange.style.display = none; document.getElementById(imgID).src = Images/downarrow.png; } else { divToChange.style.display = block; document.getElementById(imgID).src = Images/uparrow.png; } } I was wandering if I could incorporate Jquery into this function to make it do the job , or if all the divs have to be created in the head section with jquery beforehand?? I have tried using the show/hide commands in the above function using Jquery but they don't seem to work. Each of my second divs have a unique ID, I just need to know if it's possible to do it in this way?? All the examples on the site use pre-defined names for divs but as I do not know the ammount of div sets before so can't do that. They are all called div2 + a unique identifyier. Any help would be greatly appreciated. Thanks, James
[jQuery] Re: stop link returning to the top
This plugin can do: http://flesler.blogspot.com/2007/10/jquerylocalscroll-10.html If you don't want that behavior (of adding the hash to the address bar), don't add/keep the setting called 'hash'. -- Ariel Flesler http://flesler.blogspot.com/ On Oct 23, 1:28 am, caturn88 [EMAIL PROTECTED] wrote: I found a script which provides a smooth scrolling action to give the impression of an infinite page. However as inexperienced as I am I failed to integrate it with another piece of code that controls a JQuery button. The following page has the page scrolling JavaScript and the JQuery button together, as you can see the Description link will scroll to the bottom of the page, but then go strait back to the top (this is only a test link I actually want the green button to be the link but I'm not sure how to do that bit), I need to stop the page from returning to the top, which I am not sure why it does? website:http://lovelago.googlepages.com/test8.html .thanks in advance.
[jQuery] Re: JQuery SEO Question
Best practice is to set the href on the element that trigger's the AJAX call to the file URL it's loading, then preventing default. This way spiders will see it as a normal link and it will remain in context. You can also use a sitemap.xml file to tell bots where to search. - ricardo On Oct 23, 10:41 am, edzah [EMAIL PROTECTED] wrote: Hi I am creating a product page that has a jquery script that hides/ unhides divs to show the currently select product. I've just realised that we have too many products to load them all on the same page. Instead I want to load the content of each div in when they are selected. That means that the pages I am loading from will not be spidered as they are javascript loads. Doing a bit of reading I noticed that some people were talking about putting an anchor tag in too. What do I do, just put a load of anchor tags at the bottom to all the content that will be loaded via jquery, with no anchor text or something. So that the anchor tags are there for the spider bot but not for the user. ? Ed
[jQuery] Re: Proposal: new method for determining variables without value
Agree. Note that !!('') is also false. And [] == false. -- Ariel Flesler http://flesler.blogspot.com/ On Oct 23, 2:11 am, Michael Geary [EMAIL PROTECTED] wrote: I looked at James Edwards' post, and I'm not seeing how this function is all that useful. (I mean no offense to pd; it's always worth looking at interesting bits of code like this, and I appreciate it being brought up.) Half of the code merely duplicates what JavaScript does for you and could be replaced by a simple ! operator. Undefined? Null? The number zero? The boolean value false? All built in, so why bother with all that code? The other half implements a fairly specialized notion of what empty means. A string whose value is '0', or '', or only whitespace? An empty array? An object with no enumerable properties? Well, sure, if that's exactly what you need to test for. But why not just test for the specific thing you need instead of using a general pupose function with its own ideas of what is true and false that may or may not match your needs? -Mike _ From: chris thatcher you should cc the jquery-dev list for this idea as well, to ensure those developers see it. thatcher On Wed, Oct 22, 2008 at 7:34 PM, pd [EMAIL PROTECTED] wrote: Hi All This idea by James Edwards seems like a winner and an ideal candidate for a new jQuery core utility method: http://www.sitepoint.com/blogs/2008/10/16/techy-treasures-1/ Obviously his choice of name conflicts with the jQuery .empty() method however another name could be used such as: hasValue() This method would simply return a boolean response. What does everyone think? pd -- Christopher Thatcher
[jQuery] sIFR troubleshoot
Hello, i'm a new one studying jquery and got caught on a little 'trouble'. While i was trying some animation effects, decided to try sIFR to replace some titles. Everything went fine, until i used animation and sIFR together. Whe the containers div have a hidden style the sIFR doesn't work properly =\ It seems to scale the flash object to fit the parent div. Here's the link with both versions: [Working] http://www.brunomacaco.com.br/testes/jquery/sifr/ [Bugged] http://www.brunomacaco.com.br/testes/jquery/sifr/bug.html ty -- Bruno Macaco Front-end engineer designer 81 9926.9883
[jQuery] Jeditable issue in Safari, Chrome
I am using the Jeditable plugin and I have noticed a small issue in Chrome and Safari. If I edit the text, submit it or click away, then try to edit again, the textarea appears, but it is extremely small. For some reason, the height and width values that I specify in the Jeditable parameters are not being applied the second time. Has anybody else experienced this? Here is my basic html and javascript: p class=FavoriteNotes span style=font-weight: bold;My Notes: /span span class=EditNotesThis is a test/span /p $(.EditNotes).editable( function(value, settings) { return EditNotes(favId, value); }, { indicator : Saving..., tooltip : Click to edit..., type: textarea, height : 50px, width : 435px, event : edit, onblur : submit } );
[jQuery] Re: img load event not working
$(...).bind(load, OnImageLoaded).attr('src','the_image_uri'); -- Ariel Flesler http://flesler.blogspot.com/ On Oct 23, 3:52 pm, Jimbo M [EMAIL PROTECTED] wrote: I can't get this to work for anything. I'm trying to set up an event to fire a trigger when an image is done loading. Neither of the following snippets end up ever calling the OnImageLoaded function. $(...).load(OnImageLoaded) $(...).bind(load, OnImageLoaded) I've cleared the cache to ensure it's not a caching thing. Can anyone see what I'm missing here? --- Jim ---
[jQuery] thickbox breaking other javacript functions
I've been working on implementing thickbox into my site, and I can launch the thickbox no problem, and the site works (all the javascript functions don't have a problem) before launching thickbox. However, once I launch thickbox, javascript functions that worked previously, no longer work. The link which opens the thickbox is part of an ajax page. So (it's kinda a long way to get to it). 1) go to this link http://ZiFiMusic.com/thickbox 2) when the page loads a list of artists, select an artist 3) the page will load that artists page via ajax. - if you were to select another artist, everything would load fine 4) in the 'upcoming ARTIST NAME shows' section (just below the music player), there is a link to 'get share the artists shows widget' - clicking that will launch the thickbox and load the widgets. 5) now closing the thickbox and selecting an artist breaks the script in multiple places. this does not break before thickbox is loaded. Any ideas on why this would be happening?
[jQuery] Get label text
Hello, This might be a tricky one ... I have been looking into JQuery docs but I can't figure how to make this. I have the following: input type=checkbox name=Roles id=Admin value=Admin / label for=AdminAdministrator/label input type=checkbox name=Roles id=Coll value=Admin / label for=CollCollaborator/label How can I get, NOT the values, of all checked boxes BUT the label inner text of all checked boxes? Example: If Coll checkbox is checked I would get: Collaborator If both checkboxes are checked I would get: Collaborator, Administrator Could someone, please, help me? Thank You, Miguel
[jQuery] Re: Am I rewriting something jQuery already does?
You can use the plug-in architecture to make it easier: $.fn.addBehaviour = function(id, callback) { return this.click(function(){ var url = //create url $.ajax({ url: url, success: callback }); }); }; in this case you don't use the keyword 'new' because you pass a function. - ricardo On Oct 23, 1:10 pm, Justin [EMAIL PROTECTED] wrote: I'm new to jquery and I'm writing some code but I'd like to make sure I'm not rewriting something that already exists. Basically, I'd like to be able to do: $(#myAnchor).addBehavior($(#targetDiv, new MyNewBehavior); I implement a few functions for MyNewBehavior such as buildURL and stuffToDoAfter. When myAnchor is clicked on, an ajax request is made to buildUrl (which might be a static URL or might build the URL from parameters), then targetDiv is filled with the html fragment that is sent to the success function, and finally stuffToDoAfter() is executed in case you want to manipulate the newly added elements. So it abstracts away the click() call, the ajax call, the targetDiv.innerHTML = ajaxResponse, etc. Anyone know if something like this already exists?
[jQuery] Re: Image Display with Brightness Control?
Those kind of effects are only possible in Firefox through the use of the canvas element, which IE doesn't support. The only cross-browser ways do to it currently would be using Flash or processing the image server-side and reloading it. On Oct 23, 2:56 pm, Josh Rosenthal [EMAIL PROTECTED] wrote: Hey Folks, So, a project involving allowing users to view scanned photos of historic structures has recently run into the problem that some of the photos are a bit dark relative to the originals, with some details being impossible to see in the jpg. When viewed on desktop, this is usually dealt with by users just tweaking the brightness in their quick and easy photo viewer of choice. I'm trying to replicate that functionality for a web interface we're developing. Does anyone know of an image control jquery plugin that allows brightness control, or has anyone dealt with similar issues? Optimally, it'd be something lightbox-esque, with FF3/IE7+ compatability, but I'd love to see any examples at all. Poking around, I've found a few potential leads if I have to try to build something, but I'm hoping someone out there has beaten me to it. In case anyone is curious, the leads I ran across were: FF Only:http://people.mozilla.com/~schrep/image12.html and:http://www.nihilogic.dk/labs/imagefx/ and lastly: processing.js seems to have similar capabilities, but I've never done anything with it and thus have no idea how easy/nightmarish it'd be to add a brightness slider or +/-10% button to an image. Also, compatibility is problematic. Thanks a lot, josh
[jQuery] Re: 44670 data() calls
Most certainly bad code is causing too much loops or recursion somewhere. But some creature from the skies would have to literally 'shine a light' on this to be able to help without seeing a line of code. On Oct 23, 8:03 am, tom gee [EMAIL PROTECTED] wrote: hi, im trying to tackle a problem at the moment, that problem is working wit ha .net developer, but that aside, we're trying to ge to the bottom of a problem.the dveeloper has wired up the template and whenever we click a link on thepage it takes forever to rerender, ie we're on default.aspx and we click the link to go to default.aspx and it takes forever. the script hangs and reports an error with the data() call on line xxx of jquery.js, which corresponds to the line data function is on. i#'m pulling my hair out trying to work out what is happening as he doens't have any real knowledge of js/jquery or indeed modern techonologies so im wondering if anyone oculd shine some liht on this?!! i've tried running the profiler in firebug and it shows 44670 calls to data() and so on...is this abnormally high? nothing like this is happening on the static templates that i built and whilst im fairly new to jQuery i have a fair understanding of it. does anyone else have any experience of .net ajax with jQuery and possibly come across anyhting like this before? thanks very much in advance for any light shed on the matter!!! cheer,s tom
[jQuery] Re: Get label text
You could try this (untested): var labels = $('input:checked + label').map(function() { return $(this).text(); }); That should give you an array with the label's text. --Klaus On 23 Okt., 22:47, shapper [EMAIL PROTECTED] wrote: Hello, This might be a tricky one ... I have been looking into JQuery docs but I can't figure how to make this. I have the following: input type=checkbox name=Roles id=Admin value=Admin / label for=AdminAdministrator/label input type=checkbox name=Roles id=Coll value=Admin / label for=CollCollaborator/label How can I get, NOT the values, of all checked boxes BUT the label inner text of all checked boxes? Example: If Coll checkbox is checked I would get: Collaborator If both checkboxes are checked I would get: Collaborator, Administrator Could someone, please, help me? Thank You, Miguel
[jQuery] Re: Tabs - Preserve onclick on selected tab
var $tabs = $('#example').tabs({ select: function(e, ui) { if (ui.index === $tabs.data('selected.tabs')) { $tabs.tabs('load', ui.index); } } }); --Klaus On 23 Okt., 16:58, fleabo [EMAIL PROTECTED] wrote: Is it possible to click on the selected tab so as to reload this tab? thanks
[jQuery] Re: [validate] problems with invalid-form.validate and remote rules
Ok Jörn, issue created http://dev.jquery.com/ticket/3516 thanks for all -- Atentament / Kind Regards Àlex Corretgé Serveis Informàtics Corretgé.com SLU http://corretge.cat/ LinkedIn: http://www.linkedin.com/in/corretge 2008/10/22 Jörn Zaefferer [EMAIL PROTECTED] Apart from the fact that this event needs to get exposed as an option, its also a bug that it isn't triggered by the remote method. Could you file a ticket for this? http://dev.jquery.com/newticket (requires registration) Thanks! Jörn On Wed, Oct 22, 2008 at 10:47 AM, corretge [EMAIL PROTECTED] wrote: Hi, I try to show a list of errors in an alert box when the form is cancelled by jQuery Validator. Surfing the web I see that I can use invalid-form.validate like this: $('#bpwcForm').bind('invalid-form.validate', function(e, validator) { var errors = validator.numberOfInvalids(); alert('ERR ' + errors); }); but this function is NOT executed when a submit form is cancelled by a remote rule. any suggestion or work-arround? thanks Àlex Corretgé
[jQuery] [validate] remote rule send field value by POST instead GET
Hi, I have a hidden field in a form that contain the JSON view of the form values. The Submit button fill it before the $('#form').submit(); I have some rules created by the user in a database, and I try to use Validator to manage this 'user validations' sending to a remote rule handler the 'validation formula' and the field that contains all the form data. all data is send by GET method. Reading this doc: http://www.boutell.com/newfaq/misc/urllength.html I view that IE only manage 2048 chars for url and I'm worried. Is possible to send the value of the field tiggered with a remote rule by POST method? -- Atentament / Kind Regards Àlex Corretgé Serveis Informàtics Corretgé.com SLU http://corretge.cat/ LinkedIn: http://www.linkedin.com/in/corretge
[jQuery] Slides from the 2008 jQuery Conference
Hi everyone, Here are slides from some of the presentations given at this year's jQuery Conference: http://www.slideshare.net/event/jquery-conference-2008 We expect more to be uploaded soon. As for videos, which I know you'll ask me about, we have only a few sessions recorded and will upload the content when we can. Just bear with us. Rey...
[jQuery] Re: [validate] remote rule send field value by POST instead GET
Currently there is no good option to customize the request. The easiest way may be using $.ajaxSetup, though that affects all requests. $.ajaxSetup({ type: post }); Jörn On Thu, Oct 23, 2008 at 11:04 PM, Àlex Corretgé [EMAIL PROTECTED] wrote: Hi, I have a hidden field in a form that contain the JSON view of the form values. The Submit button fill it before the $('#form').submit(); I have some rules created by the user in a database, and I try to use Validator to manage this 'user validations' sending to a remote rule handler the 'validation formula' and the field that contains all the form data. all data is send by GET method. Reading this doc: http://www.boutell.com/newfaq/misc/urllength.html I view that IE only manage 2048 chars for url and I'm worried. Is possible to send the value of the field tiggered with a remote rule by POST method? -- Atentament / Kind Regards Àlex Corretgé Serveis Informàtics Corretgé.com SLU http://corretge.cat/ LinkedIn: http://www.linkedin.com/in/corretge
[jQuery] Re: How to stop change event from firing
This usually works: select id=field-state option value=coloradoColorado/option option value=idahoIdaho/option /select $('#field-state').val('idaho') or $('#field-state option[value=idaho]').attr('selected','selected') or var state = 'idaho'; $('#field-state').find('option[value='+state +']').attr('selected','selected'); could you provide a test page exhibiting your problem? - ricardo On Oct 23, 9:29 am, newkid85 [EMAIL PROTECTED] wrote: Thanks for the tip, ricardo. I've decided to initialise the dropdowns with the existing form values before triggering a click event, but I've run into another problem. I can't seem to set the selected option. I've tried the following with a hardcoded value for state without any luck. $('#field-state').val(state); $(#field-state).val(state).attr(selected,selected); $(#field-state [EMAIL PROTECTED]).attr(selected,selected); Yet the dropdowns always have the first item in the options selected. Interestingly, the following works if you need to set the dropdown to select the ' ' option. $('#field-state').val(' '); Any other value just won't keep though. Seems like this is a common problem based on some googling. Anyone else encountered this and found a workaround? On Oct 17, 7:10 pm, ricardobeat [EMAIL PROTECTED] wrote: You can do $(#field-state).unbind('change'); when it starts being edited and bind the function again when it's done, or you can put everything in the function inside an IF statement which depends on the edit mode. - ricardo On Oct 17, 12:41 pm, newkid85 [EMAIL PROTECTED] wrote: I have a form with three dependent location select fields and a text field which lets a user add a new city if it is missing from the dropdown. The following function works fine when I create a new form. It puts the fields in sync to start with and keeps them that way when the user makes their selections. There is a problem though when the form is edited. This is because once the page loads the function below automatically puts the fields back in sync before the user does anything like on the initial creation. So the previously selected values are overwritten. When the form is being edited I would like to have thechangeevent only fire if the user actually changes any of the dropdowns themselves. I am able to check if the form is being edited or created but not sure how tochangemy function. function() { $(#update-button).hide(); if ($(#field-city-text).val() == '') { $(#field-city-text-wrapper).hide(); } $(#field-country).change(function () { var country = $(this).val(); $(#field-city-wrapper).hide(); $(#field-city).val(''); updateState(); }) .change(); $(#field-state).change(updateCity).change(addCity); $(#field-city).change(addCity); } Any thoughts appreciated.
[jQuery] Re: conditionally prevent blur
The mousedown event seems to fire before the blur, at least on FF3, so I came up with this: function highlightFields (el) { var popclick = false; $(el) .focus(function () { $(this).css({border:1px solid #003399}); $(this).parent().css({background-color: #FF}); $(this).filter(:text).select(); //APPEND BOXESBOX $(this).parent().append('div class=boxesBox/div') .children('boxesBox').mousedown(function() { popclick = true }).mouseup(function(){ popclick = false }); }) .blur(function () { if (!popclick) { $(this).css({border: 1px solid #99}); $(this).parent().css({background-color: #CC}); //REMOVE BOXESBOX $ (this).parent().children(.boxesBox).remove(); }; }); } Alternatively you should let the box fade away when clicked, that's the expected behaviour. - ricardo On Oct 23, 2:07 am, omtay38 [EMAIL PROTECTED] wrote: Hello, I am working on a function that highlights an input's containing div when the input receives focus (to help draw focus on a very input heavy form). The function looks something like this: function highlightFields (e) { $(e) .focus(function () { $(this).css({border:1px solid #003399}); $(this).parent().css({background-color: #FF}); $(this).filter(:text).select(); //APPEND BOXESBOX $(this).parent().append('div class=boxesBox/div'); }) .blur(function () { $(this).css({border: 1px solid #99}); $(this).parent().css({background-color: #CC}); //REMOVE BOXESBOX $(this).parent().children(.boxesBox).remove(); }); } You will notice that focusing a field also appends the div boxesBox on focus. This box will contain utilities related to the selected input (like, an about this field button). The idea is, the user can receive immediate feedback based on the input selected. What I cant figure out is how to prevent the blur function from happening when (and only when) this boxesBox div is clicked on. I've tried various combinations of one() and unbind() but my mind refuses to wrap around the situation. Any suggestions? Thanks! ~omtay38
[jQuery] Re: Get label text
But I can join the labels can't I? I tried: .append(levels.join(', ')) to added it to an element and I get the error in Firebug: levels.join is not a function Am I doing something wrong? Thanks, Miguel On Oct 23, 9:57 pm, Klaus Hartl [EMAIL PROTECTED] wrote: You could try this (untested): var labels = $('input:checked + label').map(function() { return $(this).text(); }); That should give you an array with the label's text. --Klaus On 23 Okt., 22:47, shapper [EMAIL PROTECTED] wrote: Hello, This might be a tricky one ... I have been looking into JQuery docs but I can't figure how to make this. I have the following: input type=checkbox name=Roles id=Admin value=Admin / label for=AdminAdministrator/label input type=checkbox name=Roles id=Coll value=Admin / label for=CollCollaborator/label How can I get, NOT the values, of all checked boxes BUT the label inner text of all checked boxes? Example: If Coll checkbox is checked I would get: Collaborator If both checkboxes are checked I would get: Collaborator, Administrator Could someone, please, help me? Thank You, Miguel
[jQuery] Re: Cycle: Direct link from another page
Thanks--that definitely got it a lot cleaner. I ended up needing to do: var $slide = $(window.location.hash); if ($slide.length) { // found a match on hash id var $slideshow = $slide.parent().parent(); var $index = $slideshow.children().index($slide.parent()); } But that was because of some HTML that I'm not terribly happy about but can't work around. Thanks for the push in a much better direction, and the great plugin. Isaac On Oct 23, 7:59 am, Mike Alsup [EMAIL PROTECTED] wrote: Alright, This is really messy, but it works. If anyone's got any tips on cleaning it up, have at it. if ($('body').is('#page-photography')) { //I only want it to fire on one page. Guessing I save some miniscule amount of overhead on the other pages. var loc = window.location.hash; // get the anchor from the link, sohttp://www.example.com/index.php#testwouldgive me #test loc = loc.replace(/\#/g,); // remove the pound symbol to give me just test var j = 0; // set a variable i'll be incrementing later. i have to do this because of some messy html later on. var goHere = 0; //set this so that, no matter what, the startingSlide parameter gets something $(#view-photos-block_1).children().children().each(function(i) { //i'm sure this could be cleaner. that might also be able to remove the j variable. if($(this).attr('id')) { //find out if there even is an id attribute; important because this is what controls j incrementin if($(this).attr('id') == loc) { //if the id and the anchor are the same, set goHere. this will later be used as the startingSlide parameter goHere = j; } j++; //increment j; this give me the real 0 index of the slide. } }) } I would think your code could be simplified down to something resembling this: var $slide = $(window.location.hash); if ($slide.length) { // found a match on hash id var $slideshow = $slide.parent(); var index = $slideshow.index($slide); $slideshow.cycle({ startindIndex: index }); }
[jQuery] Re: drag drop not working under IE and Safari
I finally found out the problem... I had called a js variable class (var class;), which is a keyword. That's why it didn't work at all!!! bye On Oct 21, 4:44 pm, ^AndreA^ [EMAIL PROTECTED] wrote: Hi, I'm working on this drag drop script:http://www.lesperimento.netsons.org/various/jquery-mousemove/ It works on Firefox and Opera but not at all on IE and Safari. The events seemed not to start at all... Any idea how to solve it? I tried to put some alert as well but they don't start, like if javascript were disabled. But it's not because in some other pages it works. Thank you in advance
[jQuery] jQuery Treeview 1.4 by Joern Zaefferer
I am using this menu for a clients website, and I am having some problems with functionality. I may be reading it wrong, but in the documentation under persist: 'location' it states looks within all tree nodes with link anchors that match the document's current URL (location.href), and if found, expands that node (including its parent nodes). I am under the impression that when I create a URL for a menu item, when clicked it will expand the sub-menu's under that menu item, as well as directing you to the appropriate URL. This is where I am having the problem, it does not expand that menu item to expose the sub menu's when the menu item is a URL When you create the menu item as href=# it works fine, but obviously doesn't take you to the appropriate URL page. If the URL is href=something.html or href=something.php it doesn't work. It starts to expand the menu, then closes right up. To see an example of what I am speaking of, please go to the foloowing website. There click on services, then Engineering. Engineering will take you to a new page but the sub menu's won't show until you click one of the links on the engineering page itself. http://radtke.cgsart.com/v7.0/index.php I thought this might have been a problem related to Persist: location but when I removed that from the .js, the problem still existed. Thanks!
[jQuery] Puedo indexar directamente los jquerys de Google?
Habrá algún problema si lo pongo en mi head ? script type=text/javascript src=http://jqueryjs.googlecode.com/ files/jquery-1.2.6.min.js/script
[jQuery] Re: Subheadings in tables
Seeing as the Tablesorter plugin writes classes to the table header when it's sorted, I'd use this as a condition for showing / hiding your secondary table header. What are you looking to display in the second TH?
[jQuery] is this usefull as an lgpl-ed component? canvas fancy ajax loader icon
i've made a loader icon based on the canvas tag.. demo up at http://mediabeez.veerman.ws/mb/ this is an early draft, and i intend to add a bit more features (like scalability) and themes.. but i'm wondering if there would be an interest in a component like this esp with the still difficult support for canvas in IE; http://excanvas.sourceforge.net/ http://blog.vlad1.com/2008/07/30/no-browser-left-behind/ BTW, this component does work in IE, it uses excanvas.. It just looks a bit worse than in FF. Please let me know what you think of it
[jQuery] Re: ajax upload file deletes input's paths...
I didn't solve the problem, I just found a workaround. bye On Sep 30, 10:13 am, ^AndreA^ [EMAIL PROTECTED] wrote: Hello everyone, I'm uploading some images with AJAX (using ajaxfileupload), with a for loop I upload more than one image... It works very well but I've got an issue under IE7... After that the images have been uploaded the paths in the input fields are deleted!!! This does not happen on FF2/3, Safari and Opera... It's very annoying because, using AJAX, I don't refresh the page and I need the paths to be there untill the last submission with the normal php/html form... I cant' write in it because, for security reasons, the type=file attribute of the input field does not allow me to do that. Anyone knows why are deleted in IE7 and not under the other browsers? Should I try another plugin for the upload? Any advice would be very appreciate!!! Thanks, Andrea
[jQuery] Re: can jquery slide a whole page up and down?
Thanks but I have the script I want and this on only seems to move a portion of something when I need the whole page to move like I have. I just don't see why the page moves back to the top. For that matter I also need to link the btton being pressed to thescript anyway, that Description link is just for testing purposes. Anybody.. thanks. On Oct 23, 9:28 pm, Ariel Flesler [EMAIL PROTECTED] wrote: This is a great plugin for that: http://flesler.blogspot.com/2007/10/jquerylocalscroll-10.html It's called LocalScroll, you set up the markup, include the necessary scripts, a simple call and it turns your site into a cool site. Here's one awesome site using it: (by Alex Willcocks) http://www.engageinteractive.co.uk/ Cheers -- Ariel Fleslerhttp://flesler.blogspot.com On Oct 22, 6:46 pm, caturn88 [EMAIL PROTECTED] wrote: I have been to websites in the past which I remember had no scroll bars, relying on buttons to navigate the site. I got the impression the whole site was a massive page, so only one section could be viewed at a time. The really nice thing was that going to a new page would slide there, instead of refreshing and blinking the whole browser window as with HTML. Can jquery do this?
[jQuery] $(element).animate() shifts elements out of order while animating
Hi guys, I'm new to jQuery and I need some help. I have a UL with LIs. In each LI there is a DIV with a bunch of content. The LIs are set to display inline. Anyway, when I run the animate function, the LIs get shifted into their default display (a list) and when the animation completes, the LIs return to their inline display. It's driving me crazy trying to figure it out, and I could definitely use some help. Here is the entire 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 script type=text/javascript src=jQuery.js/script script type=text/javascript var container; var lis; var axes = []; $(function () { container = $('#Container'); lis = $('li', container); axes = getAxes(); }); var getAxes = function (container) { var axes = []; for (var i = 0; i 600; (i = i + 100)) { var axis = { width: 100, left: i, right: (500 - i) }; axes.push(axis); }; return (axes); }; var Animate = function () { var h = document.getElementById('height'); var w = document.getElementById('width'); for (var i = 0; i lis.length; i++) { $(lis[i]).animate({ height: h.value + 'px', width: w.value + 'px' }, 1000); }; }; /script style type=text/css * { margin: 0; outline: none; padding: 0; text-decoration: none; } body { margin: 64px; margin-left: auto; margin-right: auto; width: 600px; } #Container { border: 3px solid #FF; height: 180px; overflow: hidden; position: relative; } #Container ul { overflow: hidden; margin: 6px; position: absolute; white-space: nowrap; } #Container ul li { border: 3px solid #FF; display: inline-block; height: 160px; vertical-align: top; width: 146px; } #Container ul li div { overflow: hidden; padding: 6px; } #Control { list-style: none; padding: 32px; } /style /head body div id=Container ul li div h1Package 1/h1 hr / dl ddWebsite A/dd /dl a href=#Continue/a /div /li li div h1Package 2/h1 hr / dl ddWebsite A/dd ddWebsite B/dd /dl a href=#Continue/a /div /li li div h1Package 3/h1 hr / dl ddWebsite B/dd ddWebsite C/dd /dl a href=#Continue/a /div /li li div h1Package 4/h1 hr / dl ddWebsite A/dd ddWebsite C/dd /dl a href=#Continue/a /div /li li div h1Package 5/h1 hr / dl ddWebsite A/dd ddWebsite B/dd ddWebsite C/dd /dl a href=#Continue/a /div /li /ul /div ul id=Control li input type=text id=height / input type=text id=width / input type=button onclick=Animate(); value=Go / /li /ul /body /html
[jQuery] Re: BlockUI unchecks checkboxes
What exactly is the problem you're seeing? Could you possibly post a demo page somewhere? Mike On Oct 23, 10:22 am, Snooky [EMAIL PROTECTED] wrote: Alright, so I saw that this issue had been raised before, but apparently never actually fixed. I only tested it in FF and Chrome. To reproduce: html: input type=checkbox value=3 id=mycheck / div id=return /div js: $(function() { $(input#mycheck).click(function() { // do something with ajax } $(#return).ajaxStart(function() { $.blockUI(); }) .ajaxStop(function() { $.unblockUI(); }); } The fix because I was in a hurry to get something done: blockui.js, ~ line 265: // var events = 'mousedown mouseup keydown keypress click'; // b ? $(document).bind(events, opts, handler) : $ (document).unbind(events, handler);