Re: [jQuery] Need jQuery expert to slightly modify plugin
http://groups.google.com/group/jquery-en/browse_thread/thread/f550b94914d10065 On 04/01/2010 15:12, MikeTheVike wrote: I'm using the newest version of jQuery(http://www.jquery.com) and the jCarousel Lite plugin (http://www.gmarwaha.com/jquery/jcarousellite/). It is a content slider that rotates content slides. It is setup to auto rotate on a set time, and you can also hit the previous/next buttons to move through the slides. This has been working great. Now I have the need for a pause button that will stop the auto rotate. I think this should be fairly easy for someone familiar with javascript and jQuery. Please email me at mike (at) moxiedisplays (dot) com. This is a paid job if we can find someone to do it correctly and in a timely manner. Thanks!
Re: [jQuery] Re: slideDown trouble in Safari/Chrome
On 04/01/2010 15:35, Paul Hutson wrote: Any ideas? Many thanks in advance. Without looking into it too much I can't see the cause of the problem... ... however, site design wise, would it not be better to have the buttons expand an area on the page to show the information? You could have the divs all created prior to the page loading (much like you do now [as a side note here, hiding the divs in the definition would be a good idea as when it loads up slowly it shows them before hiding them]) then just using the $(#divid).show(slow); when clicking on them (and hiding the currently open one). I know that isn't exactly the answer you were looking for - but it should help out. For reference, you can change CSS type properties directly with a call like this : document.getElementById(NAMEOFDIV).style.width = 10; I can't remember how to do it in a more jquery like way at the moment. HTHs, Paul Hutson that would be $(#NAMEOFDIV).width('10');
Re: [jQuery] Attempting to hide a div using jquery but div displays for a split second and then disappears
This should help you http://www.learningjquery.com/2008/10/1-way-to-avoid-the-flash-of-unstyled-content Newbie wrote: I am working on an accordian side navigation jquery piece and I am unable to get it to operate exactly how I want. The menu was originally designed by Roshan Bhattarai and can be viewed at http://roshanbh.com.np/2008/06/accordion-menu-using-jquery.html The original design does not degrade well since the div containing the drop down menu information is set to display:none using CSS- but another forum poster suggested that the css selector be removed and the hiding function be set in the jquery. This is the code that was added to perform this function: $(div.menu_body).hide(); The code works to some extent, however the div does appear on the page for a split second on refresh or on page load and then diseappears. I am thinking I either did something wrong, am missing something, or could put that bit of code somewhere else in the script for the div to truly be hidden until the visible header is clicked. The whole point of adding this code is so the accordian menu degrades gracefully- if there is another way for the entire menu to be viewable with javascript turned off, please detail the steps. I have downloaded the newest version of jquery. Here is the entire script for the menu. script type=text/javascript language=javascript src=/javascript/ jquery.js/script script type=text/javascript !--//-+ // Developed by Roshan Bhattarai // Visit http://roshanbh.com.np for this script and more. // This notice MUST stay intact for legal use // - $(document).ready(function() {$(div.menu_body).hide(); //slides the element with class menu_body when paragraph with class menu_head is clicked $(#firstpane p.menu_head).click(function() { $(this).css({backgroundImage:url(down.png)}).next (div.menu_body).slideToggle(300).siblings(div.menu_body).slideUp (slow); $(this).siblings().css({backgroundImage:url(left.png)}); }); //slides the element with class menu_body when mouse is over the paragraph $(#secondpane p.menu_head).mouseover(function() { $(this).css({backgroundImage:url(down.png)}).next (div.menu_body).slideDown(500).siblings(div.menu_body).slideUp (slow); $(this).siblings().css({backgroundImage:url(left.png)}); }); }); /script The site is on a private server behind a firewall so I cannot share the site but I can provide as much information as possible to solve this issue. An example of that preload or flashing upon refresh of the page with this type of code is viewable on this website: http://docs.jquery.com/Effects/hide - If you view the demo where it stated Click to hide me too and continue to watch that line will refreshing the page, you will see the hidden information for a split second and then it will hide. I am wondering and trying to find a way to prevent that flash of hidden information to be viewable at all.
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] Re: Change all CSS background images url
I know it's possible, but it's a really poor way to do this as it will break the cache. You should do it with server side code then, can you not edit the html helper of cakePHP to add the sub directory for you? nomen wrote: Hi: Liam: My client needs to have the posibility to change itself the image path and he is not a programmer, The maximun complication should be to change a text by another text. Anyway I know it is a posibility and I have it in mind. Michel: I try to use the base tag but I´m using CakePHP and it automatically puts in the links generathed by the HTML helper, the subdirectory name. So it does not work correctly with those links because the created links should be www.domain.com/subdir/subdir/img/ one.jpg. Thank you anyway for your help. On 16 nov, 18:03, Michel Belleville michel.bellevi...@gmail.com wrote: 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] Re: password initial value without masking ****
Here is how I do it. Just markup the form like normal (I use a definition list to lay out my forms) $(input:password).each(function(){ var $currentPass = $(this) $currentPass.css({opacity:0}); $currentPass.before('input type=text value=Password class=removeit style=position:absolute;z-index:10; /'); var $visiblePassword = $(.removeit); $visiblePassword.focus(function () { $(this).css({opacity:0}); $currentPass.focus().css({opacity:1}); }); $currentPass.blur( function () { if ( $currentPass.attr(value) == ){ $currentPass.css({opacity:0}); $visiblePassword.css({opacity:1}).attr(value,Password); } }); }); waseem sabjee wrote: ah yes i forgot. you would get access denied when tried to change an input type property the best way is to have two input types and just hide one and show the other but i have a solution for you the html !-- The following html of two input types - we gonna switch between them-- input type=text class=textinput value=Passowrd / input type=password class=passinput value= / the css style type=text/css /*first we need to hide the password input*/ .passinput { display:none; } /style the js script type=text/javascript $(function() { // declare your input types var textinput = $(.textinput); var passinput = $(.passinput); // on text input focus - hide text input and show and focus on password input textinput.focus() { textinput.blur(); textinput.hide(); passinput.show(); passinput.focus(); }); // on password input blud hide password input and show and focus on text input passinput.blur(function() { passinput.blur(); passinput.hide(); textinput.show(); textinput.focus(); }); }); /script On Mon, Oct 19, 2009 at 2:51 PM, Marco Barbosa marco.barbos...@gmail.com mailto:marco.barbos...@gmail.com wrote: Hi waseem! Thanks for your reply. Something's wrong with this line: $(#password).attr({type:'text'}); I tried changing to: $(#password).attr('type','text'}); but still no go. I have to comment out to get the other JS stuff on the site working. The rest of the code seems Ok. What could it be? I like your solution, pretty simple :) I was wondering if we could put this inside the cleanField function but I guess it's not necessary. ~Marco On Oct 19, 2:32 pm, waseem sabjee waseemsab...@gmail.com mailto:waseemsab...@gmail.com wrote: // set the initial type to text $(.mypasswordfield).attr({ type:'text' }); // on user focus - change type to password $(.mypasswordfield).focus(function() { $(.mypasswordfield).attr({ type:'password' }); }); // on user blur - change type to back to text $(.mypasswordfield).blur(function() { $(.mypasswordfield).attr({ type:'text' }); }); since text is an attribute we can change it. all im doing is changing the type between password and text on click and on blur let me know if this worked for you :) On Mon, Oct 19, 2009 at 11:21 AM, Marco Barbosa marco.barbos...@gmail.com mailto:marco.barbos...@gmail.comwrote: Hi! I'm trying to achieve something like the Facebook first page (when you're not logged in). I'm using this simple function/plugin to clean the fields once you click them: $.fn.cleanField = function() { return this.focus(function() { if( this.value == this.defaultValue ) { this.value = ; } }).blur(function() { if( !this.value.length ) { this.value = this.defaultValue; } }); }; // clean the fields $(#login).cleanField(); $(#password).cleanField(); So If I click Login or Password, it will clean and the user can type the new value. It works good but there's a little usability problem here. I want to display the Password field like: Your password here instead of *** But when the user types his/her password, it has to go back to So Initially it should be: Your login Your Password And when the user clicks and starts typing it goes: My login *** It's
[jQuery] Re: What is the more correct/efficient selector?
use the second one, avoid problems from having multiple selects on the page. Mike wrote: $(select).change(function() { alert($(select option:selected).val()); }); OR $(select).change(function() { alert($(this).attr(value)); }); I am specifically looking at the selector used in the alert. From my testing the result in the same correct values to be displayed.
[jQuery] Re: Don't use onclick
Rob, keeping all JS outside of the HTML is a good practice, and keeps everything nice and easy to maintain. Jonathan Vanherpe (T T NV) wrote: RobG wrote: On Oct 13, 1:34 pm, expressodschin...@gmail.com wrote: I don't think it's too hyped. Having calls to javascript in your elements defeats the purpose of unobtrusively maintaining and using libraries like jQuery. The mechanism frequently used to attach such listeners is to add a class, id, name or some other attribute value designed to make the element identifiable specifically to add a listener. How is: div class=mySpecialClass ... hugely different to: div onclick=mySpecialListener() ... when both attributes can be added using exactly the same server logic, static template or whatever? The only difference is that in the first case, the client must do extra work to attach listeners that could have been added on the server directly. Consider also that in the second case, you don't care about a document ready or load event, or whether the user must wait for elements to be enlivened while other content loads. Not hip, not cool or funky, but very robust and avoids a bunch of issues. Adding listeners at the client simply because the chosen development library supports it is not a particularly convincing argument. -- Rob For one, you're usually using that class to style something too (a class=required can be used for validation and for styling the input differently to show the user it's a required field), so you use essentially the same markup to hook in both your presentational layer and your behavioural layer. I've rarely used onclick after discovering the unobtrusive way of doing js, it's easier to maintain and your code looks cleaner. Jonathan
[jQuery] Re: Ideas how to build?
simplest way is to .toggle() a div with those options in it. how much you expand upon that is up to you. Dave Maharaj :: WidePixels.com wrote: I came across this select / checkbox setup at http://monster.ca/ for job search and was wondering if anyone has seen some thing like this jquery related? Not the drop/slide down. But when you click on the select input it shows a checkbox list instead of normal select options Thanks, Dave
[jQuery] Re: How to add some string in attributes?
$(function(){ $(img).hover( function(){ src = $(this).attr(src); var newSrc = src.replace(/.png/, -hover.png); $(this).attr(src,newSrc); }, function(){ var newSrc = src.replace(/-hover.png/, .png); $(this).attr(src,src); } ); }); This is untested and certainly not the best way to do this (like I said earlier). You should be using CSS for image rollovers. Teddy wrote: I mean not like that... I mean what ever the src value I want to add hover when it hover and when mouse out I want delete that hover.. img alt=My Account src=/images/whatever.png/ and when hover that image I want became like this img alt=My Account src=/images/whatever-hover.png/ and when mouse out that image became img alt=My Account src=/images/whatever.png/ On Sep 28, 9:38 pm, Liam Potter radioactiv...@gmail.com wrote: $(function(){ $(img).bind(mouseover,function(){ $(this).attr(src,/images/menu-my-account-hover.png); }); }); but this is the worst way you can do rollovers. You should be doing this in pure CSS, and the best way would be to use an image sprite. Teddy Hong wrote: If I have a tag image like this.. img alt=My Account src=/images/menu-my-account.png/ and when hover that image I want became like this img alt=My Account src=/images/menu-my-account-hover.png/ How to code this with jquery? Thanks
[jQuery] Re: MooTools and jQuery
is there a reason you need both libraries? Dennis Madsen wrote: I'm developing a site in Joomla CMS which use both MooTools and jQuery. I've created a small, clean page where you can see the problem: http://www.dennismadsen.com/uploads/mootools_jquery/ You can download the source-code from this URL: http://www.dennismadsen.com/uploads/mootools_jquery/mootools_jquery.zip When you run the code, you'll see an error in Firefox Error Console: jqModal.js line 40. Can you help me figuring out how to run this jQuery extension when Mootools is active?
[jQuery] Re: Binding a unique single and double click command
in the double click function you'd have to clearTimeout on the first function otherwise it will run anyways. readysalted wrote: I'd use this approach - var clicks = 0; $('.todo_item h2').live('click', function() { // count the click click++; // only set the timeout if the first click to prevent multiple firing if( click == 1) setTimeout( doTheAction(), 300); }); function doTheAction() { if(click == 1) editInPlace(); if(click == 2) showExtra(); // reset click click = 0; } so you will only do something after the timeout fires, and you count the clicks. If the user clicks a 2nd time before the timeout fires you'll get the 2nd action. If not, you get the first. NB: not tested, just an idea. Test it hard to make sure you don't create lots of timeouts and crash the browser :) On Sep 29, 3:41 pm, Sam samueljhart...@gmail.com wrote: I'm trying to write some jQuery to do the following: If a user clicks once on an object, do X. If a user clicks twice on an object, do Y, but not X. I've been having some trouble with this as, obviously, a double-click will trigger the single-click twice. Here is a failed attempt: $('.todo_item h2').live('click', function() { var startTime = new Date(); $(this).mousedown(function() { var endTime = new Date(); if (Math.abs(endTime - startTime) 300) { editInPlace } else { showExtra } }); }); where editInPlace and showExtra are some functions I have defined elsewhere in the document. This method, however, relies on a second click, or mousedown at least, to work, which fails if the user only clicks once. I have also looked into setTimeout but without any fruitful results. Anyone have any suggestions on how to code thsi?
[jQuery] Re: remove accordion item
$(this).parents(div.accordion).fadeOut('slow').remove(); where div.accordion is what you're trying to remove. Hundredth Monkey wrote: hi, i want to realize a delete button or link within an accordion item. is it possible to remove a special item or make the header disabled after a link click within the accordion item content? so far i' ve tried $(this).parent().fadeOut('slow'); but this kills all item contents :O( best regards.
[jQuery] Re: jQuery plugin that can do the image effects here?
Good old Ken Burns effect, always looks good. I've used the cross-slide plugin before, and will definitely do what you want. Charlie Griefer wrote: Hi Michael: Would this do? http://www.gruppo4.com/~tobia/cross-slide.shtml http://www.gruppo4.com/%7Etobia/cross-slide.shtml On Wed, Sep 30, 2009 at 5:48 AM, Michael Price m...@edwardrobertson.co.uk mailto:m...@edwardrobertson.co.uk wrote: ‘lo all, Boss has been asking me if we can replicate the image fader here: http://www.gleneagles.com/home.aspx Note how it pans and slides as well as fading between images – this one is done in Flash. We often use the Cycle plugin for a fade-between set of images but is there a plugin to do something like the above, or can the Cycle plugin be made to do it? Regards, Michael Price -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] Re: Deactivating parent link with JQuery
$(li a).click(function(){ $(this).parents(ul).parents(li).addClass(className); }); osu wrote: Hi Ryan, That only affects the child of the parent. What I want to do is this: ul liLink 1/li liLink 2 *This is the link I want to add a class to* ul liLink 2a/li liLink 2b/li *This is the active link* liLink 2c/li /ul /li liLink 3/li /ul Rather than affecting a descendent/child of the parent link, I need to work on the *parent link* under which the active link is found. Any ideas? Thanks, osu On Sep 26, 7:48 pm, ryan.j ryan.joyce...@googlemail.com wrote: $('.nav-selected:first') On Sep 26, 5:36 pm, osu onesiz...@googlemail.com wrote: Can anyone help with this one please? Thanks, osu On Sep 25, 2:03 pm, osu onesiz...@googlemail.com wrote: Thanks Ryan for the alternative, However, I need to do the following now (see message above your last post): I need to highlight *only* the top-parentitem (the same one I just ran 'return false;' on) with the class 'nav-selected'. Any idea how I could do that? Thanks, osu On Sep 25, 11:13 am, ryan.j ryan.joyce...@googlemail.com wrote: rather than removing the href you could use the preventDefault function, which will leave the href intact should you want to unbind it at a later date. usage is something like.. $('a.submit-button').click(function(e){ e.preventDefault(); doSubmit( $(this).html() ); }) On Sep 24, 5:32 pm, osu onesiz...@googlemail.com wrote: Thanks Andi, Yes, I meant an unordered list as you showed. Rather than remove the a tag, is it possible to just 'deactivate' it? i.e. when you click it, nothing happens, but the a tag stays in place? I ask, because I'd like to keep the CSS as simple as possible. Thanks, osu On Sep 24, 6:05 pm, Andi23 dowhatyouw...@gmail.com wrote: First of all, let's clarify the actual HTML. I assume this is what you have: ul lia href=#Link 1/a/li lia href=#Link 2/a/li lia href=#Link 3/a ul lia href=#Link 3a/a/li lia href=#Link 3b/a/li lia href=#Link 3c/a/li /ul /li lia href=#Link 4/a/li /ul When you say remove the link, I assume you want to turn this: lia href=#Link 3/a into this: liLink 3 Given that, try this jQuery: $(li ul).siblings(a).each(function(){ $(this).replaceWith($(this).html()); });
[jQuery] Re: Deactivating parent link with JQuery
I'm assuming you posted an example list and the real list does contain a tags? I'm also assuming you are running that script with a document ready handler? osu wrote: Thanks Liam, but that's not working... Not sure why .click is in your example? Am I right in thinking by adding .parents to the end of each tag in your example that you're 'going down' different levels in the unordered list? This is what I have: $(li a).click(function(){ $(this).parents(ul).parents(li).addClass(nav-selected); }); Any ideas what's going wrong? On Sep 29, 10:29 am, Liam Potter radioactiv...@gmail.com wrote: $(li a).click(function(){ $(this).parents(ul).parents(li).addClass(className); }); osu wrote: Hi Ryan, That only affects the child of theparent. What I want to do is this: ul liLink 1/li liLink 2 *This is the link I want to add a class to* ul liLink 2a/li liLink 2b/li *This is the active link* liLink 2c/li /ul /li liLink 3/li /ul Rather than affecting a descendent/child of theparentlink, I need to work on the *parentlink* under which the active link is found. Any ideas? Thanks, osu On Sep 26, 7:48 pm, ryan.j ryan.joyce...@googlemail.com wrote: $('.nav-selected:first') On Sep 26, 5:36 pm, osu onesiz...@googlemail.com wrote: Can anyone help with this one please? Thanks, osu On Sep 25, 2:03 pm, osu onesiz...@googlemail.com wrote: Thanks Ryan for the alternative, However, I need to do the following now (see message above your last post): I need to highlight *only* the top-parentitem (the same one I just ran 'return false;' on) with the class 'nav-selected'. Any idea how I could do that? Thanks, osu On Sep 25, 11:13 am, ryan.j ryan.joyce...@googlemail.com wrote: rather than removing the href you could use the preventDefault function, which will leave the href intact should you want to unbind it at a later date. usage is something like.. $('a.submit-button').click(function(e){ e.preventDefault(); doSubmit( $(this).html() ); }) On Sep 24, 5:32 pm, osu onesiz...@googlemail.com wrote: Thanks Andi, Yes, I meant an unordered list as you showed. Rather than remove the a tag, is it possible to just 'deactivate' it? i.e. when you click it, nothing happens, but the a tag stays in place? I ask, because I'd like to keep the CSS as simple as possible. Thanks, osu On Sep 24, 6:05 pm, Andi23 dowhatyouw...@gmail.com wrote: First of all, let's clarify the actual HTML. I assume this is what you have: ul lia href=#Link 1/a/li lia href=#Link 2/a/li lia href=#Link 3/a ul lia href=#Link 3a/a/li lia href=#Link 3b/a/li lia href=#Link 3c/a/li /ul /li lia href=#Link 4/a/li /ul When you say remove the link, I assume you want to turn this: lia href=#Link 3/a into this: liLink 3 Given that, try this jQuery: $(li ul).siblings(a).each(function(){ $(this).replaceWith($(this).html()); });
[jQuery] Re: Deactivating parent link with JQuery
It all works fine, except for this bit $(li ul).siblings(a).click(function(){ return false; }); there are no a tag siblings of the UL, so that will not work. I've just tested it, and when I click on a subnav link, the class is added to the LI containing Link 3, if you need it to be added to the a tag use this $(li a).click(function(){ $(this).parents(ul).parents(li).children(a).addClass(nav-selected); }); osu wrote: Hi Liam, This is the list I'm working with: ul li class=nav-path-selecteda href=#Link 1/a/li lia href=#Link 2/a/li li class=nav-path-selecteda href=#Link 3/a ul lia href=# class=nav-selectedLink 3a/a/li lia href=#Link 3b/a/li lia href=#Link 3c/a/li /ul /li lia href=#Link 4/a/li /ul I need to add the class 'nav-selected' to Link 3 so I can highlight it using the same CSS as used to style Link 3a (the active link in the example above). As you can see, Link 1 has a class of 'nav-path- selected', so I need to differentiate between that and Link 3 (hence why I want to add a 'nav-selected' class to Link 3) The JQuery I've added to the footer of my page is: script type=text/javascript //![CDATA[ $(document).ready(function() { // Disabled parent link $(li ul).siblings(a).click(function(){ return false; }); $(li a).click(function(){ $(this).parents(ul).parents(li).addClass(nav-selected); }); }); //]] /script But nothing is happening...no JS errors in Firebug either - any ideas? Thanks for your patience, osu On Sep 29, 11:07 am, Liam Potter radioactiv...@gmail.com wrote: I'm assuming you posted an example list and the real list does contain a tags? I'm also assuming you are running that script with a document ready handler? osu wrote: Thanks Liam, but that's not working... Not sure why .click is in your example? Am I right in thinking by adding .parents to the end of each tag in your example that you're 'going down' different levels in the unordered list? This is what I have: $(li a).click(function(){ $(this).parents(ul).parents(li).addClass(nav-selected); }); Any ideas what's going wrong? On Sep 29, 10:29 am, Liam Potter radioactiv...@gmail.com wrote: $(li a).click(function(){ $(this).parents(ul).parents(li).addClass(className); }); osu wrote: Hi Ryan, That only affects the child of theparent. What I want to do is this: ul liLink 1/li liLink 2 *This is the link I want to add a class to* ul liLink 2a/li liLink 2b/li *This is the active link* liLink 2c/li /ul /li liLink 3/li /ul Rather than affecting a descendent/child of theparentlink, I need to work on the *parentlink* under which the active link is found. Any ideas? Thanks, osu On Sep 26, 7:48 pm, ryan.j ryan.joyce...@googlemail.com wrote: $('.nav-selected:first') On Sep 26, 5:36 pm, osu onesiz...@googlemail.com wrote: Can anyone help with this one please? Thanks, osu On Sep 25, 2:03 pm, osu onesiz...@googlemail.com wrote: Thanks Ryan for the alternative, However, I need to do the following now (see message above your last post): I need to highlight *only* the top-parentitem (the same one I just ran 'return false;' on) with the class 'nav-selected'. Any idea how I could do that? Thanks, osu On Sep 25, 11:13 am, ryan.j ryan.joyce...@googlemail.com wrote: rather than removing the href you could use the preventDefault function, which will leave the href intact should you want to unbind it at a later date. usage is something like.. $('a.submit-button').click(function(e){ e.preventDefault(); doSubmit( $(this).html() ); }) On Sep 24, 5:32 pm, osu onesiz...@googlemail.com wrote: Thanks Andi, Yes, I meant an unordered list as you showed. Rather than remove the a tag, is it possible to just 'deactivate' it? i.e. when you click it, nothing happens, but the a tag stays in place? I ask, because I'd like to keep the CSS as simple as possible. Thanks, osu On Sep 24, 6:05 pm, Andi23 dowhatyouw...@gmail.com wrote: First of all, let's clarify the actual HTML. I assume this is what you have: ul lia href=#Link 1/a/li lia href=#Link 2/a/li lia href
[jQuery] Re: Deactivating parent link with JQuery
oh I see, this would be better done with some server side code but this is how you could do that. Similar code, just checking for a class. $(li a.nav-selected).each(function(){ $(this).parents(ul).parents(li).children(a).addClass(nav-selected); }); osu wrote: Hi Liam, Thanks, I think I didn't make myself clear enough - rather than occurring when you click the link, I need the class to stay in place whenever a child link (i.e. Link 3a, 3b or 3c) is active. I can see the class is being applied on click, but how would I make the class stay in place? Like this didn't work: $(li a).ready(function(){ $(this).parents(ul).parents(li).addClass(nav-selected); }); Thanks, osu On Sep 29, 11:35 am, Liam Potter radioactiv...@gmail.com wrote: It all works fine, except for this bit $(li ul).siblings(a).click(function(){ return false; }); there are no a tag siblings of the UL, so that will not work. I've just tested it, and when I click on a subnav link, the class is added to the LI containing Link 3, if you need it to be added to the a tag use this $(li a).click(function(){ $(this).parents(ul).parents(li).children(a).addClass(nav-selected); }); osu wrote: Hi Liam, This is the list I'm working with: ul li class=nav-path-selecteda href=#Link 1/a/li lia href=#Link 2/a/li li class=nav-path-selecteda href=#Link 3/a ul lia href=# class=nav-selectedLink 3a/a/li lia href=#Link 3b/a/li lia href=#Link 3c/a/li /ul /li lia href=#Link 4/a/li /ul I need to add the class 'nav-selected' to Link 3 so I can highlight it using the same CSS as used to style Link 3a (the active link in the example above). As you can see, Link 1 has a class of 'nav-path- selected', so I need to differentiate between that and Link 3 (hence why I want to add a 'nav-selected' class to Link 3) The JQuery I've added to the footer of my page is: script type=text/javascript //![CDATA[ $(document).ready(function() { // Disabledparentlink $(li ul).siblings(a).click(function(){ return false; }); $(li a).click(function(){ $(this).parents(ul).parents(li).addClass(nav-selected); }); }); //]] /script But nothing is happening...no JS errors in Firebug either - any ideas? Thanks for your patience, osu On Sep 29, 11:07 am, Liam Potter radioactiv...@gmail.com wrote: I'm assuming you posted an example list and the real list does contain a tags? I'm also assuming you are running that script with a document ready handler? osu wrote: Thanks Liam, but that's not working... Not sure why .click is in your example? Am I right in thinking by adding .parents to the end of each tag in your example that you're 'going down' different levels in the unordered list? This is what I have: $(li a).click(function(){ $(this).parents(ul).parents(li).addClass(nav-selected); }); Any ideas what's going wrong? On Sep 29, 10:29 am, Liam Potter radioactiv...@gmail.com wrote: $(li a).click(function(){ $(this).parents(ul).parents(li).addClass(className); }); osu wrote: Hi Ryan, That only affects the child of theparent. What I want to do is this: ul liLink 1/li liLink 2 *This is the link I want to add a class to* ul liLink 2a/li liLink 2b/li *This is the active link* liLink 2c/li /ul /li liLink 3/li /ul Rather than affecting a descendent/child of theparentlink, I need to work on the *parentlink* under which the active link is found. Any ideas? Thanks, osu On Sep 26, 7:48 pm, ryan.j ryan.joyce...@googlemail.com wrote: $('.nav-selected:first') On Sep 26, 5:36 pm, osu onesiz...@googlemail.com wrote: Can anyone help with this one please? Thanks, osu On Sep 25, 2:03 pm, osu onesiz...@googlemail.com wrote: Thanks Ryan for the alternative, However, I need to do the following now (see message above your last post): I need to highlight *only* the top-parentitem (the same one I just ran 'return false;' on) with the class 'nav-selected'. Any idea how I could do that? Thanks, osu On Sep 25, 11:13 am, ryan.j ryan.joyce...@googlemail.com wrote: rather than removing the href you could use the preventDefault function, which will leave the href intact should you want to unbind it at a later date
[jQuery] Re: keepp getting NaN vlue
I made some changes and it's now working, the problem was for the var's r2 and r3 on load there were no values for it to find, causing the NaN. here are my changes: !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 meta http-equiv=Content-Type content=text/html; charset=utf-8 / /head body Distanceinput type=text id=distance value=1 / span class=dresult/spannbsp;nbsp;nbsp; first km is 30k USD, the next kms is 1k USD eachbr / Weightinput type=text id=weight value=0 / span class=wresult/spannbsp;nbsp;nbsp; no extra fee for good under 5kgbr / urgentinput type=checkbox id=priority / span class=presult/spannbsp;nbsp;nbsp; urgent good 5k USD extrabr / divtotal to pay: span class=grandtotal/span/div script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js;/script script type=text/javascript $(function(){ $('input[type=text]').bind(keyup,calculate); calculate(); function calculate() { var firstkm = 3, nextkm = 1000; var distance = $('#distance').val(); if(distance 1){$('.dresult').text(firstkm + nextkm*(distance-1) + 'USD');} else {$('.dresult').text(firstkm + 'USD');} var weight = $('#weight').val(), perkg = 5000; if(weight 5) {$('.wresult').text((weight-5)*5000 + 'USD');} else {$('.wresult').text(0 + 'USD');} total(); } $('.presult').text('0 USD'); total(); $('#priority').change(function(){ if ($(this).attr('checked') == true) { $('.presult').text('5000 USD'); } else { $('.presult').text('0 USD'); } total(); }); function total() { var r1 = parseInt($('.dresult').text()), r2 = parseInt($('.wresult').text()), r3 = parseInt($('.presult').text()); $('.grandtotal').text(r1 + r2 + r3); }; }); /script /body /html Shawn wrote: further to that, you can do var distance = parseInt($(#distance.val(), 10); Using the radix (the second parameter - 10 in this case), forces the specific conversion you'd like. When dealing with dates at least, leaving out the radix can sometimes result in abnormal behavior that is VERY hard to troubleshoot. Oh, if the number is not an integer, use parseFloat() instead of parseInt(). (er, sry if this is TOOO basic.. :) ) Shawn Giovanni Battista Lenoci wrote: runrunforest ha scritto: Hi, I'm making a calculator for freight customer It seems I'm on the right path. But there is two bugs i need help. The TOTAL TO PAY value always seem to appear as NaN at first instead of default 3. And the function of TOTAL TO PAY only work after checkbox is checkd, I need it work regarding to changing of input value not just checkbox. I didn't chek all of your code, but remember: $('#distance').val(); returns a string, not an int. Bye
[jQuery] Re: How to add some string in attributes?
$(function(){ $(img).bind(mouseover,function(){ $(this).attr(src,/images/menu-my-account-hover.png); }); }); but this is the worst way you can do rollovers. You should be doing this in pure CSS, and the best way would be to use an image sprite. Teddy Hong wrote: If I have a tag image like this.. img alt=My Account src=/images/menu-my-account.png/ and when hover that image I want became like this img alt=My Account src=/images/menu-my-account-hover.png/ How to code this with jquery? Thanks
[jQuery] Re: .click() fires my callback more than once
probably because you have click handlers inside the confirmAction function, which is run on click itself. Fabdrol wrote: Hi guys, I'm facing this little problem, I've got a button toolbar, and users can select rows in a table. When they have selected some row's, they can click one of the buttons, and it invokes a callback. Problem is, when I click the first time, there's nothing wrong. But when I click the second time, it fires the callback two times, when I click the third time it fires the callback three times, and so on. That's a big problem, since the button is used to delete a page, and obviously it should delete it only once, since the AJAX would return an error ortherwise. The code is seperated in three blocks, first the the onclick on the button object, which invokes a function called confirmAction, taking to parameters. [1], a message for the users, [2] the name of the callback function. When the confirmation is confirmed, the confirmAction function calls the callback. As said before, when I click #delete once, it behaves like expected. But when I click the second time (without refresh) it runs the callback function twice, third time thrice, and so on. Below is my code... Thanks in advance! the onclick on the button object [code] $('#delete').click(function() { confirmAction('Weet je zeker dat je de geselecteerde pagina\'s wilt verwijderen?', 'destroy'); }); [/code] the confirmation (global for my app, that's why callback is an parameter) [code] var confirmAction = function(msg, callback) { var context = $('#confirmAction'); $('p.msg', context).html(msg); $.blockUI({ message: context, css: { border: 'none', padding: '15px', backgroundColor: '#000', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', color: '#fff' } }); $('#confirmYes').click(function() { $.unblockUI(); base[callback](true); // [callback] is the function name, (true) the parameter. // base is global this cashed }); $('#confirmNo').click(function() { $.unblockUI(); return false; }); } [/code] the callback: [code] var destroy = function(yesno) { var arr = new Array(); if(yesno == true) { $('input.do').each(function() { if($(this).attr('checked') == true) { arr.push($(this).val()); } }); console.log(arr); } }; [/code]
[jQuery] Re: Expandable sidebar
$(function(){ //shrink sidebar after 5 seconds setTimeout(shrink(),5000); $(div#sidebar).bind('mouseover',function(){ $(this).animate({width: 150},500); } $(div#sidebar).bind('mouseout',function(){ shrink(); } function shrink() { $(div#sidebar).animate({width: 20},500); } }); Vlad M. wrote: Hi guys, I've tried searching for a jQuery solution for an expandable sidebar but I can't seem to find anything that really works. What I mean by expandable sidebar can be seen on the Sid Lee website (http:// www.sidlee.com/). For instance, once everything is loaded, the right sidebar disappears, only to reappear when you move your mouse over it. Is there a way to achieve this effect using jQuery? Thank you in advance! Cheers, Vlad
[jQuery] Re: Chaining animation effects on different elements...
Yeah, the for loop will not wait for whatever it is executing, lets try something a bit different. You will need to store the elements in an array. total = 0; elements = new Array(); $(body).find(div.class).each(function(elem){ elements[elem] = $(this).attr(id); total++ }); i = 0; function rndAnim() { if ( i = total) { $(#+elements[i]).animate({opacity: 1}); i++ setTimeout(rndAnim,2000); } } rndAnim(); So, each element's id will be stored in the array, when the rndAnim function is run, it fades in the first element, and increases i then after 2 seconds, will run the function again, fading in the next element in the array, and will only do this as long as 'i' is less then the total amount of elements. this will need some cleaning up by yourself, but I do think it will work. ryan.j wrote: i had a look at your method last night, and i ran into the same problems i did trying to use setTimeout and $arr.each() to iterate the func. If i do... for (i=1; i=$arr.length; i++) { var tmp = self.setInterval( rndAnim(+i+) , 2000 ); } ...then [ i ] instances of rndAnim execute simultaneously after 2000ms, and whilst this repeats with setInterval where setTimeout doesn't, all [ i ] rndAnim() always happen simultaniously so i can't stack up a chain of animations. On Sep 22, 4:31 pm, Liam Potter radioactiv...@gmail.com wrote: ahh, didn't know you had id's already assigned, you could use the data method to store it in the dom rather then in the id? ryan.j wrote: cheers for that liam, i'd thought about assigning incremental ids on the fly since i'm already using the element's id to select them in the slab'o'crap being eval'd, but afaik xhtml elements can only have one attrib type ID can't they? since it's just a fluffy graphical thing i don't really want to grab all the id attribs that might be being used elsewhere but it me thinking, i could just assign classed like .bigUniqueString_1 and just strip out the last character for comparison. will have a fiddle around with that. On Sep 22, 3:50 pm, Liam Potter radioactiv...@gmail.com wrote: I'd count how many elements have the class, and also add an id to each one, incrementing with each count. Then I would write a function, passing it a randomly generated number (within range of the element count) which would fade in the given id, with a known animation time. I would then use setInterval to run the function, and give it the same time as the fade animation will take. Could how many times this is ran and once it reaches the amount of elements, end it. This may also not the best way to do it, but it's better then nested callbacks. ryan.j wrote: Hi guys, been playing around with something for a bit this afternoon but i can't find a programatically 'nice' way of achieving the effect i'm after. I have a bunch of elements assigned a class that don't necessarily have anything in common beyond the class. I want to fadeto them in randomly but in-turn, as if i was chaining animation effects for example. http://jsbin.com/exepi the only way i've been able to do this so far is by building and evaluating a slab of nested callbacks which works but is pretty horrible in almost every way. I think i'm missing something fairly obvious here, you guys have any thoughts?
[jQuery] Re: Chaining animation effects on different elements...
My understanding of javascript/programming theory leans more to the low end of the scale so I wouldn't know how similar nested callbacks and self-referencing functions actually are. Someone with a better understanding could probably explain a much more efficient way of getting this done, but this is just how I would go about it. Glad I could be of some help anyways. ryan.j wrote: i was under the impression that the nested callbacks were doing something similar to a self-referencing function in terms of leaving stuff hanging around in memory (that could just be me misunderstanding exactly what the callbacks are doing to be honest) but this would certainly eliminate the need to start a second js interpreter with the eval. i'd come to pretty much the same conclusion: building an array of elements to be animated and including the timeout in the function itself, but i'm waiting on the client for something so i've been concentrating on a review of contemporary webdesign* this morning instead, cheers for your help mate, been v.useful indeed *facebook and ebay ;) On Sep 23, 11:16 am, Liam Potter radioactiv...@gmail.com wrote: Yeah, the for loop will not wait for whatever it is executing, lets try something a bit different. You will need to store the elements in an array. total = 0; elements = new Array(); $(body).find(div.class).each(function(elem){ elements[elem] = $(this).attr(id); total++ }); i = 0; function rndAnim() { if ( i = total) { $(#+elements[i]).animate({opacity: 1}); i++ setTimeout(rndAnim,2000); }} rndAnim(); So, each element's id will be stored in the array, when the rndAnim function is run, it fades in the first element, and increases i then after 2 seconds, will run the function again, fading in the next element in the array, and will only do this as long as 'i' is less then the total amount of elements. this will need some cleaning up by yourself, but I do think it will work. ryan.j wrote: i had a look at your method last night, and i ran into the same problems i did trying to use setTimeout and $arr.each() to iterate the func. If i do... for (i=1; i=$arr.length; i++) { var tmp = self.setInterval( rndAnim(+i+) , 2000 ); } ...then [ i ] instances of rndAnim execute simultaneously after 2000ms, and whilst this repeats with setInterval where setTimeout doesn't, all [ i ] rndAnim() always happen simultaniously so i can't stack up a chain of animations. On Sep 22, 4:31 pm, Liam Potter radioactiv...@gmail.com wrote: ahh, didn't know you had id's already assigned, you could use the data method to store it in the dom rather then in the id? ryan.j wrote: cheers for that liam, i'd thought about assigning incremental ids on the fly since i'm already using the element's id to select them in the slab'o'crap being eval'd, but afaik xhtml elements can only have one attrib type ID can't they? since it's just a fluffy graphical thing i don't really want to grab all the id attribs that might be being used elsewhere but it me thinking, i could just assign classed like .bigUniqueString_1 and just strip out the last character for comparison. will have a fiddle around with that. On Sep 22, 3:50 pm, Liam Potter radioactiv...@gmail.com wrote: I'd count how many elements have the class, and also add an id to each one, incrementing with each count. Then I would write a function, passing it a randomly generated number (within range of the element count) which would fade in the given id, with a known animation time. I would then use setInterval to run the function, and give it the same time as the fade animation will take. Could how many times this is ran and once it reaches the amount of elements, end it. This may also not the best way to do it, but it's better then nested callbacks. ryan.j wrote: Hi guys, been playing around with something for a bit this afternoon but i can't find a programatically 'nice' way of achieving the effect i'm after. I have a bunch of elements assigned a class that don't necessarily have anything in common beyond the class. I want to fadeto them in randomly but in-turn, as if i was chaining animation effects for example. http://jsbin.com/exepi the only way i've been able to do this so far is by building and evaluating a slab of nested callbacks which works but is pretty horrible in almost every way. I think i'm missing something fairly obvious here, you guys have any thoughts?
[jQuery] Re: Way to convert DOM event to jQuery event?
or this a href=# rel=foobarbazshow details/a $(a).click(function(){ var rel = $(this).attr('rel'); } now you have passed foobarbaz to jquery. WalterGR wrote: I want to take advantage of jQuery's cross-browser Event object, but via an onclick event handler. For example: a href=# onclick=showTextNearThisLink(convertToJQueryEvent(event), 'foobarbaz');show details/a Is something like this possible? I may be thinking about the problem wrong. I understand that event handlers are usually wired up on $(document).ready, but I need to send additional information ('foobarbaz' above) to the event handler. Thanks, WalterGR
[jQuery] Re: [Attrib external not working...]
Except that target=_blank is deprecated in xhtml 1.1, so to make sure you're markup validates, you need to use javascript to make links open in a new window/tab. One way to do it is like this. $(a[rel='external']).click(function(){ this.target = _blank; }); Liam Byrne wrote: Maybe because 'rel=external' doesn't have any meaning or functionality ? The proper syntax with functionality would be a target=_blank href=http://www.google.com;google/a but that's just HTML; it has nothing to do with jQuery Liam Lord Gustavo Miguel Angel wrote: Hi, Why this code not working? a rel=external href=www.google.comgoogle/a url www.google.com http://www.google.com open in same windows. Thank´s No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.112/2388 - Release Date: 09/22/09 05:51:00
[jQuery] Re: [Attrib external not working...]
I have no idea, I think it was a stupid choice, I believe the reason behind it was that people should be able to choose how to open a link, and forcing a new window removes this choice, and confuses the user, because the back button stops working. I prefer external sites to open in a new window/tab, I almost expect them to. Rick Faircloth wrote: Now why would target=_blank be deprecated without a suitable HTML substitute, requiring coders to have to resort to js for the functionality? Odd... Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Liam Potter Sent: Tuesday, September 22, 2009 10:20 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: [Attrib external not working...] Except that target=_blank is deprecated in xhtml 1.1, so to make sure you're markup validates, you need to use javascript to make links open in a new window/tab. One way to do it is like this. $(a[rel='external']).click(function(){ this.target = _blank; }); Liam Byrne wrote: Maybe because 'rel=external' doesn't have any meaning or functionality ? The proper syntax with functionality would be a target=_blank href=http://www.google.com;google/a but that's just HTML; it has nothing to do with jQuery Liam Lord Gustavo Miguel Angel wrote: Hi, Why this code not working? a rel=external href=www.google.comgoogle/a url www.google.com http://www.google.com open in same windows. Thank´s No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.112/2388 - Release Date: 09/22/09 05:51:00
[jQuery] Re: Chaining animation effects on different elements...
I'd count how many elements have the class, and also add an id to each one, incrementing with each count. Then I would write a function, passing it a randomly generated number (within range of the element count) which would fade in the given id, with a known animation time. I would then use setInterval to run the function, and give it the same time as the fade animation will take. Could how many times this is ran and once it reaches the amount of elements, end it. This may also not the best way to do it, but it's better then nested callbacks. ryan.j wrote: Hi guys, been playing around with something for a bit this afternoon but i can't find a programatically 'nice' way of achieving the effect i'm after. I have a bunch of elements assigned a class that don't necessarily have anything in common beyond the class. I want to fadeto them in randomly but in-turn, as if i was chaining animation effects for example. http://jsbin.com/exepi the only way i've been able to do this so far is by building and evaluating a slab of nested callbacks which works but is pretty horrible in almost every way. I think i'm missing something fairly obvious here, you guys have any thoughts?
[jQuery] Re: Chaining animation effects on different elements...
ahh, didn't know you had id's already assigned, you could use the data method to store it in the dom rather then in the id? ryan.j wrote: cheers for that liam, i'd thought about assigning incremental ids on the fly since i'm already using the element's id to select them in the slab'o'crap being eval'd, but afaik xhtml elements can only have one attrib type ID can't they? since it's just a fluffy graphical thing i don't really want to grab all the id attribs that might be being used elsewhere but it me thinking, i could just assign classed like .bigUniqueString_1 and just strip out the last character for comparison. will have a fiddle around with that. On Sep 22, 3:50 pm, Liam Potter radioactiv...@gmail.com wrote: I'd count how many elements have the class, and also add an id to each one, incrementing with each count. Then I would write a function, passing it a randomly generated number (within range of the element count) which would fade in the given id, with a known animation time. I would then use setInterval to run the function, and give it the same time as the fade animation will take. Could how many times this is ran and once it reaches the amount of elements, end it. This may also not the best way to do it, but it's better then nested callbacks. ryan.j wrote: Hi guys, been playing around with something for a bit this afternoon but i can't find a programatically 'nice' way of achieving the effect i'm after. I have a bunch of elements assigned a class that don't necessarily have anything in common beyond the class. I want to fadeto them in randomly but in-turn, as if i was chaining animation effects for example. http://jsbin.com/exepi the only way i've been able to do this so far is by building and evaluating a slab of nested callbacks which works but is pretty horrible in almost every way. I think i'm missing something fairly obvious here, you guys have any thoughts?
[jQuery] Re: Suggest a pop up window..
Depends what you need one for. Erik R. Peterson wrote: Can anyone suggest to me a good jquery pop up window script. Thanks. Erik
[jQuery] Re: Some homebrewn jQuery functionalities
You'd be better off just removing the div entirely. $(document).ready(function() $(#needJavaScript).remove(); ); Cecil Westerhof wrote: 2009/9/21 Cecil Westerhof cldwester...@gmail.com: - a way to automatically notify people that they should enable JavaScript The way that I did this was that start the body with: h1 id = needJavaScript For best results JavaScript must be enabled!!! /h1 And in the $(document).ready(function() I had: $(#needJavaScript).text($('title').text()); But that does not work with MIE8. When using: alert($('title').text()); I get an empty string. I know use: $(#needJavaScript).text($('title').html()); This works. Does anybody knows why the first does not work in MIE8?
[jQuery] Re: Autocomplete
why not restyle the strong tag? Asa Carter wrote: How do I use the highlight function in the auto complete plugin? I wish to replace strong/strong with span class=blah../span Thanks Asa
[jQuery] Re: Recommend a JS enabled/browser growler script/plug-in?
use noscript and conditional comments. ldexterldesign wrote: // This site works best with JavaScript enabled and not using Internet Explorer. Take your pick of the others instead: Firefox, Google Chrome, Safari, Opera... Anyone? :P Thanks,
[jQuery] Re: Hidden div height width
why not position absolute ? rupak mandal wrote: Thanks for the quick reply . The problem is that i cannot use visibility:hidden or position absolute. On Fri, Sep 4, 2009 at 3:42 PM, joey santiago federico.pr...@yahoo.it mailto:federico.pr...@yahoo.it wrote: exactly... but if you hide it with visibility:hidden, then you still see an empty space on the page... you should hide it by setting his absolute position to top and left negative values, or (probably better?) using z-index property. hope it's useful! :) On 4 Set, 12:04, Cold Flame theumairsha...@gmail.com mailto:theumairsha...@gmail.com wrote: Hi Rupak, if div is hidden using css display:none then you can't get its height or width because logically that element is that drawn on the browser. While if u hide the div using css visibility:hidden then u can get the height and width of the element. Regards Umair Shahid On Sep 4, 3:45 pm, Rupak rupakn...@gmail.com mailto:rupakn...@gmail.com wrote: Hi all Can any one tell me is it possible to get the height and width of a hidden div. I have to apply animation to a hidden div. But is don't know how to do this. Thanks Rupak
[jQuery] Jumpstart
http://starter.pixelgraphics.us/ Can someone explain what's happening in this plugin pattern. Thanks, Liam
[jQuery] Re: Can't assign jQuery jqModal to dynamically added links
Use live instead of bind $(#jqmodalbind).live(click, function(e){ alert('Binding JQModal'); $('#addnote').jqm({ajax: '@rel', trigger: '.addnotetrigger'}); }); neburton wrote: I've been having problems getting jqmodal modal dialogs to display on links added dynamically by client side code. I've demonstrated the problem at the following URL: http://www.neil-burton.co.uk/jqmodaltest/index.htm jqModal plugin here - http://dev.iceburg.net/jquery/jqModal/ Any help would be appreciated
[jQuery] Re: .not($.browser.msie $.browser.version = 7)
if ( !$.browser.msie !$.browser.version = 7 ) { $(div).corners(4px); } though the $.browser.msie will block any ie browser, so the bit making sure it is under version 7 is redundant. IschaGast wrote: I am having rounded corners in a site but I don't want them in IE because it does strange things with the corners. Something like below isn't that possible? .corners(4px).not($.browser.msie $.browser.version = 7) What are the other solution to only target IE for not rounding that corners? Gr Ischa
[jQuery] Re: save to pdf
That's not possible. David .Wu wrote: Is there any plugin can let me save the part of pag as pdf?
[jQuery] Re: text without backspace get error in cluetip
There is no simple, perfect way to combat this and keep the text and this happens in all browsers (as far as I know). You could look into javascript hyphenation or just hiding the overflow of the tooltip. khin wrote: Hi all, When i have: title=test|contentwithoutspacehover/a if the width of the text is more bigger than the configuration of cluetip, the text continues out of cluetip box. Have one way to solve that? Rly Thx
[jQuery] Re: Problem with js redirect when using getJSON
What about window.location.href='http://site2.example.com/'; Grimori wrote: Wonder if anyone tried to replicate this problem... It's pretty simple to and a great deal of bug if I'm not missing something. Thanks. On Aug 17, 6:14 pm, Grimori mihaigrig...@gmail.com wrote: Yes, I have tried that - nothing changes though... I'd really appreciate any other ideas.. Thanks! On Aug 13, 2:40 am, James james.gp@gmail.com wrote: Have you tried: window.location = 'http://site2.example.com/'; On Aug 12, 1:36 pm, Grimori mihaigrig...@gmail.com wrote: The problem only exists in firefox. Has anyone had this problem before? Thanks. On Aug 12, 9:14 pm, Grimori mihaigrig...@gmail.com wrote: Hi everyone, The problem I'm facing is as follows. I'm using a JSON call to check some data before doing a JS redirect to a different page. The redirect works but it's impossible to get back to the initial page using the browser's back button. The initial location is not being stored in the browser's history. This is the script simplified. If placed onhttp://site1.example.com/ when it's executed it redirects tohttp://site2.example.com/but there's no way to go back tohttp://site1.example.com/usingthe browser's back button. code $(document).ready(function(){ $('#click').click(function(){ $.getJSON('index.php?jsoncallback=?', function(msg){ location.href='http://site2.example.com/'; }); });}) /code Any help is appreciated.
[jQuery] Re: Chaining jQuery AJAX
A simple way of doing it would be to use the success callback of each request. pascal.nauj...@googlemail.com wrote: Hi Group, is there a possibility to chain AJAX Requests? By now i have 5 AJAX Functions where one calls the next (Button Click - 1 - 2 - 3 - 4 - 5 - Finish) My main problem is that i have to wait about 10 seconds before the 3. function calls the 4. When i use sT1 = window.setTimeout(function(){ function_4() }, 1); in function 3 my result gets mixed up. eg the dom manipulation of function 1 is reverted (strange - i know). I also tried the pause the Cookbook wait function (http:// docs.jquery.com/Cookbook/wait) but i can't get them to run with my ajax statements. I tryed something like $.wait(10).ajax({url: smtpCheck.php, data: . Thanks in advance Pascal
[jQuery] Re: AJAX and ampersand
You need to url encode it, or just replace it with %26 Julijan Andjelic wrote: Is there any was to prevent ampersand from splitting up the passed data? For example if my data looks like: This is some textblah blah If I pass it as data it will get split up at : This is some text blah blah Any solutions?
[jQuery] Re: Hover Area - Change image
It's because you have targeted the image as the hover area rather then the li, use this instead $(li.clickable).hover(function() { $(this).children(img).attr(src, $(this).attr(src).split(_off).join(_over)); }, function() { $(this).children(img).attr(src, $(this).attr(src).split(_over).join(_off)); }); Hover over the li, then get the child element within the context of 'this' to perform the actions to it. wheatstraw wrote: What I want to have happen is when you hover over the li it: 1) allows you to click the who area (this works) 2) The image swap. Right now the image will only swap when hovering over the image not the rest of the li. Any help would be appreciated! $(document).ready(function(){ $('li.clickable').css('cursor', 'pointer').click(function() { window.location = $('a', this).attr('href'); }); $(li.clickable img).hover(function() { $(this).attr(src, $(this).attr(src).split(_off).join (_over)); }, function() { $(this).attr(src, $(this).attr(src).split(_over).join (_off)); }); });
[jQuery] Re: Is there a jQuery script that can do automatic text sizing based on browser window size?
would just be a function to increase the font size same as anything else, and if you are using percentages or em's would be even simpler. Tuckers wrote: I want to create a page that scales everything on it as you increase/ decrease the browser window/viewport. I can scale everything on the page except the text. You can see my example here (made for IE only now). You can size the browser window and see how it all scales. http://mediazure.com/message_boards/Logo-message-board-template.htm I have not found a solution to scale text with window size. I think that there is a function that can be called called onResize.I only need it to work in IE. If it doesn't work in Firefox etc., as long as it doesn't mess up those browsers it will be ok. Does anyone know a jQuery script that can do this? Or maybe someone might want to make a bit of money making this for me? I am not a javascript programmer, I have one available if there is a script available. Thanks!
[jQuery] Re: Display DIVs as Multiple Columns
float them, with css. S2 wrote: How can I display a bunch of DIVs in multiple columns? Like Flex's TileList component. A B C C E F G A B C D E F G A B C D E F G
[jQuery] Re: Get inner class of event
This happens to me quite often, so do what I do, write the group post, but don't send it, just go back to trying to solve it, if you can't solve it then click the send button :) Michael Price wrote: Hello again folks – as per usual, I managed to get this working five minutes later! So never mind, but thanks if you were going to take a look at it J Regards, Michael Price *From:* jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] *On Behalf Of *Michael Price *Sent:* 21 August 2009 11:12 *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Get inner class of event Hi all, Got a div on a page, and we want something to happen when a user clicks on the div. However, within the div is a link and we want something DIFFERENT to happen if they click on the LINK rather than anything else in the div. Clicking the link is triggering the div click code as well – I need to stop this which I thought I could do with e.stopPropagation(); on the link click handler, but it doesn’t seem to be working. Is there any way to pick up via the div click handler that it was actually the LINK, and react in there instead, or am I taking the wrong approach? Regards, Michael Price
[jQuery] Re: Animation Vapour Trails
Might have something to do with cleartype? Leonard Martin wrote: Apologies, I missed the link: http://in.tellig.net/jquery.animateparam/jquery.animateparam.js and http://in.tellig.net/jquery.animateparam/ for an example. On Aug 19, 2:08 pm, Leonard Martin leonard.mar...@gmail.com wrote: I've been trying to write an extension to the animate function to allow the animation of elements along a parameterised path (in the original motivation this was around the diameter of a circle) whilst keeping use of things like $.easing and $().stop(). I've managed to put something together that seems to work, except that in the basic example I have one of the animated elements leaves a trail behind it as it moves it certain browsers. It seems to work fine in IE6 and Opera(Win) but leaves a trail in FF 3.5.2, Chrome 2.0.172.40 and Safari 4.02. I'm assuming it's a rendering engine bug, but it's something I've never come across before, so if anyone has any sage advice about how to deal with it, or has any other feedback on the plugin in general then I'd be interested to hear.
[jQuery] Re: 'Wrapping' some (not just 1 pair) HTML elements in a div?
why would you be doing this with jquery anyway? ldexterldesign wrote: Don't you think I thought about using that straight away? How can I wrap a group of elements in the DOM when I don't know what elements will be there in first place. I'm aiming to wrap, essentially, a blog post, so: $(document).ready(function(){ $('h2').wrap('div class=scrollablePost/div'); }); // would be fine ...but try doing this: $(document).ready(function(){ $('h2bunchOfOtherElements?.../bunchOfOtherElements?div class=postmetadata/div').wrap('div class=scrollablePost/ div'); }); :| Thanks, L On Aug 20, 3:36 pm, ak732 ask...@gmail.com wrote: go to:http://api.jquery.com/and put wrap in the filter box On Aug 20, 10:06 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Yo guys, I need to wrap this chuck of HTML in a div:http://is.gd/2qatX Any thoughts? $(document).ready(function(){ $('div class=scrollablePost').insertBefore('.page-id-9 h2'); $('/div').insertAfter('.page-id-9 .postmetadata'); }); ...just pumps out div class=scrollablePost / at both ends, as you'll see from the above screenshot. Thanks, L
[jQuery] Re: removing table rows except the first one
$(#tbl tbody tr:not(:first-child)).remove(); con-man-jake wrote: Can anyone please confirm the syntax of what I am doing I have a table with id=tbl, it has 4 rows. I need to remove all rows except the first one. It has tbody. Is this the way to do it $(#tbl tbody tr:gt(0)).remove(); If this is the way to do it, it is not working. Any help is appreciated. jake
[jQuery] Re: removing table rows except the first one
Have fun :) con-man-jake wrote: It works! Thank you Liam. jake On Aug 19, 11:22 am, Liam Potter radioactiv...@gmail.com wrote: $(#tbl tbody tr:not(:first-child)).remove(); con-man-jake wrote: Can anyone please confirm the syntax of what I am doing I have a table with id=tbl, it has 4 rows. I need to remove all rows except the first one. It has tbody. Is this the way to do it $(#tbl tbody tr:gt(0)).remove(); If this is the way to do it, it is not working. Any help is appreciated. jake
[jQuery] Re: Background color on images in Jquery Cycle
Well, you have the bgcolor on bigimg set to transparent, meaning whatever is behind it will show through, so if that's the body, that's what you'll see. Just apply the colour you want it to be. I don't really understand the problem. theosoft wrote: Here's a new problem and no idea how to fix it. I've tried every css trick I could think of. I had to set width and height on the container for the images for IE. However, when I did that in my style sheet, it grabs the background color of the body and puts it into the div. I have no idea what's going on with this. Here's my css for the div containing the images: .bigimg { background:url(/images/ciu2009/ad_rot_shadow.png) bottom right no- repeat transparent; clear:both; width:100%; height:100%; position:relative; z-index:9; } css for body: body { width:100%; background-color:#312108; z-index:0; position:relative; } One site suggested cleartype, but I turned that off and the problem is still there. This bug is showing up in IE8 and in compatibility mode of IE8 (i.e. IE7). Any thoughts or anyone else experience this. I need this solved ASAP.
[jQuery] Re: Hide function in IE
IE cannot animate the opacity of a png with alpha transparency and there is no solution to this. pmni wrote: Hi. I'm building a website, and use your framework to hide/show a div. This work, but in IE when click to hide/show the div, the background became black, instead to maintaine the image with alpha properties... In Firefox, Opera and Chrome works fine. Why this append? Thanks in advance, pmni
[jQuery] Re: Hide function in IE
Nope, all versions of IE cannot animate the opacity of a PNG without the black artifact, regardless of any hacks that are applied. It's really quite annoying. Jonathan Vanherpe (T T NV) wrote: By IE, I think he means IE6. I haven't tested this, but I think IE7 and up can do this fine, as long as you make sure you're applying any png hacks you're using to IE6 only with conditional comments. I could be wrong on this, though. Jonathan pmni wrote: Thank you for the explain. On 18 Ago, 08:58, Liam Potter radioactiv...@gmail.com wrote: IE cannot animate the opacity of a png with alpha transparency and there is no solution to this. pmni wrote: Hi. I'm building a website, and use your framework to hide/show a div. This work, but in IE when click to hide/show the div, the background became black, instead to maintaine the image with alpha properties... In Firefox, Opera and Chrome works fine. Why this append? Thanks in advance, pmni- Ocultar texto citado - - Mostrar texto citado -
[jQuery] Re: Manipulate href
you want to manipulate the string so, after doing what paul did. $('a').click(function() { var id = $(this).attr('href'); var orig = '/portfolio/category/' id.replace(orig, #) } But I do not see what you are trying to achieve with this? anurag pal wrote: Hi, ul id=my_list lia href=#animalsAnimals/a/ li lia href=#buildingsBuildings/a/li lia href=#carsCars/a/li lia href=#peoplePeople/a/li /ul $('a').click(function() { var id = $(this).attr('href'); now you can get the string after hash and then redirect it to the desired location. } Regards, Anurag Pal On Tue, Aug 18, 2009 at 12:37 AM, knal knalp...@gmail.com mailto:knalp...@gmail.com wrote: Hi group, I'm looking for a correct way of manipulating a hrefs... The code looks like this: ul id=my_list lia href=/portfolio/category/animals/Animals/a/li lia href=/portfolio/category/buildings/Buildings/a/li lia href=/portfolio/category/cars/Cars/a/li lia href=/portfolio/category/people/People/a/li /ul and with jQuery i want to manipulate it into this: ul id=my_list lia href=#animalsAnimals/a/li lia href=#buildingsBuildings/a/li lia href=#carsCars/a/li lia href=#peoplePeople/a/li /ul So only the last element in the URL has to stay, and a hash has te be added... I wouldn't know how to achieve this. I've been googling it for three hours now, but i jus't can't get it to work. Any help would be greatly appreciated! Thanks, Knal
[jQuery] Re: Hide function in IE
I'm not 100% sure, but the fix they used, seems to me to just be loading the png's into the alpha image loader natively, which is pretty damn poor if I'm correct. Jonathan Vanherpe (T T NV) wrote: That sucks, I didn't know that. I was under the impression that they had fixed IE's png support with IE7, but I guess it shouldn't surprise me their 'fix' is buggy. Jonathan Liam Potter wrote: Nope, all versions of IE cannot animate the opacity of a PNG without the black artifact, regardless of any hacks that are applied. It's really quite annoying. Jonathan Vanherpe (T T NV) wrote: By IE, I think he means IE6. I haven't tested this, but I think IE7 and up can do this fine, as long as you make sure you're applying any png hacks you're using to IE6 only with conditional comments. I could be wrong on this, though. Jonathan pmni wrote: Thank you for the explain. On 18 Ago, 08:58, Liam Potter radioactiv...@gmail.com wrote:
[jQuery] Re: Hello
We need to see your code, goto http://www.jsbin.com, select the jquery library to include, paste your javascript and your html, then send us the link to see it. Praveen Alvandi wrote: Hey guys, HELP ME . . . I am struck. . . On Thu, Aug 13, 2009 at 8:44 PM, Praveen Alvandi praveen.alva...@gmail.com mailto:praveen.alva...@gmail.com wrote: Hi, I have this script here. Hope i can paste the code. Please click on the login tab on the right side. The issue is, the tab slides down as well as grows. Please help. It should only slide down, not grow. Please help me.
[jQuery] Re: Code inside click() event not firing.
lol, niice. Ricardo wrote: wow On Aug 13, 10:56 pm, Meroe whme...@gmail.com wrote: What if you change $(a).click(function () To $(#a).click(function () -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Patrick Sent: Thursday, August 13, 2009 2:16 PM To: jQuery (English) Subject: [jQuery] Code inside click() event not firing. New to jQuery, I did many searches before posting. This is happening in both IE6 and Firefox 3.0.13. I've gotten the following script to work under strange circumstances (explained below first snippet). jQuery(document).ready(function(){ showHint(); // ajax that fires onload, with no problem (but did try taking it out with same results) $(a).click(function () { alert(hi onclick); // stuck this in there but doesn't fire either. var avid; avid = #div + $(this).attr(id); alert(avid); // this won't work either. $(avid).fadeIn(slow); $(avid).css({display: block}); // added this extra when fadeIn didn't work. }); }); When I'm able to successfully get both the alert and the rest of the script to work is when I add another alert in the ready() section. Then, the code works for the rest of the browser session (even after the 'ready ()' alert is removed). jQuery(document).ready(function(){ showHint(); // ajax/json alert(hi on load); // after inserting this, the below all works ** $(a).click(function () { alert(hi onclick); // stuck this in there but doesn't fire. var avid; avid = $(this).attr(id); avid = #div + avid; alert(avid); $(avid).fadeIn(slow); $(avid).css({display: block}); // added this extra when fadeIn didn't work. }); }); Any clue why this would be happening? Thanks, Pat.
[jQuery] Re: Can you put diffrent image son each of the tabs in suckerfish?
how about, editing your html? amuhlou wrote: a good start would be to use firebug and inspect the code for the example page. On Aug 14, 8:30 am, Stockypotty andy_stoc...@hotmail.com wrote: Sorry I didn't mean that, early morning ^^ I was wondering if you had any good tutorials on how to put a unique class name on each tab? Unfortunately my site is not running live if that is what you meant about a test page. However if you go to this site: http://www.quizilla.com/ You can see that the top menu has pictures as the tabs, and then when the user puts their mouse over it, the drop down menu appears. This is what I hope to achieve!
[jQuery] Re: IE8 Selector Bug?
If you are using 1.2.6 you need to use the @ symbol $('#Row_1 inp...@type=text]').each(function() { $(this).val(''); }); gentry wrote: Anybody know why this doesn't work in IE8 with jQuery version 1.2.6? It works in the latest jQuery version but I can't move to it yet because of some other issues. I'm trying to clear all the textboxes in a table row but only the 1st textbox gets cleared in IE8. $('#Row_1 input[type=text]').each(function() { $(this).val(''); });
[jQuery] Re: IE8 Selector Bug?
ignore that Liam Potter wrote: If you are using 1.2.6 you need to use the @ symbol $('#Row_1 inp...@type=text]').each(function() { $(this).val(''); }); gentry wrote: Anybody know why this doesn't work in IE8 with jQuery version 1.2.6? It works in the latest jQuery version but I can't move to it yet because of some other issues. I'm trying to clear all the textboxes in a table row but only the 1st textbox gets cleared in IE8. $('#Row_1 input[type=text]').each(function() { $(this).val(''); });
[jQuery] Re: Hover function issue
Simple rollovers should be done with CSS and using a sprite image rather then two seperate images. Geir wrote: Hi! ..rather new to javascript I'm making a rollover-script for my site. It works fine for one image, but not for many. How can I modify it to supprt any number of images? var sti = $('.ro').attr('src'); var nySti = sti.replace('.png', '_ov.png') $('.ro').hover(function() {$(this).attr('src', nySti)}, function() {$(this).attr('src', sti)} ); for image.png class=ro hoverstate is image_ov.png Thanks!
[jQuery] Re: How to bind text to trigger checkbox?
http://docs.jquery.com/Events/trigger Denis Abramov wrote: Couldn't find it in documentation. For example i have spantext/span and when someone clicks on it, it should trigger checkbox to checked or unchecked. Thanks! :)
[jQuery] Re: Slideshow Dies in 1.3.2 but works in 1.3.1 and below
try changing $(a.sl_next).click(slNext); $(a.sl_back).click(slBack); to $(a.sl_next).click(function(){slNext}); $(a.sl_back).click(function(){slBack}); no idea if this will work btw Brad wrote: Basically, I can click the next button and go forward until it reaches the last slide then it sticks. The Back button is also broken. This code works great with 1.3.1 and 1.2.6 but has the aforementioned bugs in 1.3.2 $(document).ready(function() { var fadeSpeed = 1000; var currentSlide = 0; var setSeconds = 1200; var pauseAuto = setSeconds; setInterval(slAuto, 1000); $(a.sl_next).click(slNext); $(a.sl_back).click(slBack); $(#slideshow li).hide(); $(#slideshow li:first).show(); var totalSlides = $(#slideshow li).length; $(#slideshow li).each(function() { var slIndex = $(#slideshow li).index(this); slIndex++; $(this).find(.sl_of).text( + slIndex + of + totalSlides); }); function slAuto() { if (pauseAuto != 0) { pauseAuto--; } else { pauseAuto = setSeconds; moveNext(); return false; } } function slNext() { pauseAuto = setSeconds; moveNext(); return false; } function slBack() { pauseAuto = setSeconds; moveBack(); return false; } function moveNext() { $(#slideshow li:eq( + currentSlide + )).fadeOut(fadeSpeed); if (currentSlide == (totalSlides - 1)) { currentSlide = 0; } else { currentSlide++; } $(#slideshow li:eq( + currentSlide + )).fadeIn(fadeSpeed); } function moveBack() { $(#slideshow li:eq( + currentSlide + )).fadeOut(fadeSpeed); if (currentSlide == 0) { currentSlide = (totalSlides - 1); } else { currentSlide--; } $(#slideshow li:eq( + currentSlide + )).fadeIn(fadeSpeed); } });
[jQuery] Re: toggle and logic confusion
when you click on a button, run a function to close all the divs, and run a function to open the specified div. Bruce MacKay wrote: Yes, you are right - what I described was like an accordion, but I left out the description of the actual links on which the div's are opened/closed. The links exist as 3 buttons in a horizontal list that remains stationery while the divs open/close beneath them. This UI makes what I'm trying to do not an accordion. Thanks for your input, nevertheless. Bruce At 09:32 p.m. 12/08/2009, you wrote: Hi Bruce are trying to do something like an accordion. http://jqueryui.com/demos/accordion/ I tried to do what you described a few days ago and then found the jquery UI at the above link. On Aug 12, 10:00 am, Bruce MacKay b.mac...@massey.ac.nz wrote: Hi folks, I have a set of 3 divs with a class element of hideme. Through the code that follows (it's not mine; it works!), I can click a dedicated a.tag for each div to toggle the visibility (or not) of the contents of the associated div. What I'd like to be able to achieve is that if say, div#1 was visible and the user clicked the a tag for div#2, then div#1 would disappear and div#2 appear in its place. The code in the inserted line #5 allows me to achieve this slightly, but it requires the associated a tag link to be double clicked in order for their associated div to become visible and the currently visible div to be hidden. I'd appreciate someone illuminating a path to a solution for me. Thanks/Bruce 1$('#fsheet').find('.hideme').hide().end(); 2$('a.showme').each(function(i) { 3 var $match = $('div.hideme').eq(i); 4 $(this).toggle(function() { 5 // $('div.hideme:not(eq(i))').hide('slow'); 6 $match.show('slow'); 7 }, function () { 8 $match.hide('slow'); 9 } 10 ); 11});
[jQuery] Re: JSON how to transform an object into an array?
Shouldn't you be using $.getJSON instead? Mark wrote: Hi all. I got an php page who picks up data out of my data base and puts it in a multidimensinal array. That array is being encoded to Json $event = json_encode($super_array); Then i made an javasript get funtion to get that array to my main page. function get(){ $.get(../position of my file/test.php, function(data){ alert (+data); }); The var data doesn't give me an array it gives me an object while i programmed it to give me an array (inplace of force_object): {5: {id:5,title:test,start_datum:6161616,end_datum:663461,afspraak_type:memo},10: {id:10,title:bla,start_datum:4819028,end_datum:8230948,afspraak_type:verjaardag}} What i need to have is that it gives me an array that looks something like this: [ { id:5, title:test, start_datum:6161616, end_datum: 663461, afspraak_type: Memo } { id:10, title:bla, start_datum: 4819028, end_datum:8230948, afspraak_type:Verjaardag } ] What is the best way to get to this? Mark
[jQuery] Re: How can we stop the animate function?
use .stop() $(document).ready(function(){ $(div#button1).click(function(){ $(#box).stop().animate({ margin-left : 150px }); }); $(div#button2).click(function(){ $(#box).stop().animate({ width : 500px }); }); }); sundowatch wrote: I wonna stop an animate function which hasn't been completed yet. For example; script type=text/javascript src=jquery.js/script script type=text/javascript $(document).ready(function(){ $(div#button1).click(function(){ $(#box).animate({ margin-left : 150px }); }); $(div#button2).click(function(){ $(#box).animate({ width : 500px }); }); }); /script I started button1 animation, If I click button2,box must stop animate1 and start animate2. How can I do this?
[jQuery] Re: Malsup FormPlugin - doesn't Ajax!
can you not set the form to display:none through the javascript? Anxiro wrote: Hi there! I'm using the Form Plugin by Malsup (http://malsup.com/jquery/form/). I'm using this a lot, so I'm used to all the configs and settings. That's not a problem. My problem is, that my DIV (where the FORM is in) has the style: 'display:none'. This is causing the plugin to NOT ajaxForm() it and I'm realy stuck with this. So the form is submitting as a normal form, not Ajax. The 'website' is running on our local servers. Can anyone help me with this? Is there a solution available? Thank you! Frank
[jQuery] Re: How to POST using jQuery?
well, on the post callback, forward the browser to the page? window.location=/page.php Mark Smith wrote: Hi, I know you can use jquery to post data from a json object ajaxly. However I want to redirect the browser to the new page (like submitting a form) only passing the values explicitly from javascript rather than actually submitting a form. Is this possible using jquery? Thanks
[jQuery] Re: How to POST using jQuery?
He's not using a form at all in this, I don't know why. Michael Price wrote: Is there any particular reason you HAVE to use Javascript to handle the form submission? If you want to redirect the user to another page after the form submission you may as well submit the form the normal way and use a server side redirect to send them on to the next page. Failing that, you could make your form processing script return the next page in it's response, parse for this and then use it - is that feasible? SUBMIT FORM PARSE RESPONSE WHICH WILL CONTAIN NEW PAGE URL IN IT window.location = newPage; Regards, Michael Price -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mark Smith Sent: 12 August 2009 16:02 To: jQuery (English) Subject: [jQuery] Re: How to POST using jQuery? But then the page that gets served to the user with have no parameters posted to it. On Aug 12, 3:50 pm, Liam Potter radioactiv...@gmail.com wrote: well, on the post callback, forward the browser to the page? window.location=/page.php Mark Smith wrote: Hi, I know you can use jquery to post data from a json object ajaxly. However I want to redirect the browser to the new page (like submitting a form) only passing the values explicitly from javascript rather than actually submitting a form. Is this possible using jquery? Thanks
[jQuery] Re: Error when trying to download jquery
you don't open and run jquery...what are you attempting here? mrbutler wrote: IE7 version 7.0.5730.11 Open and run jquery-1.3.2.min.js Error pops up: --- Windows Script Host --- Script: C:\Documents and Settings\it.mjb\Local Settings\Temporary Internet Files\Content.IE5\F59KSW92\jquery-1.3.2.min[1].js Line: 12 Char: 6947 Error: 'document' is undefined Code: 800A1391 Source: Microsoft JScript runtime error --- OK --- On Aug 12, 8:12 am, Richard D. Worth rdwo...@gmail.com wrote: Can you share some more details, and maybe a sample page? What browser(s) are you using? Could you put together the code you're trying on jsbin.com, so we can see what you're seeing:http://jsbin.com/ - Richard On Wed, Aug 12, 2009 at 9:00 AM, mrbutler mrbut...@4state.com wrote: Still the same error when I run from either of the links. On Aug 12, 2:29 am, Richard D. Worth rdwo...@gmail.com wrote: I didn't have the same issue. Anyway, here are the direct links, for download: Minified:http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js Uncompressed:http://jqueryjs.googlecode.com/files/jquery-1.3.2.js - Richard On Tue, Aug 11, 2009 at 3:32 PM, mrbutler mrbut...@4state.com wrote: I receive an error: 'document' is undefined, when I try to run the jquery download.- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: add class and remove class from perspective element
img class=images img class=images img class=images $(function(){ $(img.images).click(function(){ $(img.images).css({border:'none'}); $(this).css({border:'1px solid #f00'}); }); }); runrunforest wrote: Hi, I have 3 image, in turn called img1, img2, img3. I need a code snippet that will add a border to the image when it is clicked, and if I click the other image, the border will disappear, the newly clicked image will have a border. For short, only image has border at a time and only the image that got click last will have border. Can you show me the technique to do this
[jQuery] Re: Add extra content to the title attribute
something like this var origTitle = $(a.newWindow).attr(title); $(a.newWindow).attr(title, origTitle+ - This link will open in a new window); Paul Collins wrote: Hi all, This is hopefully simple. I have a bunch of links with titles, like TITLE=Facebook and so on. I am adding JQuery to make the links open in a new window and would like to add some text to the title that says this link will open in a new window, whilst keeping the original text. I'm using the add JQuery command, but this actually replaces the original title text. $(a.newWindow).attr(title, - This link will open in a new window); The end result I would like to have is: title=Facebook - This link will open in a new window. Could anyone point me in the right direction?! Cheers
[jQuery] Re: Refresh DIV with full page refresh
Be nice :p, obviously his first language is not English. you should be using jQuery's ajax functions. http://docs.jquery.com/Ajax Charlie wrote: $(div).refresh() that function should give you as much success as trying to understand the *details* of your request. bharani kumar wrote: We can refresh one DIV jquery script, wiht out entire page refresh ... On Tue, Aug 11, 2009 at 6:30 PM, Dhruva Sagar dhruva.sa...@gmail.com mailto:dhruva.sa...@gmail.com wrote: What exactly do you mean by 'refresh DIV' ? If you want to get some content in the page and update the DIV without loading/refreshing the entire page, then you should use ajax calls to your server. If you can explain what you want in a bit more detail perhaps I could help you a bit more. Thanks Regards, Dhruva Sagar. Ogden Nash http://www.brainyquote.com/quotes/authors/o/ogden_nash.html - The trouble with a kitten is that when it grows up, it's always a cat. On Tue, Aug 11, 2009 at 6:28 PM, bharani kumar bharanikumariyer...@gmail.com mailto:bharanikumariyer...@gmail.com wrote: Hi All , How to refresh DIV , without refresh entire page, Am having four DIV , DIV1,DIV2,DIV3,DIV4 I want to refresh only DIV! without affecting the DIV3,DIV4 , Thanks -- Regards B.S.Bharanikumar http://php-mysql-jquery.blogspot.com/
[jQuery] Re: How to specify a default value...
Your concatenation is broke, (I'm assuming the logic behind this is actually working) this ' + (row[19] ? '+ row[19] + ' : 'N/A') + ' should be ' + (row[19] ? ''+ row[19] + '' : 'N/A') + ' As for what is going on here, it's just an if statement shortened down, and could be written like this if ( row[19] ) { row[19] } else { N/A } Rick Faircloth wrote: Well..another unexpected result… When the inline conditional: ’ + (row[19] ? ‘ + row[19] + ‘ : ‘N/A’) + ‘ is used when a **value is present** in row[19], I get this as the output: + row[19] + instead of the actual value. If I remove the quotes from ‘ + row[19] + ‘, I get a syntax error. However, if **no value is present** in row[19], I get N/A as the output, which is expected. So, the conditional is working if no value is present, but outputting the literal string + row[19] + if a value is not present. Assistance in understanding, anyone? Thanks, Rick *From:* jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] *On Behalf Of *Rick Faircloth *Sent:* Tuesday, August 11, 2009 11:00 AM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: How to specify a default value... Well…to answer my own question…I found this works: out.push('lispan class=spanLeftPet Deposit/spanspan class=spanRight' + (row[19] ? ' + row[19] + ' : 'N/A') + '/span/li'); But how does the conditional know whether a Boolean is being checked, as in: ’ + (row[19] ? ‘Yes’ : ‘No’) + ‘ Or whether the presence of a value is being checked, as in: ’ + (row[19] ? ‘ + row[19] + ‘ : ‘N/A’) + ‘ What’s the logic that’s occurring behind the statements to differentiate? Thanks for any insight… Rick *From:* jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] *On Behalf Of *Rick Faircloth *Sent:* Tuesday, August 11, 2009 10:39 AM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] How to specify a default value... I was shown how to use this inline condition for creating yes/no Boolean values instead of the normal true/false values javascript uses: span class=spanRight' + (row[20] ? 'Yes' : 'No') + '/span I’d like to know if there’s an equivalent inline method for providing a default value when no value is present, such as: span class=”spanRight”’ + (row[20] ? ‘NORMAL ROW[20] VALUE’ : ‘N/A’) + ‘/span Basically, if there’s no value in the current row as position 20, then just us ‘N/A’. Is this possible with a simple inline condition, too? Thanks, Rick -- /Ninety percent of the politicians give the other ten percent a bad reputation. - Henry Kissinger/
[jQuery] Re: How to specify a default value...
oi, don't be skipping over my answers :p lol Rick Faircloth wrote: And finally, to continue today’s live, public coding experiments… The answer appears to be that a second set of ‘ ‘ are needed for the conditional: ’ (row[19] ? ‘ ‘ + row[19] + ‘ ‘ : ‘N/A’) + ‘ Instead of: ’(row[19] ? ‘ + row[19] + ‘ : ‘N/A’) + ‘ The first way works with both Boolean and null checks, whereas the second way works properly only with Boolean. Sorry to use up to much list-time to answer my own questions, but hopefully this will help someone as an “impromptu tutorial”… Rick *From:* jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] *On Behalf Of *Rick Faircloth *Sent:* Tuesday, August 11, 2009 11:18 AM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: How to specify a default value... Well..another unexpected result… When the inline conditional: ’ + (row[19] ? ‘ + row[19] + ‘ : ‘N/A’) + ‘ is used when a **value is present** in row[19], I get this as the output: + row[19] + instead of the actual value. If I remove the quotes from ‘ + row[19] + ‘, I get a syntax error. However, if **no value is present** in row[19], I get N/A as the output, which is expected. So, the conditional is working if no value is present, but outputting the literal string + row[19] + if a value is not present. Assistance in understanding, anyone? Thanks, Rick *From:* jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] *On Behalf Of *Rick Faircloth *Sent:* Tuesday, August 11, 2009 11:00 AM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: How to specify a default value... Well…to answer my own question…I found this works: out.push('lispan class=spanLeftPet Deposit/spanspan class=spanRight' + (row[19] ? ' + row[19] + ' : 'N/A') + '/span/li'); But how does the conditional know whether a Boolean is being checked, as in: ’ + (row[19] ? ‘Yes’ : ‘No’) + ‘ Or whether the presence of a value is being checked, as in: ’ + (row[19] ? ‘ + row[19] + ‘ : ‘N/A’) + ‘ What’s the logic that’s occurring behind the statements to differentiate? Thanks for any insight… Rick *From:* jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] *On Behalf Of *Rick Faircloth *Sent:* Tuesday, August 11, 2009 10:39 AM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] How to specify a default value... I was shown how to use this inline condition for creating yes/no Boolean values instead of the normal true/false values javascript uses: span class=spanRight' + (row[20] ? 'Yes' : 'No') + '/span I’d like to know if there’s an equivalent inline method for providing a default value when no value is present, such as: span class=”spanRight”’ + (row[20] ? ‘NORMAL ROW[20] VALUE’ : ‘N/A’) + ‘/span Basically, if there’s no value in the current row as position 20, then just us ‘N/A’. Is this possible with a simple inline condition, too? Thanks, Rick -- /Ninety percent of the politicians give the other ten percent a bad reputation. - Henry Kissinger/
[jQuery] Re: attr doesn't work in IE6 and Chromium
wow... I'm not even sure what your are trying to achieve with thisno need for doing this through the onclick attribute, and I can't think why you are trying to set the onclick with some javascript? Julijan Andjelic wrote: script type=text/javascript $(#sitemap a:eq(1)).attr(onclick,$('#sitemap a:eq(2)').text(''); sch('brands', '?echo $data[0][brand].');?).text( / ?echo $data [0][brand];?); $(#sitemap a:eq(2)).attr(onclick, $('#sitemap a:eq(1)').text(''); sch('categories', '?echo $data[0][category].');?).text( / ? echo $data[0][category];?); /script This works perfectly in Firefox and Opera, but Chromium and IE6 only change the text to value of $data[0][brand/category] (which is a string) and seem to ignore the onclick attr, any ideas?
[jQuery] Re: How to specify a default value...
Hi Rick, I think these explanations are correct, if not someone else should correct me :p so, row[19] is kind of like an object and it contains the value of whatever row[19] is. so lets say row[19] is this divHello/div In your 'Boolean' example, this is what is happening If row[19] exists in the dom, print 'Yes', if not print 'No' Now in the 'non-null' example, essentially the exact same check is happening, but you have replaced Yes with the row[19] object, which contains the value of Hello, so we get this If row[19] exists in the dom, print row[19]'s value, if not print 'N/A' So, you can see, the second example is not checking if row[19] has a value, but whether or not it exists at all. Now, I would take this with a pinch of salt, as my programming theory is poor at best, but this is what I think is happening. - Liam Rick Faircloth wrote: Thanks, Liam... You'll see in my answers to my own posts that I finally figured out the extra set of quotes was needed. What I still don't understand is even how this logic works: if ( row[19] ) { row[19] } else { N/A } As a non-null check, it seems the statement would need to be asking: if there is a value at row[19], use that value...otherwise us 'N/A' As a Boolean check, the statement would be: if ( row[19] == 'true' ) { 'Yes' } else { 'No' } (Assuming I wrote that correctly...) It seems the statement would be asking: if the value at row[19] is 'true', use 'Yes' as the output value, otherwise, use 'No' In other words, how does the conditional know what's being asked in the shorthand version? ' + (row[19] ? '' + row[19] + '' : 'N/A') + ' That first part: ' + row[19] ? ' works the same for both value checks and Boolean checks. How? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Liam Potter Sent: Tuesday, August 11, 2009 11:24 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: How to specify a default value... Your concatenation is broke, (I'm assuming the logic behind this is actually working) this ' + (row[19] ? '+ row[19] + ' : 'N/A') + ' should be ' + (row[19] ? ''+ row[19] + '' : 'N/A') + ' As for what is going on here, it's just an if statement shortened down, and could be written like this if ( row[19] ) { row[19] } else { N/A } Rick Faircloth wrote: Well..another unexpected result. When the inline conditional: ' + (row[19] ? ' + row[19] + ' : 'N/A') + ' is used when a **value is present** in row[19], I get this as the output: + row[19] + instead of the actual value. If I remove the quotes from ' + row[19] + ', I get a syntax error. However, if **no value is present** in row[19], I get N/A as the output, which is expected. So, the conditional is working if no value is present, but outputting the literal string + row[19] + if a value is not present. Assistance in understanding, anyone? Thanks, Rick *From:* jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] *On Behalf Of *Rick Faircloth *Sent:* Tuesday, August 11, 2009 11:00 AM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: How to specify a default value... Well.to answer my own question.I found this works: out.push('lispan class=spanLeftPet Deposit/spanspan class=spanRight' + (row[19] ? ' + row[19] + ' : 'N/A') + '/span/li'); But how does the conditional know whether a Boolean is being checked, as in: ' + (row[19] ? 'Yes' : 'No') + ' Or whether the presence of a value is being checked, as in: ' + (row[19] ? ' + row[19] + ' : 'N/A') + ' What's the logic that's occurring behind the statements to differentiate? Thanks for any insight. Rick *From:* jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] *On Behalf Of *Rick Faircloth *Sent:* Tuesday, August 11, 2009 10:39 AM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] How to specify a default value... I was shown how to use this inline condition for creating yes/no Boolean values instead of the normal true/false values javascript uses: span class=spanRight' + (row[20] ? 'Yes' : 'No') + '/span I'd like to know if there's an equivalent inline method for providing a default value when no value is present, such as: span class=spanRight' + (row[20] ? 'NORMAL ROW[20] VALUE' : 'N/A') + '/span Basically, if there's no value in the current row as position 20, then just us 'N/A'. Is this possible with a simple inline condition, too? Thanks, Rick -- /Ninety percent of the politicians give the other ten percent a bad reputation. - Henry Kissinger/
[jQuery] Re: Fade in / Out
$(div).fadeIn(300).animate({opacity:1},5000).fadeOut(300); Dave Maharaj :: WidePixels.com wrote: I was wondering how do you make text fade in for a specific amount of time then fade out. I have the fade in / out part..i just cant figure out the duration so it stays there after fading in for 5 seconds then fades out. Dave
[jQuery] Re: HTML5 video tag available?
try it? quiKe wrote: Hi, do you know if it is possible to use selectors for a video tag? For example: $(this).find('div.misc').find('ul').addClass('thumb-fila').find ('li').find('video').each(function(){ }); to capture the video tags on a li? Thanks
[jQuery] Re: jQuery animate marginTop jerky in IE
Have you tried animating just the top position instead? touch_the_sky wrote: Hi everyone! I have an issue with IE which has been driving me absolutely mad for like last 2 days. Basically all works awesome, crossbrowser, etc. apart from one floated div, when I am trying to animate it's margin-top on hover (move it down, when mouse go out - move it back up). All browsers perform the animation as a charm - slick, smooth, fast and cool looking, but IE has to be different, hasn't it? Anyways, I will copy and paste the markup, css script related to the issue. It's not all the template, to make it shorter I cut only the bits relating to #top_user div. I am using jQuery 1.3.2, XHTML1.0 strict (validates) and the background image is a transparent png32 if that helps. The easing plugin I added just recently hoping it's gonna prevent the jerkiness in IE (it didn't) - so with or without it - it's crap in IE and great in anything else 1) Markup body div id=top div id=top1024 div id=top_user p/p /div /div /div /body 2) CSS body { width: 100%; height: 100%; background-color:#E4E4E4; margin: 0px; padding: 0px; font-family:Verdana, Geneva, sans-serif; font-size:12px; color:#333; } #top { height:248px; width:100%; background-image: url(/images/layout/top/top_background.png); background-repeat: repeat-x; } #top1024 { height:100%; width:1024px; float:left; } #top_user { width:514px; height:222px; background-image: url(/images/layout/top/user_cp.png); background-repeat: no-repeat; float:right; margin-top:-372px; padding:0px; /* The black bit appears as 35px height while hidden */ } #top_user p { color:#FFF; margin-top: 195px; text-indent: 40px; } 3) Script jQuery(#top_user).hover(function() { jQuery(this).animate({marginTop: '-300px'}, {duration: 300, easing: 'easeOutBounce'}); }, function() { jQuery(this).stop().animate({marginTop: '-372px'}, {duration: 300, easing: 'easeOutBounce'}); }); Any help is well appreciated as my frustration levels are unbelievable right now;) Cheers TouchTheSky
[jQuery] Re: HTML5 video tag available?
try adding document.createElement(video); before your jquery script quiKe wrote: tried (doesn´t work) but i wanted to know if maybe i was on a mistake. On Aug 7, 12:52 pm, Liam Potter radioactiv...@gmail.com wrote: try it? quiKe wrote: Hi, do you know if it is possible to use selectors for a video tag? For example: $(this).find('div.misc').find('ul').addClass('thumb-fila').find ('li').find('video').each(function(){ }); to capture the video tags on a li? Thanks
[jQuery] Re: Bug? -- toggle() of TR broke in IE8
Sorry about the hostility, was having a pretty stressful day and I didn't really look into the problem too much, so my apologies for that. Now that I've had a better look, it actually does look like a bug. If you enter a value to the toggle, IE8 will do something with the TR, but it ends up hiding at the end. You may want to post a bug report http://dev.jquery.com/report/ Fontzter wrote: Liam, Thanks for your input, we all know how irritating IE can be. However, there are a few things about this that puzzle me: * It works in IE6, IE7, FF, Chrome and Opera * It works with jQuery 1.2.6 * You can call show() and hide() on the TRs and it works in IE8 (see http://jsbin.com/ifiqa/edit ) For these reasons, I did not think it was inappropriate to ask (I did use a question mark in the subject) if this was a possible bug. Thanks, Dave On Aug 4, 11:18 am, Liam Potter radioactiv...@gmail.com wrote: It's down to the way IE handles tables, nothing to do with a jquery bug (people are so quick to shout out that word). Boiled down, you can't do a lot of things to tr's in IE, and display none is one of the things you can't change. - Liam Fontzter wrote: bump? Can anyone confirm this? On Jul 29, 9:52 am, Fontzter dmfo...@gmail.com wrote: I put together a simple case to demonstrate this:http://jsbin.com/ijini This works in other browsers but not IE8. Thanks, Dave
[jQuery] Re: xpath not returning objects
, in a big red box it says This is an old version of the *Selectors* API: *View the Current API http://docs.jquery.com/Selectors* Old Orange Juice wrote: IF that's the case, http://docs.jquery.com/DOM/Traversing/Selectors#Using_CSS_and_XPath_Together should be changed. That page says: Get the input field's value with the name of 'bar': $(inp...@name=bar]).val(); All checked radio buttons: $(inp...@type=radio][@checked]) it also says: e...@foo=bar] an E element whose foo attribute value is exactly equal to bar which is what I did.. Why all of a sudden Jquery doesn't use '@' in xpath expressions? Keep the docs up to date? Are there better up to date docs I should be looking at?? Thanks again for all the help.. very much appreciated :) On Aug 4, 8:35 pm, Jules jwira...@gmail.com wrote: jQuery does not recognise @ as attribute indicator. Just remove the @ from your code and enclose the attribute value with ': $(input:checkbox[name='media_type']).click(function() { if (this.checked == true) { alert('checkbox true'); $(div[class='mediafield']).hide ('fast'); }); On Aug 5, 7:55 am, Old Orange Juice kc2...@gmail.com wrote: I have a bunch of divs with the same classname, 'mediafield': div id=articles class=mediafieldSlug:/divbr div id=video class=mediafieldBig Blurb(Video)br/div div id=content_short class=mediafieldBig Blub(short content) br/div div id=audio class=mediafieldBig Blub(Audio)br/div div id=images class=mediafieldPhoto Uri(images):br/div and I have this jquery code in my header: script $(document).ready(function() { $(input:checkb...@name=media_type]).click(function() { if (this.checked == true) { alert('checkbox true'); $(d...@class=mediafield]).hide('fast'); });}); /script So I know that the click function is getting implemented.. The alert box appears however I get the following error in firebug: uncaught exception: Syntax error, unrecognized expression: [...@class=mediafield] Line 0 Nothing happens when firebug is turned off... So I'm not sure why it's throwing the error. Any help? Thanks, ooj
[jQuery] Filament Group date range picker
http://www.filamentgroup.com/lab/date_range_picker_using_jquery_ui_16_and_jquery_ui_css_framework/ Got a problem with the dateFormat options. I have it set the the uk date format (d/m/yy) and this outputs the date correctly, but I have two inputs with the initial values populated with todays date and last months date. When I click on the input and change the date, the calenders are reading the format wrong, where d = m and m = d. I've tried passing the format to the datepickerOptions object like so $(input#fromDate, input#toDate).daterangepicker({ dateFormat: 'd/m/yy', datepickerOptions: {dateFormat: 'd/m/yy'} }); Still no luck, anyone know how to sort this? Thanks, Liam
[jQuery] Re: Bug? -- toggle() of TR broke in IE8
It's down to the way IE handles tables, nothing to do with a jquery bug (people are so quick to shout out that word). Boiled down, you can't do a lot of things to tr's in IE, and display none is one of the things you can't change. - Liam Fontzter wrote: bump? Can anyone confirm this? On Jul 29, 9:52 am, Fontzter dmfo...@gmail.com wrote: I put together a simple case to demonstrate this:http://jsbin.com/ijini This works in other browsers but not IE8. Thanks, Dave
[jQuery] Re: Newbie Question
script type=text/javascript function _ajaxInit() { $(a.group).fancybox( { 'overlayShow': true }); }); window.onload = function () { $('.sliderGallery').each(function(){ var id_parts = $(this).attr('id').split('_'); var id = id_parts[id_parts.length - 1]; var container = $('#sliderGallery_' + id) ; var ul = $('ul', container); var itemsWidth = ul.innerWidth() - container.outerWidth(); $('.slider', container).slider({ min: 0, max: itemsWidth, handle: '.handle', stop: function (event, ui) { ul.animate({'left' : ui.value * -1}, 500); }, slide: function (event, ui) { ul.css('left', ui.value * -1); } }); }); } _ajaxInit(); /script if that doesn't work, call _ajaxInit() on the tabs callback function Dave Maharaj :: WidePixels.com wrote: I have a standard php page with some jquery going on its working fine. Now I want to take that page and load it into a div on a different page (tabbed layout pretty much) but when I do the script no longer works when the page loads into the div. SCRIPT CURRENTLY ON THE PHP PAGE THAT WORKS WHEN VIEWED DIRECTLY IN BROWSER script type=text/javascript $(document).ready(function() { $(a.group).fancybox( { 'overlayShow': true }); }); window.onload = function () { $('.sliderGallery').each(function(){ var id_parts = $(this).attr('id').split('_'); var id = id_parts[id_parts.length - 1]; var container = $('#sliderGallery_' + id) ; var ul = $('ul', container); var itemsWidth = ul.innerWidth() - container.outerWidth(); $('.slider', container).slider({ min: 0, max: itemsWidth, handle: '.handle', stop: function (event, ui) { ul.animate({'left' : ui.value * -1}, 500); }, slide: function (event, ui) { ul.css('left', ui.value * -1); } }); }); } /script How can I get it to still work when loaded into the DIV? Thanks Dave
[jQuery] Re: Newbie Question
yeah, use the modified script and add _ajaxInit(); to the callback; $('a.profile_data').click(function(){ var url = $(this).attr('href'); //alert(url); $('#loadHere').fadeOut('fast', function(){ $('#loadHere').load(url, function(){ $('#loadHere').fadeIn('fast'); _ajaxInit(); }); }); return false; }); Dave Maharaj :: WidePixels.com wrote: Nope...no go. All I have for the tabs are just straight links calling the script to load the page. $('a.profile_data').click(function(){ var url = $(this).attr('href'); //alert(url); $('#loadHere').fadeOut('fast', function(){ $('#loadHere').load(url, function(){ $('#loadHere').fadeIn('fast'); }); }); return false; }); Dave -Original Message- From: Liam Potter [mailto:radioactiv...@gmail.com] Sent: August-04-09 12:50 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Newbie Question script type=text/javascript function _ajaxInit() { $(a.group).fancybox( { 'overlayShow': true }); }); window.onload = function () { $('.sliderGallery').each(function(){ var id_parts = $(this).attr('id').split('_'); var id = id_parts[id_parts.length - 1]; var container = $('#sliderGallery_' + id) ; var ul = $('ul', container); var itemsWidth = ul.innerWidth() - container.outerWidth(); $('.slider', container).slider({ min: 0, max: itemsWidth, handle: '.handle', stop: function (event, ui) { ul.animate({'left' : ui.value * -1}, 500); }, slide: function (event, ui) { ul.css('left', ui.value * -1); } }); }); } _ajaxInit(); /script if that doesn't work, call _ajaxInit() on the tabs callback function Dave Maharaj :: WidePixels.com wrote: I have a standard php page with some jquery going on its working fine. Now I want to take that page and load it into a div on a different page (tabbed layout pretty much) but when I do the script no longer works when the page loads into the div. SCRIPT CURRENTLY ON THE PHP PAGE THAT WORKS WHEN VIEWED DIRECTLY IN BROWSER script type=text/javascript $(document).ready(function() { $(a.group).fancybox( { 'overlayShow': true }); }); window.onload = function () { $('.sliderGallery').each(function(){ var id_parts = $(this).attr('id').split('_'); var id = id_parts[id_parts.length - 1]; var container = $('#sliderGallery_' + id) ; var ul = $('ul', container); var itemsWidth = ul.innerWidth() - container.outerWidth(); $('.slider', container).slider({ min: 0, max: itemsWidth, handle: '.handle', stop: function (event, ui) { ul.animate({'left' : ui.value * -1}, 500); }, slide: function (event, ui) { ul.css('left', ui.value * -1); } }); }); } /script How can I get it to still work when loaded into the DIV? Thanks Dave
[jQuery] Re: Google Maps inside jqModal
can you post an example? anush wrote: Has anybody tried embedding Google Maps inside jqModal ? The maps aren't getting displayed properly. $().ready(function() { $('#dialog').jqm(); }); Would be great of somebody could help me out
[jQuery] Re: Newbie Question
Have you updated the original script to my one? script type=text/javascript function _ajaxInit() { $(a.group).fancybox( { 'overlayShow': true }); }); window.onload = function () { $('.sliderGallery').each(function(){ var id_parts = $(this).attr('id').split('_'); var id = id_parts[id_parts.length - 1]; var container = $('#sliderGallery_' + id) ; var ul = $('ul', container); var itemsWidth = ul.innerWidth() - container.outerWidth(); $('.slider', container).slider({ min: 0, max: itemsWidth, handle: '.handle', stop: function (event, ui) { ul.animate({'left' : ui.value * -1}, 500); }, slide: function (event, ui) { ul.css('left', ui.value * -1); } }); }); } /script Dave Maharaj :: WidePixels.com wrote: 3 Errors syntax error [Break on this error] });\n (line 167) syntax error [Break on this error] });\n (line 6) _ajaxInit is not defined [Break on this error] _ajaxInit();\n That's what I see now but still nothing good happening. dave -Original Message- From: Liam Potter [mailto:radioactiv...@gmail.com] Sent: August-04-09 1:19 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Newbie Question yeah, use the modified script and add _ajaxInit(); to the callback; $('a.profile_data').click(function(){ var url = $(this).attr('href'); //alert(url); $('#loadHere').fadeOut('fast', function(){ $('#loadHere').load(url, function(){ $('#loadHere').fadeIn('fast'); _ajaxInit(); }); }); return false; }); Dave Maharaj :: WidePixels.com wrote: Nope...no go. All I have for the tabs are just straight links calling the script to load the page. $('a.profile_data').click(function(){ var url = $(this).attr('href'); //alert(url); $('#loadHere').fadeOut('fast', function(){ $('#loadHere').load(url, function(){ $('#loadHere').fadeIn('fast'); }); }); return false; }); Dave -Original Message- From: Liam Potter [mailto:radioactiv...@gmail.com] Sent: August-04-09 12:50 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Newbie Question script type=text/javascript function _ajaxInit() { $(a.group).fancybox( { 'overlayShow': true }); }); window.onload = function () { $('.sliderGallery').each(function(){ var id_parts = $(this).attr('id').split('_'); var id = id_parts[id_parts.length - 1]; var container = $('#sliderGallery_' + id) ; var ul = $('ul', container); var itemsWidth = ul.innerWidth() - container.outerWidth(); $('.slider', container).slider({ min: 0, max: itemsWidth, handle: '.handle', stop: function (event, ui) { ul.animate({'left' : ui.value * -1}, 500); }, slide: function (event, ui) { ul.css('left', ui.value * -1); } }); }); } _ajaxInit(); /script if that doesn't work, call _ajaxInit() on the tabs callback function Dave Maharaj :: WidePixels.com wrote: I have a standard php page with some jquery going on its working fine. Now I want to take that page and load it into a div on a different page (tabbed layout pretty much) but when I do the script no longer works when the page loads into the div. SCRIPT CURRENTLY ON THE PHP PAGE THAT WORKS WHEN VIEWED DIRECTLY IN BROWSER script type=text/javascript $(document).ready(function() { $(a.group).fancybox( { 'overlayShow': true }); }); window.onload = function () { $('.sliderGallery').each(function(){ var id_parts = $(this).attr('id').split('_'); var id = id_parts[id_parts.length - 1]; var container = $('#sliderGallery_' + id) ; var ul = $('ul', container); var itemsWidth = ul.innerWidth() - container.outerWidth(); $('.slider', container).slider({ min: 0, max: itemsWidth, handle: '.handle', stop: function (event, ui) { ul.animate({'left' : ui.value * -1}, 500); }, slide: function (event, ui) { ul.css('left', ui.value * -1); } }); }); } /script How can I get it to still work when loaded into the DIV? Thanks Dave
[jQuery] Re: On mouse events / style switch
$(div).toggleClass('className'); http://docs.jquery.com/Main_Page Everything you need right now is in there, only ask questions if it isn't on there, or google. I'm not trying to be an ass but too many people expect to have their hand held while learning anything, and being told the answers all the time isn't fun, you miss out on that eureka feeling. Nothing better then being stuck for an hour or so, then just having that idea hit you and away you go fixing your problems. Aaron Johnson wrote: Hi Is it possible to do an 'on click' event that changes a css selector, then an 'off click' that switches it back? I am working on a touch screen app and need to replicate a css hover state. If anyone can point me towards an example or a tutorial, I 'd really appreciate it. Thanks! A
[jQuery] Re: Newbie Question
Do you have an online example so I can get a better picture of just what you are trying to do? Dave Maharaj :: WidePixels.com wrote: Yes I have. Might be dumb of me but I will ask. Originally the script type=text/javascript /script and the needed js files were on the page specifically needing it. But now that I am loading that page into one... Where do the scripts and files go? Do they now go to the page that they will be loaded into or do they stay on their own original page? Page 1 page1.js script type=text/javascript /script Page 2 page2.js script type=text/javascript /script Since Page 2 is going to be loaded into page 1 DIV do I move the page2 scripts to page 1? Dave -Original Message- From: Liam Potter [mailto:radioactiv...@gmail.com] Sent: August-04-09 1:34 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Newbie Question Have you updated the original script to my one? script type=text/javascript function _ajaxInit() { $(a.group).fancybox( { 'overlayShow': true }); }); window.onload = function () { $('.sliderGallery').each(function(){ var id_parts = $(this).attr('id').split('_'); var id = id_parts[id_parts.length - 1]; var container = $('#sliderGallery_' + id) ; var ul = $('ul', container); var itemsWidth = ul.innerWidth() - container.outerWidth(); $('.slider', container).slider({ min: 0, max: itemsWidth, handle: '.handle', stop: function (event, ui) { ul.animate({'left' : ui.value * -1}, 500); }, slide: function (event, ui) { ul.css('left', ui.value * -1); } }); }); } /script Dave Maharaj :: WidePixels.com wrote: 3 Errors syntax error [Break on this error] });\n (line 167) syntax error [Break on this error] });\n (line 6) _ajaxInit is not defined [Break on this error] _ajaxInit();\n That's what I see now but still nothing good happening. dave -Original Message- From: Liam Potter [mailto:radioactiv...@gmail.com] Sent: August-04-09 1:19 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Newbie Question yeah, use the modified script and add _ajaxInit(); to the callback; $('a.profile_data').click(function(){ var url = $(this).attr('href'); //alert(url); $('#loadHere').fadeOut('fast', function(){ $('#loadHere').load(url, function(){ $('#loadHere').fadeIn('fast'); _ajaxInit(); }); }); return false; }); Dave Maharaj :: WidePixels.com wrote: Nope...no go. All I have for the tabs are just straight links calling the script to load the page. $('a.profile_data').click(function(){ var url = $(this).attr('href'); //alert(url); $('#loadHere').fadeOut('fast', function(){ $('#loadHere').load(url, function(){ $('#loadHere').fadeIn('fast'); }); }); return false; }); Dave -Original Message- From: Liam Potter [mailto:radioactiv...@gmail.com] Sent: August-04-09 12:50 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Newbie Question script type=text/javascript function _ajaxInit() { $(a.group).fancybox( { 'overlayShow': true }); }); window.onload = function () { $('.sliderGallery').each(function(){ var id_parts = $(this).attr('id').split('_'); var id = id_parts[id_parts.length - 1]; var container = $('#sliderGallery_' + id) ; var ul = $('ul', container); var itemsWidth = ul.innerWidth() - container.outerWidth(); $('.slider', container).slider({ min: 0, max: itemsWidth, handle: '.handle', stop: function (event, ui) { ul.animate({'left' : ui.value * -1}, 500); }, slide: function (event, ui) { ul.css('left', ui.value * -1); } }); }); } _ajaxInit(); /script if that doesn't work, call _ajaxInit() on the tabs callback function Dave Maharaj :: WidePixels.com wrote: I have a standard php page with some jquery going on its working fine. Now I want to take that page and load it into a div on a different page (tabbed layout pretty much) but when I do the script no longer works when the page loads into the div. SCRIPT CURRENTLY ON THE PHP PAGE THAT WORKS WHEN VIEWED DIRECTLY IN BROWSER script type=text/javascript $(document).ready(function() { $(a.group).fancybox( { 'overlayShow': true }); }); window.onload = function
[jQuery] Re: a select question
I think he just wants to select anything without a certain class eg $(div:not('.abc')) Michael Lawson wrote: mmm a little more information in regards to what exactly you want to do but $('div').eq(i); where i is the index of the div you want to access alternatively you could also do $('div:eq(i)'); cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Whether one believes in a religion or not, and whether one believes in rebirth or not, there isn't anyone who doesn't appreciate kindness and compassion..' Inactive hide details for David .Wu ---08/03/2009 09:37:41 AM---if I have 3 div, how to filter the div without class abc?David .Wu ---08/03/2009 09:37:41 AM---if I have 3 div, how to filter the div without class abc? From: David .Wu chan1...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Date: 08/03/2009 09:37 AM Subject: [jQuery] a select question if I have 3 div, how to filter the div without class abc? div/div div class=abc/div div/div
[jQuery] Lazy Load plugin
Hi All, The www.appelsiini.com site is down, and I can't find any where else to download it. Can someone who has to full package (looking for uncompressed code to study) upload it somewhere for me to download from please. Thanks, - Liam
[jQuery] Re: jqm and livequery issue
uncomment the return false jjshell wrote: Hi, Please consider the code below. It should open a modal everytime a link of a given class is clicked. But... it does not. //get the url of the link clicked var url; $('a.edit').livequery('click',function(){ url= $(this).attr('href'); }); //initiate the modal box $('#modal-test').jqm({ ajax: '@href', trigger: false; onHide: function(h) { url = url + 'removeSession/edit/';//remove session $.get(url); h.o.remove(); // remove overlay h.w.fadeOut(0.88); // hide window }, }); //now display the modal $('a.edit').livequery('click',function(){ $('#modal-test').jqmShow(); //return false; }); When a link of class .edit is clicked, the overlay covers the page for an instant, then a redirect occurs to the page that should be loaded in the modal box (instead of the page being loaded in the modal). It's probably a small mistake as I can get it working the way I want using jqm 'trigger:a.edit'. The problem with this approach is that I lose the livequery power (links from ajax loaded content won't fire jqm). Thanks in advance for your help. Regards, -jj. :)
[jQuery] Re: Advice needed on jQuery page to be built
Hi gnet, I've not really done much with arrays, so this is more theory but you should be able to build upon it. You will need a separate file, that you will be sending the ajax requests to, and the html it returns should be printed in the divs using the success callback on the ajax method. first, you need to echo the array as links, and have the id set as the array key then the javascript would be something like $(a.array).click(function(){ var arrayKey = $(this).attr(id); $.ajax({ type: POST, url: arrays.php, data: arrKey=+arrayKey, success: function(html){ $(div.result).append(html); } }); }); Like I said, no idea if this would work, as I don't have a lot of experience with arrays, but see what you can do with it. - Liam gnetcon wrote: Liam: Thanks for the feedback! I have my page built, with the array created and it populates my second pane fine with data from the first array item (1 of 100). What I'm having difficulty wrapping my brain around is how to update the second div, passing an array key to re-populate the div w/out reloading the page. Is that possible? OR do I need to have a separate page that would accept the key and simply return the HTML to display in the contents of that div? Example: If a user selected the 5th row of data in pane #1, I then need to update pane #2/3 with the data from the PHP array key of 4 ($arrXML[4]). TIA! Liam Potter wrote: divs, updated using ajax.
[jQuery] Re: Advice needed on jQuery page to be built
just seen Brian's solution, which is similar but cleaner, don't know why I didn't think of just leaving the data in the href. Liam Potter wrote: Hi gnet, I've not really done much with arrays, so this is more theory but you should be able to build upon it. You will need a separate file, that you will be sending the ajax requests to, and the html it returns should be printed in the divs using the success callback on the ajax method. first, you need to echo the array as links, and have the id set as the array key then the javascript would be something like $(a.array).click(function(){ var arrayKey = $(this).attr(id); $.ajax({ type: POST, url: arrays.php, data: arrKey=+arrayKey, success: function(html){ $(div.result).append(html); } }); }); Like I said, no idea if this would work, as I don't have a lot of experience with arrays, but see what you can do with it. - Liam gnetcon wrote: Liam: Thanks for the feedback! I have my page built, with the array created and it populates my second pane fine with data from the first array item (1 of 100). What I'm having difficulty wrapping my brain around is how to update the second div, passing an array key to re-populate the div w/out reloading the page. Is that possible? OR do I need to have a separate page that would accept the key and simply return the HTML to display in the contents of that div? Example: If a user selected the 5th row of data in pane #1, I then need to update pane #2/3 with the data from the PHP array key of 4 ($arrXML[4]). TIA! Liam Potter wrote: divs, updated using ajax.
[jQuery] Re: can i use .load to return HTML but not inject in to dom?
$.load(../+myModule+/+navTitle+/folders/index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); try that robing wrote: I don't know if this is possible or not but i would like to use the .load method to return the contents of a file but not inject the code in to the dom because i want to use .replaceWith ( returnedLoadData ). here is what i have tried so far and i can return the data to e but the return false isn't preventing the return data from being injected in to #folders. $('#folders').load(../+myModule+/+navTitle+/folders/ index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); does anyone know of a way to do this?
[jQuery] Re: can i use .load to return HTML but not inject in to dom?
then I'd say use the ajax function. http://docs.jquery.com/Ajax/jQuery.ajax#options robing wrote: Hi Liam, i got $.load is not a function, any other suggestions?? On Jul 29, 9:57 pm, Liam Potter radioactiv...@gmail.com wrote: $.load(../+myModule+/+navTitle+/folders/index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); try that robing wrote: I don't know if this is possible or not but i would like to use the .load method to return the contents of a file but not inject the code in to the dom because i want to use .replaceWith ( returnedLoadData ). here is what i have tried so far and i can return the data to e but the return false isn't preventing the return data from being injected in to #folders. $('#folders').load(../+myModule+/+navTitle+/folders/ index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); does anyone know of a way to do this?
[jQuery] Re: stop jquery script until image is load
not tried this, but I'm assuming. $(img).ready(function(){ // do stuff here }); Matthieu wrote: Hi Id like to now if its possible to stop a jquery script and continue it only when an image is load and disolayed? thks
[jQuery] Re: jqm and livequery issue
take the variables out of the quotes, you're just passing strings. that should sort it out. jjshell wrote: Thanks for your answer. I did it. Now livequery is applied as expected, and the redirect issue has disappeared. But... the ajax content never gets loaded into the modal box. Yet the modal box opens. It just doesn't get loaded with any content. If I use {ajax: 'url'} it gets loaded, but the query string doesn't seem to pass to the server... (yet when I alert() it, the url variable displays the expected url, with the query string and everything). Here's my code: var url; $('a.edit').livequery('click',function(){ url = $(this).attr('href'); return false; }); $('#modal-test').jqm({ //ajax: 'url',//for testing.. loads the html content, but the queryString is ignored for some strange reasons. ajax: '@href', //never gets loaded ajaxText: 'img src=http://localhost/troglodytes_public/images/ajax- loader.gif /', //this turns endlessly, no ajax loaded content replaces it. onHide: function(h) { url= url + 'session/close/'; $.get(url); h.o.remove(); // remove overlay h.w.fadeOut(1); // hide window }, }); $('a.edit').livequery('click',function(){ $('#modal-test').jqmShow(); return false; }); On 29 juil, 10:44, Liam Potter radioactiv...@gmail.com wrote: uncomment the return false jjshell wrote: Hi, Please consider the code below. It should open a modal everytime a link of a given class is clicked. But... it does not. //get the url of the link clicked var url; $('a.edit').livequery('click',function(){ url= $(this).attr('href'); }); //initiate the modal box $('#modal-test').jqm({ ajax: '@href', trigger: false; onHide: function(h) { url = url + 'removeSession/edit/';//remove session $.get(url); h.o.remove(); // remove overlay h.w.fadeOut(0.88); // hide window }, }); //now display the modal $('a.edit').livequery('click',function(){ $('#modal-test').jqmShow(); //return false; }); When a link of class .edit is clicked, the overlay covers the page for an instant, then a redirect occurs to the page that should be loaded in the modal box (instead of the page being loaded in the modal). It's probably a small mistake as I can get it working the way I want using jqm 'trigger:a.edit'. The problem with this approach is that I lose the livequery power (links from ajax loaded content won't fire jqm). Thanks in advance for your help. Regards, -jj. :)- Masquer le texte des messages précédents - - Afficher le texte des messages précédents -