[jQuery] Change opacity of item with class of selected
Hi all I've been stuck on this for four hours, and I still can't solve it! I am trying to check if a list item has a class of selected, then is so change the opacity to 0.5. Here is my code: if ($(#portfolio #thumbs ul li).hasClass(.selected)) { $(this).css('opacity','0.5'); } It seems that the this part isn't working, is it to do with putting it in an event? Would appreciate any help
Re: [jQuery] Change opacity of item with class of selected
Just put the class in the selector instead of testing for it first: $(#portfolio #thumbs li.selected).css('opacity','0.5'); If the class doesn't exist, jQuery will do nothing (instead of throwing an undefined error or similar). On Tue, Jan 5, 2010 at 12:45 PM, Paul Collins pauldcoll...@gmail.com wrote: Hi all I've been stuck on this for four hours, and I still can't solve it! I am trying to check if a list item has a class of selected, then is so change the opacity to 0.5. Here is my code: if ($(#portfolio #thumbs ul li).hasClass(.selected)) { $(this).css('opacity','0.5'); } It seems that the this part isn't working, is it to do with putting it in an event? Would appreciate any help
Re: [jQuery] Change opacity of item with class of selected
Thanks very much for your help Brian. That works, but I think the problem may go deeper than I thought! I've put up a test page. I'm using the JQuery Opacity Rollover Script as a part of the Gallerific plugin http://www.twospy.com/galleriffic/#1 To try and keep this simple, when you hover over a thumbnail, it originally went from dark to light. I've reversed the order of this in mouseOutOpacity mouseOverOpacity on the scripts.js jquery.opacityrollover.js, so now they are full opacity by default and half when you hover over. There is a selected class applied when you click on a thumbnail and I want to make the opacity stay at half when you click on it. There seems to be a default on all list items of the thumbs ul of opacity: 1; I want to change it to 0.5 when an item has a class of selected, but can't get it to work. I've tried removing the inline style first using $(#portfolio #thumbs li.selected).removeAttr(style); But this doesn't work. Sorry for the long windedness of this post, but if anyone could even give me a hint of where to start looking, I would be really grateful. Thanks 2010/1/5 brian zijn.digi...@gmail.com Just put the class in the selector instead of testing for it first: $(#portfolio #thumbs li.selected).css('opacity','0.5'); If the class doesn't exist, jQuery will do nothing (instead of throwing an undefined error or similar). On Tue, Jan 5, 2010 at 12:45 PM, Paul Collins pauldcoll...@gmail.com wrote: Hi all I've been stuck on this for four hours, and I still can't solve it! I am trying to check if a list item has a class of selected, then is so change the opacity to 0.5. Here is my code: if ($(#portfolio #thumbs ul li).hasClass(.selected)) { $(this).css('opacity','0.5'); } It seems that the this part isn't working, is it to do with putting it in an event? Would appreciate any help
Re: [jQuery] Change opacity of item with class of selected
Sorry, the test page: http://paulcollinslondon.com/test/test.html 2010/1/5 Paul Collins pauldcoll...@gmail.com Thanks very much for your help Brian. That works, but I think the problem may go deeper than I thought! I've put up a test page. I'm using the JQuery Opacity Rollover Script as a part of the Gallerific plugin http://www.twospy.com/galleriffic/#1 To try and keep this simple, when you hover over a thumbnail, it originally went from dark to light. I've reversed the order of this in mouseOutOpacity mouseOverOpacity on the scripts.js jquery.opacityrollover.js, so now they are full opacity by default and half when you hover over. There is a selected class applied when you click on a thumbnail and I want to make the opacity stay at half when you click on it. There seems to be a default on all list items of the thumbs ul of opacity: 1; I want to change it to 0.5 when an item has a class of selected, but can't get it to work. I've tried removing the inline style first using $(#portfolio #thumbs li.selected).removeAttr(style); But this doesn't work. Sorry for the long windedness of this post, but if anyone could even give me a hint of where to start looking, I would be really grateful. Thanks 2010/1/5 brian zijn.digi...@gmail.com Just put the class in the selector instead of testing for it first: $(#portfolio #thumbs li.selected).css('opacity','0.5'); If the class doesn't exist, jQuery will do nothing (instead of throwing an undefined error or similar). On Tue, Jan 5, 2010 at 12:45 PM, Paul Collins pauldcoll...@gmail.com wrote: Hi all I've been stuck on this for four hours, and I still can't solve it! I am trying to check if a list item has a class of selected, then is so change the opacity to 0.5. Here is my code: if ($(#portfolio #thumbs ul li).hasClass(.selected)) { $(this).css('opacity','0.5'); } It seems that the this part isn't working, is it to do with putting it in an event? Would appreciate any help
[jQuery] Change this when binding element
I am suggestion for new small feaute in jQuery. add a new proeprty to bind function. a Scope property. sometimes I am binding a function inside object. So I need a solution to change the scope of this function. something like: $().bind('click',data,scope,function) For Example: function myObj() { this.a='1' document.bind('scroll',this.myScroll); this.myScroll=function () { //Now I am trying to get this.a alert(this.a)} //This is make an error becuase this is an HtmlElement and not THIS object } var a=new myObj();
[jQuery] Change Window Location, and Send REQUEST or POST Info?
Let's say a user visits my site, and takes an action that requires him to be logged in. I would like to: - Take him to the login page - Automatically return to the page he started from after he logs in So I need to capture the current window.location, which is easy (var returnURL = window.location) and communicate it to my app. I can't use URL variables (e.g. ?returnURL=http://www.returnlocation.com), because I'm using CodeIgniter, so I need to pass the returnURL in a POST or REQUEST variable. Is there a way to do this? Thanks in advance to all for any info.
Re: [jQuery] Change Window Location, and Send REQUEST or POST Info?
I would do all of this server-side. Have your PHP script save the requested page in the session before redirecting to the login page. Or, write the requested URL to a hidden input in the login form. On Sat, Dec 19, 2009 at 6:16 PM, Vik v...@mindspring.com wrote: Let's say a user visits my site, and takes an action that requires him to be logged in. I would like to: - Take him to the login page - Automatically return to the page he started from after he logs in So I need to capture the current window.location, which is easy (var returnURL = window.location) and communicate it to my app. I can't use URL variables (e.g. ?returnURL=http://www.returnlocation.com), because I'm using CodeIgniter, so I need to pass the returnURL in a POST or REQUEST variable. Is there a way to do this? Thanks in advance to all for any info.
Re: [jQuery] Change opacity for all divs except one
Hi Jared The script is quite simply. Study it. jQuery: (document).ready(function(){ $('#thumbs div').click(function() { $(this).find('img').css('opacity', 1); $(this).siblings().find('img').css('opacity', 0.5); }); }); HTML: div id=thumbs diva href=#img src=1.jpg alt= //a/div diva href=#img src=2.jpg alt= //a/div diva href=#img src=3.jpg alt= //a/div diva href=#img src=4.jpg alt= //a/div diva href=#img src=5.jpg alt= //a/div diva href=#img src=6.jpg alt= //a/div /div Hope this help you Maurício -Mensagem Original- De: Jared Para: jQuery (English) Enviada em: sexta-feira, 4 de dezembro de 2009 19:42 Assunto: [jQuery] Change opacity for all divs except one Hello all, I have a bunch of thumb nails that will be at full opacity when a user gets to the page. Users will be able to select their favorite. What I want to have happen is when a user selects their first favorite all of the there thumbnails will be lowered in opacity then when they select other favorites the opacity of that thumbnail will be brought to full. Each thumbnail is in a div. I am at a complete lose on how I can achieve this. Any help is greatly appreciated. If you need anymore info just ask. Thanks ins advance!
Re: [jQuery] Change opacity for all divs except one
Maybe something like this would work? $(function() { $(#thumbs div).click(function() { $(this).toggleClass(selected); if ($(#thumbs).data(user already selected their first favorite)) { if ($(this).hasClass(selected)) { $(this).fadeTo(slow, 1); } else { $(this).fadeTo(slow, 0.33); } } else { $(#thumbs div:not(.selected)).fadeTo(slow, 0.33); $(#thumbs).data(user already selected their first favorite, true); } }); }) Just a thought... (I did not test it) On Sat, Dec 5, 2009 at 12:10 PM, Mauricio (Maujor) Samy Silva css.mau...@gmail.com wrote: Hi Jared The script is quite simply. Study it. jQuery: (document).ready(function(){ $('#thumbs div').click(function() { $(this).find('img').css('opacity', 1); $(this).siblings().find('img').css('opacity', 0.5); }); }); HTML: div id=thumbs diva href=#img src=1.jpg alt= //a/div diva href=#img src=2.jpg alt= //a/div diva href=#img src=3.jpg alt= //a/div diva href=#img src=4.jpg alt= //a/div diva href=#img src=5.jpg alt= //a/div diva href=#img src=6.jpg alt= //a/div /div Hope this help you Maurício -Mensagem Original- De: Jared Para: jQuery (English) Enviada em: sexta-feira, 4 de dezembro de 2009 19:42 Assunto: [jQuery] Change opacity for all divs except one Hello all, I have a bunch of thumb nails that will be at full opacity when a user gets to the page. Users will be able to select their favorite. What I want to have happen is when a user selects their first favorite all of the there thumbnails will be lowered in opacity then when they select other favorites the opacity of that thumbnail will be brought to full. Each thumbnail is in a div. I am at a complete lose on how I can achieve this. Any help is greatly appreciated. If you need anymore info just ask. Thanks ins advance!
[jQuery] Change opacity for all divs except one
Hello all, I have a bunch of thumb nails that will be at full opacity when a user gets to the page. Users will be able to select their favorite. What I want to have happen is when a user selects their first favorite all of the there thumbnails will be lowered in opacity then when they select other favorites the opacity of that thumbnail will be brought to full. Each thumbnail is in a div. I am at a complete lose on how I can achieve this. Any help is greatly appreciated. If you need anymore info just ask. Thanks ins advance!
Re: [jQuery] Change opacity for all divs except one
Have all the divs have a class name eg.) thumbs When the user selects his favorite remove this class name from the particular div and apply your opacity logic to $('div.thumbs'), so that way the favorite one would not be changed. Thanks Regards, Dhruva Sagar. On Sat, Dec 5, 2009 at 3:12 AM, Jared jhkersch...@gmail.com wrote: Hello all, I have a bunch of thumb nails that will be at full opacity when a user gets to the page. Users will be able to select their favorite. What I want to have happen is when a user selects their first favorite all of the there thumbnails will be lowered in opacity then when they select other favorites the opacity of that thumbnail will be brought to full. Each thumbnail is in a div. I am at a complete lose on how I can achieve this. Any help is greatly appreciated. If you need anymore info just ask. Thanks ins advance!
Re: [jQuery] Change a css value for a child of the selected element
$(function() { var list_item = $(li); var current = -1; list_item.hover(function() { var index = list_item.index($(this)); if(index != current) { $(a, list_item.eq(index)).css({backgroundColor:'#ccc'}); index = current; } }, function() { $(a, list_item.eq(current).css({ backgroundColor:#FFF}); }); }); On Sat, Nov 28, 2009 at 7:12 PM, LPA lpas...@gmail.com wrote: Hi, I have this code which change color of the background of the li when the mouse enter or leave. I'd like to change the color of the first a of the li selected. Thanx for your help !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/ jquery.min.js/script titleSandbox/title meta http-equiv=Content-type content=text/html; charset=utf-8 / style type=text/css media=screen body { background-color: #000; font: 26px Helvetica, Arial; color: #fff; } .menu_on {background-color: yellow;} /style script type=text/javascript $(document).ready(function(){ $(li.long).mouseenter(function() { $(this).addClass(menu_on); }); $(li.long).mouseleave(function() { $(this).removeClass(menu_on); }); }); /script /head body ul id=menu li class=long a href=#menu 1/a div class=lignes ul liLine/li liLine/li liLine/li liLine/li liLine/li /ul /div /li li class=long a href=#menu 2/a div class=lignes ul liLine/li liLine/li liLine/li liLine/li liLine/li /ul /div /li /ul /body /html
Re: [jQuery] Change a css value for a child of the selected element
Hi, It's nearly what I'm searching for :) The problem with your function, is that the script change ALL the a for the child. I just wanna change the first one :) Thanx a lot - Original Message - From: waseem sabjee To: jquery-en@googlegroups.com Sent: Saturday, November 28, 2009 6:34 PM Subject: Re: [jQuery] Change a css value for a child of the selected element $(function() { var list_item = $(li); var current = -1; list_item.hover(function() { var index = list_item.index($(this)); if(index != current) { $(a, list_item.eq(index)).css({backgroundColor:'#ccc'}); index = current; } }, function() { $(a, list_item.eq(current).css({ backgroundColor:#FFF}); }); });
Re: [jQuery] Change a css value for a child of the selected element
Hi, It's nearly what I'm searching for :) The problem with your function, is that the script change ALL the a for the child. I just wanna change the first one :) Thanx a lot - Original Message - From: waseem sabjee To: jquery-en@googlegroups.com Sent: Saturday, November 28, 2009 6:34 PM Subject: Re: [jQuery] Change a css value for a child of the selected element $(function() { var list_item = $(li); var current = -1; list_item.hover(function() { var index = list_item.index($(this)); if(index != current) { $(a, list_item.eq(index)).css({backgroundColor:'#ccc'}); index = current; } }, function() { $(a, list_item.eq(current).css({ backgroundColor:#FFF}); }); });
Re: [jQuery] Change a css value for a child of the selected element
Shame on me. I found my solution.. it was so simple :) $('a', this).eq(0).css('color','pink');
[jQuery] Change images dinamically with jquery
Hi guys! I come write from Italy, I am a jquery noob and I am working on it to improve my skills. This instrument is fantastic for noobs!! Here it is my website (do you like my shots??). I am triyng to change horizontal image bar with new images when I click on left sections. How can I do it? Can you help me? http://www.searose.it
[jQuery] change the height of a div that is loaded after the jQuery is
I'm developing a comment panel for a blog that uses Disqus. The design is really tight, and the client is insistent that THIS is the layout. You can see it here: http://agave.purebluebeta.com/blog/2009/nov/20/test-entry/ Problem is, the height is changed AFTER my jQuery is loaded. IE, Disqus comes in after the variables are all set. And I need to know the maximum height for the comments panel when ever it is changed because it will grow over time as more comments are added. But that is done with the Disqus code. Something like $(this).live().height(); But live is only tied to events... right? Any tips are welcome. Thanks.
Re: [jQuery] Change all CSS background images url
Why are you using a root-relative URL ? If the entire site is in a folder, and then you move everything into another folder, everything will stay relative. Therefore, having the path as img (or whatever the relative path to that folder is) should work, no ? Liam nomen wrote: Hi all: I have a website. All my images are in /img directory. Now, my client needs to put the site in a subdirectory, so, my images are now in /subdir/img. In the future, maybe we have to change the site to another subdirectory. I don´t want to change all my CSS anytime the client changes the subdirectory. So my question is: Is there a simple way to change all CSS background-image property with the next logic: Change all the existing CSS background-image properties in this way: if the url starts with /img change to /subdir/ img else do nothing Thank you for your help in advance. No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.425 / Virus Database: 270.14.67/2506 - Release Date: 11/16/09 07:43:00
[jQuery] Change all CSS background images url
Hi all: I have a website. All my images are in /img directory. Now, my client needs to put the site in a subdirectory, so, my images are now in /subdir/img. In the future, maybe we have to change the site to another subdirectory. I don´t want to change all my CSS anytime the client changes the subdirectory. So my question is: Is there a simple way to change all CSS background-image property with the next logic: Change all the existing CSS background-image properties in this way: if the url starts with /img change to /subdir/ img else do nothing Thank you for your help in advance.
Re: [jQuery] Change all CSS background images url
it would be a bad idea to do this with javascript. I'd recommend simply using find and replace all in your css. find url(/img replace url(/subdir/img nomen wrote: Hi all: I have a website. All my images are in /img directory. Now, my client needs to put the site in a subdirectory, so, my images are now in /subdir/img. In the future, maybe we have to change the site to another subdirectory. I don´t want to change all my CSS anytime the client changes the subdirectory. So my question is: Is there a simple way to change all CSS background-image property with the next logic: Change all the existing CSS background-image properties in this way: if the url starts with /img change to /subdir/ img else do nothing Thank you for your help in advance.
Re: [jQuery] Change all CSS background images url
First idea that comes to mind is to let your client define another site base, you then don't even have to change your css as the apparent site base would be the client's sub-directory. You do that using the base tag as shown here : http://www.w3schools.com/TAGS/tag_base.asp Hope it helps. Michel Belleville 2009/11/16 nomen gaston...@gmail.com Hi all: I have a website. All my images are in /img directory. Now, my client needs to put the site in a subdirectory, so, my images are now in /subdir/img. In the future, maybe we have to change the site to another subdirectory. I don´t want to change all my CSS anytime the client changes the subdirectory. So my question is: Is there a simple way to change all CSS background-image property with the next logic: Change all the existing CSS background-image properties in this way: if the url starts with /img change to /subdir/ img else do nothing Thank you for your help in advance.
[jQuery] Change style of Div with fade
Hi, Can anyone tell me how to rotate the background-color style of a div with a fade? I need it to rotate colors every 10 seconds, having one fade into the next, and will need to have 3 background colors, then keep looping from the first color. My Div is named #rotateBG. Thanks
Re: [jQuery] Change style of Div with fade
Jonathan Snook's background animation article might be helpful: http://www.snook.ca/archives/javascript/jquery-bg-image-animations/ --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Nov 12, 2009, at 9:27 AM, Dan wrote: Hi, Can anyone tell me how to rotate the background-color style of a div with a fade? I need it to rotate colors every 10 seconds, having one fade into the next, and will need to have 3 background colors, then keep looping from the first color. My Div is named #rotateBG. Thanks
[jQuery] Change row colors of table based on content
Anybody want to discuss a way to change row colors of table based on content, for example: +-|---+ |acess|COSTUMER | |-| | 1 | joseph | | 2 | mary| | 3 | john| | 4 | joseph | | 5 | joseph | | 6 | guile | | 7 | mary| | 8 | craig | +-+ in this table, the name Joseph and Mary are repeated, so, every joseph or mary row must have the same color (picked randomly or not). so as every craig, guile or john row. I don't want to use css class names based on the name of the costumers because I don't know how many costumers are and how many times they appear or repeat. thanks
[jQuery] change backgroundposition to window width
$(function(){ var w = $(window).width(); $('#background').css({backgroundPosition: w + 'px 190px'}); }); Could anyone explain to mee why this is not working...?
[jQuery] Change the contents of a div after it has been created
I'm trying (rather unsuccessfully) to fill a div that was created by jquery. I feel like the code should work: any hints or solutions? Here's my html: div class=test_area div class=foo/div div class=fooAlt/div /div Here's my javascript: $(document).ready(function(){ $('.foo').append('a href=#img src=1.gif class=1 alt=1st image //a'); $('.foo a img').click(function(event){ event.preventDefault(); $('.foo').attr('alt'); }) });
[jQuery] Change bg image on hover
Hi guys I have a dropdown menu. When the dropdown is hovered, I need a bg image to show, then slowly fade out when the mouse leaves. I wrote this little script for it: var $j = jQuery.noConflict(); $j(function(){ $j(#dropdown-nav li ul li).mouseover(function(){ $j(this).stop().before('li class=hoverbg/li'); }), $j(#dropdown-nav li ul li) .mouseleave(function(){ $j(#dropdown-nav li ul li.hoverbg).stop().fadeOut(300, function() { $j(this).remove(); }); }) }); So it adds an extra li above the one being hovered (which via css is positioned absolutely so the next li displays over the top). Anyways, it works fine, but sometimes when hovering it adds 2 or 3 li's in there. I thought the stop() would sort that, but it hasn't. Any ideas why that's happening? And could this be written better? It's one of my first attempts with jQuery so go easy on me!
[jQuery] Change page on selected combo value
Hi all, I have an .ascx page with a populated combobox: select id=Users name=Users option value=New User---New User---/option option value=TedWilsonTed Wilson/option option value=KatyBruceKaty Bruce/option /select I need that when the user select New User he will be redirected to another page where he can insert the new user's value. Ho can I accomplish this? Thanks in advance. Luis --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups jQuery (English) group. To post to this group, send email to jquery-en@googlegroups.com To unsubscribe from this group, send email to jquery-en+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-en?hl=en -~--~~~~--~~--~--~---
[jQuery] Change form action based on button clicked
Hi all, I have a form like this: form id=my_form method=post action= Name: br / input type=text id=name name=name / input type=submit id=submit1 value=Go to page 1 / input type=submit id=submit2 value=Go to page 2 / /form how can I change my action form so the form goes to Page1.htm with click on button1 and goes to Page2.htm to click on button2, and mantein the value inserted in textbox name? Thanks a lot. Luis
[jQuery] change browser url?
Hi, i'd like to know if i can change the page url somehow. for example: let say the page's url is: http://groups.google.com/group/jquery-en/post i would like to change it to: http://groups.google.com/group/jquery-en/bla without reloading the page. is that possible? if so how can i do that? thanks for any help.
[jQuery] change parent div height after child
Hi. I have the following layout. .panel { position:relative; width:580px; height: auto; /*overflow: auto;*/ padding: 4px; } .panelContent { position:absolute; top:18px; left:0px; width:580px; background-color:GrayText; } .rptViewer { clear: both; text-align:center; /*height: 95%;*/ width: 95%; margin: auto; } div class=panel div class=panelHdrnbsp;nbsp;Expense Categories /div div class=panelContent div class=rptViewer br / rsweb:ReportViewer ID=ReportViewer1 ... /div /div /div The parent (class=panelContent) div contains a child element that is generated/rendered last. This makes the child element #ReportViewer1 overlap the parent (class=rptViewer). Can I jQuerytize the parent div to adjust it's size after the child renders so it is contained/displayed in the parent? Thanks
[jQuery] Change keyCode of triggered event...
Hi, all.. I need to change a keycode of triggered event... What I need to do, is when a user pressing right + key on the numpud, I need it to be TAB instead... Since I cannt know when on the screen he will do it, I cannt use itaration of elements... I cannt know what will be the next element... here is the code I tried, any help will be appriciated.: Code: $(function() { $(form input).keydown(function (e) { if ((e.which e.which == 13) || (e.keyCode e.keyCode == 13)) { // alert('SUBMIT '+this.name) ; return false; } else if ((e.which e.which == 107) || (e.keyCode e.keyCode == 107)) { // alert('SUBMIT '+this.name) ; //$(form input).val('value').trigger( keypress, [9] ); alert('Main:' + e.keyCode); e.keyCode=9; $(e.target).trigger(e); // var objE = new jQuery.Event(keydown); // objE. // $(e.target).trigger({ // type:keydown, // keyCode:9 //}); return false; } else { alert('Error: '+e.keyCode); return true; } }); the 107 is the keyCode of the right + on the numpud, and 9 is TAB key.
[jQuery] Change button text with ajax
Hi, I would like to change the text of an asp button from client-side code without posting back to the server. Is this possible to achieve with ajax? Can someone give me a code example please? Thanks! -- View this message in context: http://www.nabble.com/Change-button-text-with-ajax-tp23483982s27240p23483982.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Change visibility as elements cycle()?
jQuery('#topfader-parent-forum').cycle({fx:'fade',speed:800,timeout: 6000,pause:5 }); That's cycle() plugin code that works. Question: how do you make each inner element -- .topfader-child-forum -- change its visibility to show as it's shown?
[jQuery] Change text items in URL
I have three radio boxes set up where each one is a different value. - red - blue - green I'd like when one of them is clicked to change the value of the url. So for example --Changethisvalue-- would be actively updated on each click. http://domain.com/ad/campaign/g/--Changethisvalue--/dck/35
[jQuery] Change li class to current and remove all other current classes onclick
I have already read the similar post in this group, and have scoured the internet in search of an answer, but nothing is working for me! My website is all contained on one page. I have the jQuery lavalamp menu at the top of the page with the About Me tab set to class=current when the page loads. When you click the tabs it scrolls to the appropriate part of the page. Basically, when you click one of the li's, I want it's class to be changed to current and the previously selected tab to remove it's current class. This is my HTML: div id=menu ul class=menu li class=currenta href=#aboutAbout Me/a/li lia href=#portfolioMy Portfolio/a/li lia href=#contactContact Me/a/li /ul /div Thanks a lot, Mat.
[jQuery] change LI class onclick of A inside
i'm using Glossymenu at dynamic drive: http://www.dynamicdrive.com/style/csslibrary/item/glossy_horizontal_menu/ what i want to accomplish is when I click one of the links inside the LI element, the LI's in the UL lose their class of 'current' and the clicked LI gains the class 'current' i have the menu driving links to open content in an iframe so, i'm not going to reload the menu each time i choose a different tab - this is why i wish to use jquery. can someone correct my syntax - i can't seem to get it to work $(li.glossymenu).bind(onclick,function(){ $(li.glossymenu).removeclass('current'); $(this).addclass('current'); }; ); thanks
[jQuery] change onmouseover function call
hi there, have a puzzling one. i have a fairly simple function call that we use to display tooltips over certain image elements. we put the function call in the onmouseover attribute of the image element. looks like this: script function CreateTip( strTipMessage ) { // GENERATE TOOLTIP } /script img id=img src=/images/image.jpg onmouseover=CreateTip( 'this is the tooltip' ); onmouseout=ClearTip(); / what i would like to do is to change the tooltip that is displayed when the image is clicked. So the code becomes: script function CreateTip( strTipMessage ) { // GENERATE TOOLTIP } function ChangeTip( ) { $( #img).attr( onmouseover, CreateTip( 'New ToolTip' ) ); } /script img id=img src=/images/image.jpg onmouseover=CreateTip( 'this is the tooltip' ); onmouseout=ClearTip(); onclick=ChangeTip( ); / this works when i click on the element - ie. the 'New tooltip' text is displayed properly - but only if i keep my mouse pointer over the image. my problem is that when i move the mouse off the image and return it to the image, the OLD tooltip is displayed. any help here would be really, well, helpful. thanks a bunch... airyt
[jQuery] change video width while playing
is there anyway to change width of a embeded video with javascript so that user can click a button and the video will be bigger but it won't start from beginning. it is like veoh website where you can click a large button and the video will enlarge. Please help me out here. thank you
[jQuery] Change Table Row Color based on column content
I have a django app where i have a model which contains a boolean (checkbox) field. What i would like to do is change the corresponding table row color in the admin table based on whether or not this field is checked. i have come to the conclusion that this is only possible with jquery. i am a complete n00b when it comes to jquery so i was looking for some guidance/suggestions on how i might be able to accomplish this. Cheers
[jQuery] Change background of table row based on column's value
I am totally new to jQuery. I wonder if it's possible to change the background color of any row in the table below where the value of the table cell belonging to class numericColumn is greater than 90? The values in this column will always be numeric. Thanks for any help, Lars table class=importResults tbody tr td0/td td class=numericColumn66/td tdNo significant changes/td /tr tr td491/td td class=numericColumn1/td tdFailed DPV because of invalid primary/td /tr /tbody /table
[jQuery] Change direction of 'animate' function
I need to use the animate function (slide, show, etc won't do) on a project. Typically, 'animate' expands down and to the right. How can I alter this? For example, I am putting thumbnails of images on both sides of a site. When hovered, a larger version animates into view. Because of the down/right direction, the left-hand side works fine. I need the right-hand side one to animate down/left. Is this possible?
[jQuery] .Change handler on Select element resets input Form
I attach a change handler to a Select List. When the user selects a list entry I use Ajax (.ajax) to query whether this entry requires special acknowledgement. If it does I create an absolute positioned div over the page and request that the user click a link to close it. I attach a click handler to the anchor on this popup div. When clicked, I fade out the popup div. When the div disappears all form elements (form containing the select) are reset. I need to retain the change the user just made to the list. The code that creates the popup on success return from the .ajax is: $('div id=jqDisclaim_dialog/div') .css({ position: 'absolute', left: ($(window).width()-100)/2, top: ($(window).height()-300)/2, display: 'none' }) .html(data) .addClass('flyoutDialog') .appendTo('body') .fadeIn(3500); Whenever this div is removed, my original form is rest. Anyone know of a way to stop the list from reseting?
[jQuery] Change CSS depending on page you're on
I'm trying to do something simple but this is my first stab at doing this in JQuery. div id=menu ul li class=current_page_item default.aspx home /li li about.aspx about /li li contact.aspx contact /li /ul /div based on the page, change the css. So like doing a window.location and then parse out the url to the page then check. If it's the about.aspx I need to change the li item's css. -- View this message in context: http://www.nabble.com/Change-CSS-depending-on-page-you%27re-on-tp22280342s27240p22280342.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Change image attribute based on variable
Hi, pulling my hair out here. When the page loads I'm collecting a variable from the url which corresponds to the class of an image. I want to then change the image source. I'm doing this because the page doesn't reload and the menu needs to respond to the content if you get my meaning. $url = location.href; $hashtag = $url.search(/#/) $url2 = $url.split(#, $hashtag); $finalurl = $url2[1]; This is the code I use to get the class name. When I try to add $finalurl to the attr (see below) it throws an error (undefined, console.log shows it is defined within the if statement). $($finalurl).attr(src, $($finalurl).attr(src).split(.).join (_on.)); Full code: $url = location.href; $hashtag = $url.search(/#/) $url2 = $url.split(#, $hashtag); $finalurl = $url2[1]; counttemp = 0; if (counttemp == 0) { console.log($finalurl); $($finalurl).attr(src, $($finalurl).attr(src).split(.).join (_on.)); counttemp = countemp + 1; } Any help would be greatly appreciated.
[jQuery] change not working
Hello. I have a form where i update some fields if there are info on the database (autolad of data). Then I have to verify if some data must been shown if certain conditions happens. When I change the value of a *select* changes, validations are made and I have binded that select for changes. $('#selectId').change(function(){ // validations }); Happens that when I change that select using jquery it doesn't validates (but does when user updates the field on the browser). Any ideas to solve this problem, are very welcome.. -- Mario Soto marios...@cancuen.net ..._
[jQuery] Change subdomain on same page...
I have different subdomains pointing to the same file on my server - simple enough. What I'd like to do is essentially reverse that: Can the same file redirect to different subdomains? For example: http://adamkobrin.com When you click on any of the top 4 links, different content is loaded, but you remain on the same page with (hopefully) nice smooth transitions - the url remains unchanged. I'm looking for a client-side way to change the subdomain in the location bar based on each link, making it possible for the user to bookmark each page differently, without compromising my smooth transitions by loading a new page... Make sense? Possible? Thanks!
[jQuery] .change alternative
Hi, I'm using a .change function to find out whether a radio button or not is selected by the user. I then show() or hide() other fields according to which radio button has been selected. Now, the problem arises when someone clicks on the reload button of the browser, or if some php validation returns to the form, some fields remain hidden because the .change function has not been triggered. Is there a way to detect which radio button is selected - before any user input? I'm thinking of something like: if radio button with id is selected, then show / hide these other fields. Is there something like .selected? I could use and check from the value? Thanks for your help!
[jQuery] change certain elements in result set based on position
Hello all, I can't quite get my head around how to accomplish this and any guidance would be greatly appreciated. Say I have some random number of h1's on the page, like 20. I'd like to grab the first 4 and make them red, then grab the next 4 and make them blue, then grab the next 4 and do something else with them, and so on until I reach the end. I've been looking at .each() and some of the array functions, but I can't seem to piece it together. Thanks, Michael
[jQuery] change image scr of all images in a page
hi, i have more than 20 images in a form which might be refering like this image src = images/search.gif/ i want a jquery script for replacing all image src with image src = http://s.images/images/search.gif/ please help b u d d h a
[jQuery] Change/Break in the JQuery 1.3 selecting xml nodes based on attribute value?
Hi There, I have been trying to integrate JQuery 1.3 into our software but found it breaking where I have previously successfully been using JQuery 1.2.6 to select xml nodes. The following test page illustrates and explains the problem. To recreate the issue you would need to create a html file containing all of the following as well as an xml file named XMLFile.xml which returns the xml noted in the comments below as well as a copy of both JQuery 1.2.6 and 1.3 as named/referenced in the head below. Does anybody know whether this might be a bug, intended behaviour (these selectors still seem to be supported although I noted the @ symbol should now be removed from the attribute name which I have done) or something I need to change in my code for the latest JQuery version? Thanks, Chris TEST PAGE html xmlns=http://www.w3.org/1999/xhtml; head !--script src=jquery_1.2.6.js type=text/javascript/ script-- script src=jquery_1.3.js type=text/javascript/script /head body Running this page with jquery 1.2.correctly performs the selection, 1.3 fails as noted below: script type=text/javascript function successXml(data) { /* With JQuery 1.3 the following falls over. IE shows --- Windows Internet Explorer --- Stop running this script? A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive. --- Yes No --- And the VS.NET 2008 debugger then says: Microsoft JScript runtime error: Object doesn't support this property or method */ var res = $(result[name='MyResultNode'], data); alert(res[0].xml); }; /* NOTE XML Page returns: result name=MyResultNode object name=MyObjectNode group name=MyGroupNode value name=Head mode=enabled/ /group /object /result /* $.ajax({ url: XMLFile.xml, dataType: xml, success: successXml }); /script /body /html
[jQuery] change()
Hello all, a little new the js and jquery any help would be fantastic... I have this in my linked myFx.js file: $(document).ready(function() { var selected_type = $('select#campaign_type_select'); var coupon_div = $('#campaign_create_coupon'); var broadcast_div = $('#campaign_create_broadcast'); var contest_div = $('#campaign_create_contest'); // alert(selected_type.val()); I CAN GET THIS TO FIRE WHEN UNCOMMENTED, and it returns the the value coupon as i would expect. BUT THIS ISNT WORKING ive tried various renditions (this.val(), selected_type, etc...) based on what i have read on this site and the jQuery site with 0 success. selected_type.change(function() { if (this.val() == 'contest') { alert('contest'); } else if (this.val() == 'broadcast') { alert('broadcast'); } else (this.val() == 'coupon') { alert('coupon'); } }); }); This is the HTML: div class=form_data_wrap div class=form_data_labelCampaign Type:/div div class=form_data_value select id=campaign_type_select option value=couponCoupon/option option value=broadcastBroadcast/option option value=contestContest/option /select /div /div Someone point me in the right direction.\m/.\m/
[jQuery] Change the date format of jquery calendar
Hi all i have one jquery calendar $('selector').datePicker(); which is giving me in dd/mm/ i want to change this format to -mm-dd i tried with $.datePicker.setDateFormat('ymd','-'); error: $.datePicker is undefined and tried with this code $(#sd).datepicker.setDateFormat('ymd','-'); error: $(#sd).datepicker.setDateFormat is not a function
[jQuery] Change image to black and white on hover
Hi all, I'd like to think this is possible with JQuery, but can't find a reference online. Basically, I have a bunch of coloured logos that have links wrapped around them. I would like to create a hover state using JQuery that makes the images turn black and white when you hover over them. Currently I am creating two images - one colour, one black and white then swapping them out using CSS. If I could create the black and white hover state using JQuery, it would save a lot of hassle. Would appreciate any help.
[jQuery] change element attribute, then have jquery act on that change?
I'm using filters to find if an li's text matches a certain value, and then changing the value if it does. This works fine. However, if I then use my selectors to check for the new value, jquery does not seem to pick it up, making me wonder if perhaps the selectors only work for values coded into the actual html, not generated by jquery. Here's my example code of what I'm trying to do: HTML snippet: liDonate/li JQUERY code: $(li.dnt:contains('Donate')).click(function(){ $(this).text('Remove'); alert('Donate'); }); $(li.dnt:contains('Remove')).click(function(){ $(this).text('Donate'); alert('Remove'); }); In the example above, the first time I click I get an alert of saying 'Donate.' The second time I click, I should get an alert saying 'Remove,' but instead it just says 'Donate,' even though the text value has changed. Am I missing something, or is this sort of filtering on jquery-generated values not possible? Thanks! Philip
[jQuery] Change Cycle plugin fx dynamically?
I'm using the Cycle plugin and I'd like to change the transition effect dynamically. I tried stopping the show and restarting by calling .cycle() with different options, but it didn't work properly. Some of the slides would be missing and the animations didn't always operate correctly. Is there a recommended way to change the fx on the fly? Thanks!
[jQuery] Change URL in beforeSend
I have an app and want to change the url for all ajax requests to give them a relative path. I tried to set up a global change using ajaxSetup and beforeSend, but the url was only updated in the config, not the request object. Any thoughts on how to do this? code $.ajaxSetup({ beforeSend : function(J) { this.url = /newpath/ + this.url; } }); /code
[jQuery] Change the data attribute of flash object - works in FF, not IE
Arrgh! Please can someone help me out with a jQuery/flash issue. I have a page with a content region on the left and a flash movie on the right. The flash object calls in images from an XML file, using code like this (generated using swfobject.js): swfobject.embedSWF(/sites/pod_billboard.swf?XMLsrc=/Managexml/flash.aspx?pageid=n, swf, 500, 400, 8.0.0, /sites/expressInstall.swf, flashvars, params, attributes); The value n determines the XML file for the flash to load. Using jQuery, I've created a script that when you click an h3 link, changes the data attribute of the flash object tag. The script is as follows: // change the value of the object data attribute to fetch an XML file for the flash billboard jQuery(h3.toggler a).click(function() { var id = this.href.substring(this.href.lastIndexOf('#') + 1); var theswf = '/sites/pod_billboard.swf?XMLsrc=/Managexml/flash.aspx?pageid='+id; jQuery('#billboard object').attr('data',theswf); }); Essentially, the script gets a number from an a href tag inside the h3. I set the pageid (n) to use this number, and then jQuery changes the data attribute with the string var theswf when the h3 link is clicked. In Firefox, this works a treat, and the flash object immediately gets the new XML file and starts loading the images specified in the XML file. However, in IE, the flash movie never refreshes with the new XML file. I've tried the jquery.flash.js plugin but have had no success at all. The script mentions this: * IMPORTANT: * The packed version of jQuery breaks ActiveX control * activation in Internet Explorer. Use JSMin to minifiy * jQuery (see: http://jquery.lukelutman.com/plugins/flash#activex). I've tried the min version with no luck either. You can examine the test page here: http://perrinepod.cluedesign.com.au/corporate/default.aspx Try it in FF first, to see how it is supposed to work, then try it in IE and be stunned at the nothing that happens. Has anyone come across this issue in IE? Is there any way to get it working like it does in FF? I've reached the end of my tether here and have no idea what to try next. :,( -- View this message in context: http://www.nabble.com/Change-the-data-attribute-of-flash-object---works-in-FF%2C-not-IE-tp20949312s27240p20949312.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] change input[type=button] value
Lots of false-positives googling this. input type=button id=a_button value=foo / $('#a_button').attr('value', 'bar'); Doesn't work? Or, am i losing my mind?
[jQuery] change the css into JQuery format( .menu :hover a )
Hi all, I'm a new guy on JQuery, now reading the JQuery in action, and I encounter with one issue: .menu :hover a { ...} anyone who has idea how to change into JQuery format? or is that possible with jquery, will be very appreciate,tks
[jQuery] change image background
Hi, I've write this function: http://dpaste.com/95869/ for change the background image on mouse click My problem is that there are others funcions that can change the background image, and my the function must change the images whatever it is: if there is the image bw-board2.png change with bw-board.png and viceversa. There is a better system for write my function? Thanks, Alfredo
[jQuery] Change number of images shown
This seems like a simple thing to do put I cannot figure out how to do it. I'm implementing the jcarousel scripts but cannot figure out how to chnage the number of display pictures. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups jQuery (English) group. To post to this group, send email to jquery-en@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-en?hl=en -~--~~~~--~~--~--~---
[jQuery] Change overflow of div when element clicked
Hello, I'm fairly new to jQuery and am trying to do the following. I am using a coda slider effect for a website, which is working fine. What I need to do is change the overflow CSS property for a div when another element is clicked. Here's what I have: script type=text/javascript $(document).ready(function(){ $(#test).click(function() $(#faq).css(overflow,auto); }); /script ...snip... div id=navTab ul class=navigation lia href=#homeHome/a/li lia href=#aboutAbout/a/li lia href=#practicePractice Areas/a/li lia href=#faq id=testCommon Questions/a/li li class=stripa href=#contactContact and Directions/ a/li /ul /div ...snip... div class=panel id=faq h1Common Questions/h1 pIntro Paragraph/p div class=accordion h3Do I need a lawyer?/h3 pParagraph 2 content/p /div CSS for #faq has overflow set to hidden. What I want to happen is when people click on the Common Questions link that is changes the overflow property of #faq to auto (overflow:auto). Right now, nothing happens when I click the link. Help is appreciated!
[jQuery] Change text on toggle effect
Hi guys, I've written the below function to change the text on toggle, problem is i want this though i don't want this to be controlled by the JS. currently have 2 spans.. span class=viewView details/span span class=hideHide details/span The 'view' class is visible while the 'hide' class is hidden initially. I would like to show the 'hide' class on toggle and hide the 'view' class. Is that achievable? Here's some code for reference. Cheers C. /// js var showText = View details; var hideText = Hide details; $(.hide).hide(); $(#award_cat .view).click(function() { if($(this).text()==showText) { $(this).text(hideText); } else { $(this).text(showText); } $(this).prev(.more).toggle(slow); return false; }); /// html div id=award_cat div class=more this is blah blah hidden text /div span class=viewView details/spanspan class=hideHide details/ span div class=more this is blah blah hidden text /div span class=viewView details/spanspan class=hideHide details/ span /div
[jQuery] Change the active tab of jquery ui tabs
Hello, I was wondering if it's possible to change the active tab. When you load a page he will always show the first tab as active. Is it possible to change the active tab. For example on the index he shows the first tab as active, thats fine. When i go to users.php he has to show the User tab as active. How can i fixed this? Erwin
[jQuery] change speed of animation during runtime
Hi folks I got an animation that looks somewhat like this: $('#pointer').animate({ left: activeItem.accumulatedWidth + 'px' }, tempo, ' ' , function () {$(this).playShow(times-1)}) now I've added a beautiful ui.slider and want to give the user the possibility to speed up or slow down the animation while it is running has anyone done something similar before? thx sissi
[jQuery] Change code based on link clicked
I'm new to jQuery and JS I want to change a snippet of code based on which link the user clicked. So if the user clicked this link on the page: # click me I would like to hide a particular snippet of code inside a script tag. But I'm not really sure how to write the JS/jQuery Example: script $(#vclick2).click(function(){ if the above link (#vclick2) is clicked hide part of the script }); /script I'm having trouble getting it to work. -- View this message in context: http://www.nabble.com/Change-code-based-on-link-clicked-tp20091922s27240p20091922.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Jquery change event
How do I get jquery's change event you fire per letter typed into a text box? You can use the keyup event. If there are both text boxes and other elements like radio buttons, you could attach the handler to both events: $('input').bind(change keyup, function() { alert('you changed or typed something'); });
[jQuery] Re: Jquery change event
Dave, Thank you that worked great. Is there away to find out what specific element is firing the event. For example I would like to know the 'id' of the element that is currently being type in. Thanks again, Ronn On Sun, Oct 19, 2008 at 12:24 PM, Dave Methvin [EMAIL PROTECTED]wrote: How do I get jquery's change event you fire per letter typed into a text box? You can use the keyup event. If there are both text boxes and other elements like radio buttons, you could attach the handler to both events: $('input').bind(change keyup, function() { alert('you changed or typed something'); });
[jQuery] Re: Jquery change event
Try: $('input').bind(change keyup, function() { alert('you changed or typed something'); alert('Input ID:' + this.id); // or $(this).attr(id) }); On 19 Okt., 21:26, Ronn Ross [EMAIL PROTECTED] wrote: Dave, Thank you that worked great. Is there away to find out what specific element is firing the event. For example I would like to know the 'id' of the element that is currently being type in. Thanks again, Ronn On Sun, Oct 19, 2008 at 12:24 PM, Dave Methvin [EMAIL PROTECTED]wrote: How do I get jquery's change event you fire per letter typed into a text box? You can use the keyup event. If there are both text boxes and other elements like radio buttons, you could attach the handler to both events: $('input').bind(change keyup, function() { alert('you changed or typed something'); });
[jQuery] Jquery change event
How do I get jquery's change event you fire per letter typed into a text box? I'm using the code below, but it only fires when I tab off the textbox. Thanks, Ronn html head script type=text/javascript src=jquery.js/script script type=text/ javascript $(document).ready(function() { $('input').change(function() { alert('you changed something'); }); }); /script / head body input type=text / input type=text / input type=text / / body /html
[jQuery] change filedname from ID in jquery validation plugin
Hi, I am using Jquery plugin for client side validation. But due to a filedname I am facing a problem. Example var validator = $(#UserSignupForm).validate({ rules: { data[User][username]: { required: true, minlength: 2, remote: users.php } }); HTML :input id=id_username1 name=data[User][username] type=text value= maxlength=50 /
[jQuery] change filedname from ID in jquery validation plugin
Hi, I am using Jquery plugin for client side validation. But due to a filedname I am facing a problem. Example var validator = $(#UserSignupForm).validate({ rules: { data[User][username]: { required: true, minlength: 2, remote: users.php } }); HTML :input id=id_username1 name=data[User][username] type=text value= maxlength=50 / When I am using data[User][username] as a filed name in jquery validation, it's not working but in case of other name like username it's working. I think there is problem of [][] (bracket of array). But I can not change data[User][username] so I want to use id_username1 instead of filename in validation plugin but don't know how to use ID ?. Is there any other solution? Also I have to face same problem in many plugins becuase CakePHP return name like data[User][username] so How can I override a name from ID? Please Help me Thanks -- View this message in context: http://www.nabble.com/change-filedname-from-ID-in-jquery-validation-plugin-tp19940820s27240p19940820.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Change mask onclick, how do ?
Hi guys I have the problem when go change de mask, i`m using maskedinput http://digitalbush.com/projects/masked-input-plugin/ my code: input name=tip type=radio id=tip_j title=Jurídica value=J/Jurídicabr input name=tip type=radio id=tip_f title=Física value=F/Física $(#tip_j).click(function(){ $(#masked).val(); $(#masked).mask(999.999.999/-99); }); $(#tip_f).click(function(){ $(#masked).val(); $(#masked).mask(999.999.999-99); }); the mask change, but not function and is a problem..
[jQuery] Change mask onclick, how do it ?
Hi, I have the problem when go change de mask, i`m using maskedinput http://digitalbush.com/projects/masked-input-plugin/ my code: input name=tip type=radio id=tip_j title=Jurídica value=J/ Jurídicabr input name=tip type=radio id=tip_f title=Física value=F/ Física $(#tip_j).click(function(){ $(#masked).val(); $(#masked).mask(999.999.999/-99); }); $(#tip_f).click(function(){ $(#masked).val(); $(#masked).mask(999.999.999-99); }); the mask change, but not function and is a problem..
[jQuery] Change Event Firing Twice
My problem is that I seem to be having a change even firing twice. Here are the details I have several checkboxes (input type=checkbox) all containing a class named metaABOCode. Whenever one is ticked or unticked (hence the change event), I want to grab some data via a json ajax call to populate some content. Everything works brilliantly, except for the fact that it seems as though the code below is being called twice (resulting in two ajax calls, etc.). Any ideas/suggestions as to why this is happening? Feel free to let me know if anything else is of glaringly poor form as well! Thanks a lot; appreciate any help you might be able to provide. The code (and using 1.2.6)... $('.metaABOCode').change(function() { $('#metaDistributorCodeTable tr.metaDynamic').remove(); if (!$(this).is(':checked')) { $('#meta_abocode_all').removeAttr('checked'); } else if ($('.metaABOCode:checked').size() == $ ('.metaABOCode').size()-1) { $('#meta_abocode_all').attr('checked','true'); } var str = ''; $('input.metaABOCode:checked').each(function() { if ($(this).attr('id').substring(13) != 'all') { str += $(this).attr('id').substring(13) + -; } }); jQuery.getJSON('/cms/page/meta/distributorcode/' + str, function(json) { var html = ''; html += 'tr class=metaDynamic'; html += 'tdinput id=meta_distributor_all class=metaDistributorCode clickable type=checkbox //td'; html += 'tdspan style=font-weight:bold;Select All/span/ td'; html += '/tr'; for (var i=0; ijson.length; i++) { html += 'tr class=metaDynamic'; html += 'tdinput id=meta_distributorcode_' + json[i] ['sp_code'] + ' class=metaDistributorCode clickable type=checkbox //td'; html += 'td' + json[i]['sp_name'] + '/td'; html += '/tr'; } $('#metaDistributorCodeTable').append(html); }); });
[jQuery] Change link dependant on select box.
Hello Guys, I'm looking for some help on getting started with a script that'll change the href attribute of a link dependant on the option selected in a select box. To add a little 'spice' the challenge the value of the href must be determined from a set of key value pairs. Let me try and offer an example. I have a select box like this: select name=customer id=customer option value=1Joe Bloggs/option option value=2Dave Something/option /select And the link which I want to change dependant on the selection looks something like this: a href=/view_customer_company.cfm?company_id=6View Customers Company/a I've highlighted the bits in red which I wish to make dynamic dependant on the option chosen in the select box. Where I've put 'customers' I want to dynamically change to the option text, such as 'Joe Bloggs' or 'Dave Something' and the company_id value I need to pull from a key/value set using the option value as the key, such as 1 or 2. The key/value pairs look something like this: Key:value 1: 50ccdae0-79bf-11dd-ad8b-0800200c9a66 2: 9c335820-d878-4db3-b90a-728046cb8849 So, as a quick summation of the expected results, If I select 'Joe Bloggs' in my select list, I want the link to be changed to: a href=/view_customer_company.cfm?company_id=50ccdae0-79bf-11dd-ad8b-0800200c 9a66View Joe Bloggs Company/a And likewise, if I chose 'Dave Something' in the select list the link would look like this: a href=/view_customer_company.cfm?company_id=9c335820-d878-4db3-b90a-728046cb 8849View Dave Something Company/a I'm really a novice with both JavaScript and jQuery for the moment, I'm learning well but this is a little bit beyond me, especially when you're looking at working with the key/value paris. I appreciate any help you can offer and thanks in advance for your time. Robert
[jQuery] Change event for hidden form field
I'm modifying the value of a hidden input field from a popup window. I thought it would be a simple thing to bind a change event on this field so that when it's value changed, something else would happen. This doesn't seem to work. Am I doing something wrong, or am I misunderstanding what I need to do? Or is there another way to do this, one that's better? In essence, this is what I'm doing. 1) Open a new window 2) In this new window, click a link which corresponds to an image 3) In the new window, get the filename of the selected image; pass it back to a specified hidden input field in the parent window. 4) When the hidden input field's value changes, fire an event/function which changes the src attribute of an img tag to match the value of the hidden form field. Any ideas? The value of the input field updates properly, but it just doesn't fire the change handler. Andy Matthews Senior ColdFusion Developer Office: 615.627.9747 Fax: 615.467.6249 www.dealerskins.com http://www.dealerskins.com/ Total customer satisfaction is my number 1 priority! If you are not completely satisfied with the service I have provided, please let me know right away so I can correct the problem, or notify my manager Aaron West at [EMAIL PROTECTED] 2008 Email NADA.jpg
[jQuery] change event without losing focus
Hi, I want to have a simple event that notifies me whenever some input type=text / gets changed its content. But I can not use change() because it only fires when the input changes and the input loses focus. The event I would like would be an mixture of keydown, keypress, paste, ... events. Do you guys know an easy way to have an event that fires when an input changes content without the need of losing focus? Eduardo
[jQuery] change innerHTML
In my html, I have the following span to show upload percentage: span id=progressBarText0%/span I tried to update the percentage using the following javascript: $(#progressBarText).innerHTML = 76%; But it does not work. :( Thanks. Arden
[jQuery] Can jquery change the period in an OL to a hypen?
So the title says it all pretty much. I have a design and I need to have some running numbers along the side of a list. An ol would be perfect and it is rendering: 1998. Item 1 1999. Item 2 To match the designs I need it to be: 1998 - Item 1 1999 - Item 2 I could just make a table but it would be cooler if I could change it somehow. I have spent an hour or so looking around and there does not seem to be a CSS/HTML way. Cheers.
[jQuery] Re: Can jquery change the period in an OL to a hypen?
Try this: $(document).ready(function() { $('ol li').each(function() { $(this).html($(this).html().replace('/\./', ' -')); }); }); What this does is go through all li elements of all ol lists and perform a String.replace() on the existing content ($(this).html()) and replace the existing content with the result. The regex replaces the first period with a space, followed by a hyphen. To replace all periods, use the g modifier (/\./g), or you could be more specific for your example by requiring the year (/^([0-9]{4})\./ - I know this only matches 4 digit numbers, so doesn't validate years, but this is just an example!) EricC-3 wrote: So the title says it all pretty much. I have a design and I need to have some running numbers along the side of a list. An ol would be perfect and it is rendering: 1998. Item 1 1999. Item 2 To match the designs I need it to be: 1998 - Item 1 1999 - Item 2 I could just make a table but it would be cooler if I could change it somehow. I have spent an hour or so looking around and there does not seem to be a CSS/HTML way. Cheers. -- View this message in context: http://www.nabble.com/Can-jquery-change-the-period-in-an-OL-to-a-hypen--tp17290680s27240p17292847.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Can jquery change the period in an OL to a hypen?
Thank you so much for this example. It works quite well on the content of the li but it does not modify the behavior of the ol meaning that period stays. Ah well I thought it was a long shot, I guess I am going with a table, lol.
[jQuery] Re: Can jquery change the period in an OL to a hypen?
Hi Eric, Another way you could go about this is to continue using the ol but hide the numbers through CSS: ol { list-style: none; } Then you could prepend the number with the hyphen to each li Inside a document ready, you could do something like this (untested): $('li').each(function(index) { $(this).prepend( (index+1998) + ' - '); }); --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On May 17, 2008, at 2:00 PM, EricC wrote: Thank you so much for this example. It works quite well on the content of the li but it does not modify the behavior of the ol meaning that period stays. Ah well I thought it was a long shot, I guess I am going with a table, lol.
[jQuery] change title of the dialog by setData
How do I change dialog title after it was created? I try to do $('#dlg').data('title', 'new title') or $('#dlg').data('dialog.title', 'new title') but its not working the only way I get run the setData event is using .data('setData.dialog', 'something in here') but then key for a function is setData. any ideas? I'm using jquery-1.2.3 and ui - 1.5b2 thanks
[jQuery] change expand collapse image (swap images)
I am using $(#details).slideToggle(slow); for toggling a grid data. for the same i need to show + and - symbols for expand and collapse ( using images). Can anybody help me out with this.So that image also swaps according to the expand or collapsed state. How to achive this? Thanks in advance
[jQuery] jquery change image based on server side data
I have a NEW image that displays at the top of the page, if there is new data. I had two loops(server side) on the page looping through data; the first time to see if there was something new, and then the second time to display the data. To improve performance I was hoping to delete the first loop, and set the NEW image to display:none. Then on the data loop set some flag to pass to the client to go back up the DOM(Jquery) and turn the NEW image back to display:block. Obviously, there is no event like click or mouseover, only the onload. I am thinking maybe check if a variable is defined somehow in the ready function? I am not sure how to do this. Any help is appreciated. Jared
[jQuery] change in the slide panel movement
Dear all, I am working on slide panel as in http://www.webdesignerwall.com/demo/jquery/simple-slide-panel.html what i need to do is a reversed movement, instead of on clicking the div is pulled down, on clicking the div is pulled up Please advice me what do i need to do. Thanks in advance.
[jQuery] change image src not working in IE6
group, i just ran across an issue in IE6, that works in both Safari and Firefox. I am simply trying to change the source of an image using: $('img#tab2').attr(src,/b_tab2_on.png); img id=tab2 src=/b_tab2_off.png border=0 alt=colors/ I've noticed that in IE, the object is found but the attr array is empty. Has anyone else run across this before in IE? I can't post the page, perhaps an example, but wanted to ping the group to see if anyone has come across this, seems pretty simple. thanks, -- mike
[jQuery] Change stylesheets if images are off
I finally finished it // detect whether images are on // and change styles accordingly jQuery.imagesOn = function(){ $('img src=' + '/images/bgimage.jpg' + '#' + Math.random() + '/ ' ).load(function() { $('#noimages').attr(href, '/styles/gotimages.css'); $('.imagecheck').html('On'); }); if ( $('.imagecheck').val() != 'On' ) { $('#noimages').attr(href, '/styles/imagefree.css'); } } (hack: there is a hidden paragraph to hold the 'variable') Cherry http://jquery.cherryaustin.com
[jQuery] change on select not working
$(select).change(function(){ alert(Selected: + this.value); }); Is there any reason why this wouldn't be working on all the selects on my page. I create the selects dynamically, but this is up in the $ (document).ready(function() { block of my code.
[jQuery] change error message
hi all, im using this approach in validation class=required on the element form action= method=POST id=formEdit input class=required type=text name=name input type=submit name=clicker value=click /form script $(document).ready(function(){ $(#formEdit).validate(); }); /script it works well but i want to change the text of error message any help ?
[jQuery] Change Jeditable trigger
Hi there, Imagine i have a DIV with editable content (with Jeditable), but i want the trigger for that to be a link behind the div. It´s probably very simple, but i´m pretty new to jQuery and do not know how to achieve this. It has to look somewhat like this; div class=edit id=unique_idEditable text/div a href=#Edit me!!/a Any help will be greatly appreciated! Frizzle.
[jQuery] Change messages in Jörn's validator plugin
Hello, I am experimenting with the validator plugin from Jörn. I found an example where you can pass custom messages to the validator. I was wondering now if it is possible to define new default messages, so that I don't have to specify them for each validator. I tried this : $.validator.setDefaults({ messages: { required: new message } }); But, that doesn't seem to work. Can someone help me? Thank you. -- View this message in context: http://www.nabble.com/Change-messages-in-J%C3%B6rn%27s-validator-plugin-tp14250674s27240p14250674.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Change div
Hey, I'm wanting to change a div to another one onclick and then back again when its clicked again. I've managed to get it to change the div on the first click but clicking it again doesn't do anything. Here is the HTML div id=maximize onClick=onMaximize()/div div id=restore onClick=onRestore()/div and the jquery code $(document).ready(function(){ $('#maximize').click(function () { $(this).replaceWith(div id=\restore\ onClick=\onRestore() \/div); }); $('#restore').click(function () { $(this).replaceWith(div id=\maximize\ onClick=\onMaximize() \/div); }); }); As you can see there is also an onclick event on the div which works and the div changed from the maxi to the restore, but it doesn't work back nor does the onClick event onRestore button work What I'm trying to do is work on an AIR application with a custom chrome, I've got the chrome all built and everything else is working how I want except for the Maximize/Restore button I want it to change to restore when maximized is clicked and then change back to maximized when restore is clicked. I have tried searching but I haven't found anything that I want specifically to do and I don't know jquery all that well at all so I can't really change anything to what I want (but not for lack of trying, this is the closes I've gotten)
[jQuery] change the attribute value, when button is clicked
It is not working... I am not sure what should I do html head script type=text/javascript src=jquery.js/script script type=text/javascript charset=utf-8 $(document).ready(function(){ $('#link1').click(function(){ alert('yo'); $('#test_form').attr('action', 'there'); }); }); /script /head body form id=test_form action=here input type=button name=link value=button id=link1/ /form /body /html
[jQuery] Change CSSClass
Hello, I have an anchor. I want to change its CSS class and also disable the clicking when it is clicked. Can I do this with JQuery? Thanks, Miguel
[jQuery] change css relative to css file
I have this: $('#id').click( function(){ $(this).css('background-image','url(images/ img.jpg)'); } ); Problem is that I want to use a path (images/img.jpg) that is relative to my CSS file, not to the current page... The obvious first question will be why not just put /path/to/images? The answer is I'm trying to incorporate something into a drupal module and so I cannot be certain of what the full path will be. Thoughts? Alex
[jQuery] Change background based of time of day using jquery
I'm curious if I could use jquery to change my body's background based on time of day. I'm not looking to do this server-side with php, I would like the background to change based on the visitor's time, not the server's. I've found this code, just wondering if I can jquery-ize: script var now = new Date(); var hours = now.getHours(); var psj=0; //18-19 night if (hours 17 hours 20){ document.write('body bgcolor=orange text=#FF') } //20-21 night if (hours 19 hours 22){ document.write('body bgcolor=orangered text=#FF') } //22-4 night if (hours 21 || hours 5){ document.write('body bgcolor=black text=#FF') } //9-17 day if (hours 8 hours 18){ document.write('body bgcolor=deepskyblue text=#FF') } //7-8 day if (hours 6 hours 9){ document.write('body bgcolor=skyblue text=#FF') } //5-6 day if (hours 4 hours 7){ document.write('body bgcolor=steelblue text=#FF') } /script
[jQuery] .change() and IE bug
does .change not work it IE becauseI have this 310 destination.load('/lib/ajax/price_buster.php', {'get': 'destination'}); 311 destination.change(function() 312 { 313 reset_data(0); 314 var destination_var = $('[EMAIL PROTECTED]'); 315 316 nights.load('/lib/ajax/price_buster.php', {'get': 'nights', 317 'destination': destination_var.val()}); 318 nights_tr.show(); 319 }); And the first .load work but the second one does not load and the only thing i can think of is that IE does not like .change. -- View this message in context: http://www.nabble.com/.change%28%29-and-IE-bug-tf4298714s15494.html#a12235362 Sent from the JQuery mailing list archive at Nabble.com.