[jQuery] format number
How can i make 1500 look like 15,000,000 and 1500.00 look like 15,000,000.00 ?
[jQuery] Re: jQuery - Random Selection
On Oct 4, 2:45 pm, RobG wrote: [...] > which is the same as using Math.floor. To return a random integer > between 0 and n, use: That should have been: between 0 and n-1 inclusive. > > function getRandomInt(n) { > return Math.random()*n | 0; > } > > -- > Rob
[jQuery] Re: jQuery - Random Selection
On Oct 4, 7:06 am, Charlie wrote: > put all the bios in containers with same class, use javascript random() > function to create a random index to show one of the bios > $('.bioClass').hide() > var bioIndex=Math.round(Math.random()*5) Using that formula, indices 0 and 5 have only half the chance of being returned as indices 1 to 4, so not a very random selection. Use floor or ceil for an even distribution, for speed use: var bioIndex = (Math.random()*6) | 0; which is the same as using Math.floor. To return a random integer between 0 and n, use: function getRandomInt(n) { return Math.random()*n | 0; } -- Rob
[jQuery] Help adding a timer to the innerFade plugin ?
Hi everybody. I'm using the innerFade plug in [1] as a news ticker on my site [2], but it will be more usable if i show in a corner of the news area a timer that says to the visitor how much time (in seconds) must wait before it shows the next news. Somebody has done something like this with this plug in? What do you suggest? Thanks in advance for all your help. [1] http://medienfreunde.com/lab/innerfade/ [2] http://www.alexertech.com/ -- Alex Barrios
[jQuery] Plugin for Complex Forms with Dependent Elements?
Hi all, I'm looking for a JQuery/Ajax plugin for a form I'm building on a Rails site. I've come across a good deal of resources, but still looking for something that matches my needs. I'm new enough to coding that rolling my own isn't realistic. Here's what I'm trying to do: - User selects a product from a pre-populated list. They can't add new ones. - The selected product triggers a set of varieties that are dependent on the particular product chosen. The user may select (i) no varieties, (ii) one or more varieties, or (iii) add a new variety. I've found a couple plugins that get close, but don't quite support this. http://www.ajaxray.com/blog/2007/11/08/jquery-controlled-dependent-or-cascading-select-list-2/ http://www.ryancramer.com/journal/entries/asmselect_v104/ http://www.jgeppert.com/jquery-doubleselect/ I appreciate any tips for plugins that support what I need, or feedback on how I can modify a plugin to support it. Thanks!
[jQuery] $ not recognized even though jQuery library referenced
I my ASP.NET master page I've got the following: $(function() { $("img[src*='_s.jpg']").thumbPopup({ imgSmallFlag: "_s", imgLargeFlag: "_l" }); }); and yes, the paths are right. I still get this error in firebug no matter what: $ is not defined -- View this message in context: http://www.nabble.com/%24-not-recognized-even-though-jQuery-library-referenced-tp25734586s27240p25734586.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: stopping and restarting the auto scrolling
Update: on jquery website I found something that could help me to achieve the stopping/restarting effect I need, here the code div.hover( function() { clearInterval(autoScroll); }, function() { autoScroll = setInterval(function() { go(curr+o.scroll); }, o.auto+o.speed); } ); the code above is a patch to put into jcarousellite file and let you stop/restart the carousel when the mouse if over the containing div. However I would like to have 2 buttons and press them to stop/restart the animation and if possible I'd like to keep this functionality outside the plugin itself. So I'd like to have 2 functions running when the buttons are pressed but I don't know how (if it is possible) I can refer to the carousel. Here my idea $('#stop_button').click(function () { XXX.clearInterval(autoScroll); }); $('#restart_button').click(function () { XXX.autoScroll = setInterval(function() { go(curr+o.scroll); }, o.auto+o.speed); } }); but I don't know what to put instead XXX. Any ideas? Thanks and have a nice day! Sig On Oct 2, 8:35 pm, macsig wrote: > Hello guys, > Is there a way to stop a carousel (created with jcarosellite 1.0.1) > when it has ben set up with auto-scrolling? > I need to be able to stop it and restart it when a button is pressed. > > If I can't can you please suggest me a plugin that have infinite > scrolling, auto-scrolling and I can stop/restart? > > Thanks and have a nice day. > > Sig
[jQuery] Re: jquery codeigniter upload question?
rosnovski wrote: hi guys, I never knew of this place but I am glad I did. My question like the subject says is about uploading. I was trying to do the jquery ajax part myself but i had problems with it and so I stumbled on form plugin from malsup. What i want to know is this, is there anyting special that I should know cos the explanation is very scanty. How does the form plugin affect my underlying CI code that works already in uploading files. Thanks and God bless I'll try to help with my own experience. Malsup's jQuery form will automatically upload files using hidden iframe technique. There are 4 mode of plugins : 'html', 'script', 'json', and 'xml'. I will explain html and json, because I'm using those mode only. When you using html mode, nothing need to be changed in your code, php part and jquery part. When upload complete, your php script should return html, and jQuery handler will do something to that response data. The only difference is that when a form contain upload field, then it submitted using hidden iframe. PHP script cannot detect using: $_HEADER[''HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' to check if it submitted with or without ajax plugins. My trick is to have hidden form field with empty value. Then I set the value when I initialize jQuery form. //Ajax form options var options = { dataType: 'html', target: '#result', beforeSubmit: function(a,f,o){ $("#ajax").val("ajax"); //display loading animation }, success: function(r) { $("#result").html(r); //do other action } } $("#the_form").ajaxForm(options); Using this, you can check in PHP script, if the $_POST['ajax'] have value 'ajax', or not, then return appropriate response, echo , or redirect, for example. The second mode, 'json' is the one I'm using often. The trick to detect the upload is using jquery form or not is same with above. The other trick is to return json response. If form have no upload field, then detect it using: $_HEADER[''HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' then return normal json using json_encode function. $output = json_encode($response_data); When it have upload field, then return the json enclosed by tag: $output = ''.json_encode($response_data).''; jQuery form plugins will handle the rest. You can process json response in the success function handler when initialize ajaxForm. I hope this will help you understand and use jquery form plugins. -- Donny Kurnia http://blog.abifathir.com http://hantulab.blogspot.com http://www.plurk.com/user/donnykurnia
[jQuery] lightbox overlay pushed to bottom of page
I'm trying to add the lightbox plugin to a page and when the image is clicked the overlay and corresponding image are pushed to the bottom of the page wit the image below the overlay. The gallery div is nested inside a couple other divs and when the gallery images are clicked the overlay and lighbox divs are pushed to the bottom of the page instead of being absolutely positioned over the existing content. If anyone has some ideas on how to fix this I would like to hear them. Thanks, Jason
[jQuery] wrap siblings between 2 specific tags
How do I wrap repeated sets of [ followed by other tags ] in a div? example: - - I want to wrap everything between the lines in a single [] ? The # of tags in between the lines ( i.e. # of tags following ) will vary after each tag. They won't all start with a thank you how do I wrap
[jQuery] POSTing an html input field in an auto-complete jquery field.
yes i am new to the jquery world and have been pounding my head against the wall for over a day trying to get my working auto- completed text field's data to be passed here is my XHTML.. Customer Name: the problem is when i hit the submit button, the pair is not being POSTed to editCustomer.php. if i get rid of the some of the 's i can sorta get it working, but i dont understand what im doing wrong here. any help appreciated. advTHANKSance, - mark
[jQuery] ExtraParams and caching
Hi, I think there is a bug in autocompleter, when you use extraParams. The cache logic is just wrong because it takes extraParams not as a part of cache key for lookup, so when you issue a request for "a term" with any parameters, the second search for "a term" will return cached results regardless of extraParams. This causes problems for example when we use a checkbox state as extraParams value. The only way around this is to use cacheLength: 0, but adding extraParams to cache key should not be a problem. Would you mind fixing this? johno
[jQuery] Re: jQuery - Random Selection
put all the bios in containers with same class, use _javascript_ random() function to create a random index to show one of the bios $('.bioClass').hide() var bioIndex=Math.round(Math.random()*5) $('.bioClass').eq(bioIndex).show() random() generates random # between 0 and 1 so multiplying by 5 and rounding will return random # between 0 and 5 which will match the indexing of the 6 containers http://www.w3schools.com/js/js_obj_math.asp Matthew Wehrle wrote: Hey, At current I'm building a site in co-operation with 5 of my close friends. On our homepage (See here: http://www.dotcommon.co.uk/index.html). You'll notice a bio box with 6 names down the left hand side and, thanks to jQuery, when these are clicked the bio box loads different information about each of us (Which is stored in my jQuery tabs file here: http://www.dotcommon.co.uk/js/tabs.js). Unforunatley when the page loads it always displays Ross' information as his is noted in the HTML file (Lines 54-58). I was wondering if there's a way to have jQuery randomly choose any of the 6 people and display their information instead of just having a default to display every time. Cheers again, Matt
[jQuery] jQuery - Random Selection
Hey, At current I'm building a site in co-operation with 5 of my close friends. On our homepage (See here: http://www.dotcommon.co.uk/index.html). You'll notice a bio box with 6 names down the left hand side and, thanks to jQuery, when these are clicked the bio box loads different information about each of us (Which is stored in my jQuery tabs file here: http://www.dotcommon.co.uk/js/tabs.js). Unforunatley when the page loads it always displays Ross' information as his is noted in the HTML file (Lines 54-58). I was wondering if there's a way to have jQuery randomly choose any of the 6 people and display their information instead of just having a default to display every time. Cheers again, Matt
[jQuery] Jquery carousel Question?
JQuery Carousel Demo is great. I have to use this for my work. But i got some issues while working with your Jcarousel example. 1. I am not able to change width of the panel. I mean Here you have shown 3 item on the frame . I need to show ten item on the frame. example there are 30 weeks . i have to show first 10 weeks on page 1. once we click it should jump to next week11-- then week 21 Here i am not bale to enlarge the frame.(customize) Please give some suggestion. Its very urgent. thank You shilpa shilpa...@gmail.com s.krishnamr...@centerforautism.com
[jQuery] Re: Stumped. 1.3.2 breaks this script
Still cant figure this one out! On Oct 2, 9:48 am, stilfx wrote: > Let me clarify. This example is working, using the older version of > jQuery. When I plug in jQuery 1.3.2, the first two books no longer > show and it breaks the script a bit. I am trying to figure out what > changed. > > Near the end of the script (browse.js) you will find: > .filter(":gt(" + parseInt(curPos - 1) + ")") > > I believe this is where the issue lies, but cannot seem to figure it > out from there. > > Thanks for looking into it!! > > On Oct 2, 9:31 am, brian wrote: > > > > > On Fri, Oct 2, 2009 at 9:29 AM, brian wrote: > > > You say it's not displaying "the first few books" but you don't say > > > which those are. The first one I'm seeing is "Plum Lovin'". Is that > > > correct or not? > > > > FF3.5.3/Linux, btw. > > > Never mind,I just found the XML source. Plum Lovin' is, indeed, the > > first book on the list. > > >http://blog.reindel.com/src/jquery_browse/books.xml
[jQuery] Re: Form Plugin issue with multiple submit buttons
perfect, thanks I got it fixed. On Oct 3, 6:39 am, Mike Alsup wrote: > > Sure, here it is. Thank you! > > >http://test.nmrwiki.org/wiki/index.php?title=Special:People&command=/... > > Ok, so here is the source for one of your forms: > > Administrator (1) > > > > > > > > > > > > > > That is not valid markup. If you look at Firebug you will see that > Firefox did not interpret this markup the way you had intended: > > Administrator (1) > > type="hidden" value="/people/moderate/" name="command"/> > > > > > > > > > > > So the Form Plugin did not bind your submit inputs because they are > not children of the form in the DOM. > > Mike
[jQuery] Re: Form Plugin issue with multiple submit buttons
> Sure, here it is. Thank you! > > http://test.nmrwiki.org/wiki/index.php?title=Special:People&command=/... > Ok, so here is the source for one of your forms: Administrator (1) That is not valid markup. If you look at Firebug you will see that Firefox did not interpret this markup the way you had intended: Administrator (1) So the Form Plugin did not bind your submit inputs because they are not children of the form in the DOM. Mike
[jQuery] jquery codeigniter upload question?
hi guys, I never knew of this place but I am glad I did. My question like the subject says is about uploading. I was trying to do the jquery ajax part myself but i had problems with it and so I stumbled on form plugin from malsup. What i want to know is this, is there anyting special that I should know cos the explanation is very scanty. How does the form plugin affect my underlying CI code that works already in uploading files. Thanks and God bless
[jQuery] Re: Skipping a slide with Cycle Plugin
instead of considering having Cycle skip the slide you could use a time function that determines what slides are put in DOM before calling Cycle Mike Alsup wrote: This isn't supported directly by the plugin. The only thing I can think of is using a dynamic timeout and setting it to 1 for that slide. I have a hunch it won't work terribly well though. Mike On Oct 1, 10:00 am, Garrison Locke wrote: Does anyone know how to disable a slide or skip one based on some dynamic piece of information? For example, I want to skip a particular slide based on the time of day.
[jQuery] Re: Pick different effects with jquery
Thanks a million!! :D On 3 okt, 05:16, Mike Alsup wrote: > > Try taking a look at the wonderful cycle plugin of Mike Alsup: > >http://malsup.com/jquery/cycle/options.html > > Thanks for the comment. Here's another page to look at that shows the > variety of effects available: > > http://www.malsup.com/jquery/cycle/multi.html
[jQuery] Re: Validation: Form with multiple submit buttons having different validation rules
I have seen the login form example (http://jquery.bassistance.de/ validate/demo/login/), but I cannot use it as I have to manually change css classes for all required elements. Can someone help me out in this issue? Should I write custom methods for this? On Oct 2, 10:14 pm, NovoGeek wrote: > Hi all, > I tried searching for similar issues but couldn't find a satisfying > answer. So posting it here. > I have a form with multiple fieldsets which are visible conditionally. > There are three submit buttons "Abandon", "Save" and "Save & > Continue". Each button should validate specific controls of the form > and submit it. > > I tried setting "onsubmit: false" and checking for "$('#myForm').valid > ()" on click of these buttons., but that validates all controls of the > form. Can someone suggest me what I should do?