[jQuery] Re: Creating callable methods, and binding them to objects' actions.
I don't think you need the colon in there (nor the single quotes) $(input[name=donation_type]) On Feb 19, 4:04 am, mkmanning michaell...@gmail.com wrote: You shouldn't have to refer to the same object in different ways, $ (input:[name='donation_type']) will work for both getting the value and binding an event. The @ before the attribute name was deprecated as of version 1.2 On Feb 18, 9:51 pm, gberz3 gbe...@gmail.com wrote: Ok, I got it to work using the following: $(#chargetotal).change(updateDonationTotal); $(input:[name='donation_type']).change(updateDonationTotal); I mistakenly posted chargetotal as the radio when it was actually a text field. That said, what is the difference between the following items: var donation_type = $(input:[...@name:donation_type]:checked).val(); $(input:[name='donation_type']).change(updateDonationTotal); It doesn't seem very intuitive to have to refer to the same item in different ways in order to get different results. I should be able to say GET OBJECT where NAME EQUALS regardless of whether I'm looking for its value or to bind to one of its methods. Can someone shed some light on why I must call each of these methods on the input in the different manners? Thanks. On Feb 18, 7:10 pm, mkmanning michaell...@gmail.com wrote: try: $(input:[...@id:chargetotal]).change(updateDonationTotal); On Feb 18, 1:55 pm, gberz3 gbe...@gmail.com wrote: Hi All, I'm having a bit of a problem with selectors and binding in jQuery. Basically I want to do 2 things: 1) create a javascript method callable by name that updates a div 2) bind that method to a set of radio buttons that runs the method on change It seems that none of the examples explicitly cover instances where you roll your own methods. They all assume function(){} which I personally consider messy. That said, I have the following code thus far: script type=text/javascript $(document).ready(function(){ function updateDonationTotal(){ var amount = $('#chargetotal').val(); var multiplier = 0; var total = 0; var donation_type = $(input:[...@name:donation_type]:checked).val (); var message = ; //it's gonna be one of: donation_general, donation_stop_tab, donation_pipe switch(donation_type){ case 'donation_general': {multiplier = 1; break} case 'donation_stop_tab': {multiplier = 500; break} case 'donation_pipe': {multiplier = 100; break} } total = amount * multiplier; message = nbsp; x + multiplier + = + total; $(#donation_total).html(message); console.log(message); }; $(input:[...@id:chargetotal]).change(updateDonationTotal();); }); /script The method 'updateDonationTotal' works fine. However, I receive errors when trying to bind the method in various ways to the radio buttons. I've tried 'bind', 'click', 'change'...all error out. Please advise. Best!
[jQuery] Re: load() not loading my dynamic page
That makes no sense - its rather wrong formed html. Did you use Id or Name property to identify webpart? On 2/19/09, Code Daemon ryan.det...@gmail.com wrote: Seems more specifically that Firefox doesn't like table objects being loaded dynamically. I'm assuming the jQuery load() method is ultimately a wrapper for the innerHTML property? Looks like, at the very least I'm going to have to omit all my tables. On Feb 18, 10:56 pm, Code Daemon ryan.det...@gmail.com wrote: It appears that things work fine in IE, just not Firefox. Very strange. On Feb 5, 6:56 am, jQuery Lover ilovejqu...@gmail.com wrote: Maybe it's related to wrong content type being sent by your server !!! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Feb 5, 2009 at 7:42 PM, eagleon antonypei...@gmail.com wrote: I've been experiencing the same thing! I hop we can figure out a workaround... This also applies to the $(document).ready() event... does not work ondynamicpages. On Feb 5, 3:21 am, Code Daemon ryan.det...@gmail.com wrote: But $('#mydiv').load('my/page.html');works just fine. On Feb 5, 12:16 am, Dean Barker framejoc...@googlemail.com wrote: look at onLoad() http://www.frameJockey.co.uk www.frameJockey.co.uk i...@framejockey.co.uk framejoc...@gmail.com framejoc...@yahoo.com [image: Google Talk:] framejoc...@gmail.com [image: Y! messenger:] frameJockey 2009/2/5 Code Daemon ryan.det...@gmail.com When I use load(), it works fine for staticpagesbut doesn't seem to work for mydynamicpage. This is what I'm doing: $('#mydiv').load('my/page'); FireBug shows that the response is coming back just as it should. Any thoughts? -- Sent from my mobile device
[jQuery] Re: Execute function in parent window
Ag, sorry I misunderstood you :) On Feb 19, 8:47 am, r1u0...@gmail.com r1u0...@gmail.com wrote: So it should be so? Please correct me if I'm wrong: parent = window.open(child); then in child window parent.function(); ??? If so, how can I pass the parent id to new window? Cheers Radek On Feb 17, 5:47 pm, Hernando Gisinger hgisin...@gmail.com wrote: The *opener* property returns a reference to the window that created the window. 2009/2/17 r1u0...@gmail.com r1u0...@gmail.com And how can I determinate name opening window? On Feb 17, 3:53 pm, Hernando Gisinger hgisin...@gmail.com wrote: opener.function_name(); cheers 2009/2/17 r1u0...@gmail.com r1u0...@gmail.com Hi, I've got question. I'm opening a new javascript window after clicking on button. On parent page I've got some jquery stuff. Is it possible to execute some function on parent site when new window was closed or by clicking the button in new window? Cheers Radek
[jQuery] Re: Superfish - sifr or image replacement?
You could use php-gd, like so: [code]?php // Set the content-type //header(Content-type: image/png); $sText = isset($_GET[text])?$_GET[text]:asdf; $sFileName = isset($_GET[file])?$_GET[file]:(style/txtimg_. $sText..png); $iSize = isset($_GET[size])?intVal($_GET[size]):20; if (!file_exists($sFileName)) { $oFont = Superplanet.ttf; $iFsize = $iSize; $iX = 1; $iY = $iFsize+2; $iW = 120; $iH = 44; // create test to find size $oTestImg = imagecreatetruecolor(1, 1); $cBg = imagecolorallocate($oTestImg, 0,0,0); $cFg = imagecolorallocate($oTestImg, 255, 255, 255); imagefill($oTestImg, 0, 0, $cBg); $aPoints = imagettftext($oTestImg, $iFsize, 0, $iX, $iY, $cFg, $oFont, $sText); imagedestroy($oTestImg); $iW = $aPoints[2]+1; // img $oImg = imagecreatetruecolor($iW, $iH); imagesavealpha($oImg, true); $cTrans = imagecolorallocatealpha($oImg, 255, 255, 255, 127); $cRed = imagecolorallocate($oImg, 182,13,62); $cWhite = imagecolorallocate($oImg, 227,215,198); $cBlack = imagecolorallocate($oImg, 0,0,0); imagefill($oImg, 0, 0, $cTrans); $aPos = array(array(-1,-1),array(1,-1),array(-1,1),array(1,1)); // normal foreach ($aPos as $aPs) imagettftext($oImg, $iFsize, 0, $iX+$aPs[0], $iY+$aPs[1], $cWhite, $oFont, $sText); imagettftext($oImg, $iFsize, 0, $iX, $iY, $cRed, $oFont, $sText); // hoover foreach ($aPos as $aPs) imagettftext($oImg, $iFsize, 0, $iX+$aPs[0], $iH/2+$iY+$aPs[1], $cRed, $oFont, $sText); imagettftext($oImg, $iFsize, 0, $iX, $iH/2+$iY, $cWhite, $oFont, $sText); // $sPos = $aPoints[0]./.$aPoints[1]. .$aPoints[2]./.$aPoints [3]; // imagettftext($oImg, 16, 0, $iX, $iH/2+$iY, $cBlack, $oFont, $sPos); // echo $sFileName; imagealphablending( $oImg, true ); imagepng($oImg, $sFileName); imagedestroy($oImg); } list($iW) = getimagesize( $sFileName );// [, array $imageinfo ] ) echo $iW; //imagepng($oImg); //imagedestroy($oImg); ?[/code] cheriana wrote: Hi - I am developing a site in joomla using the superfish drop down menu and would like to be able to replace the main menu links (not the drop downs) with a true type font. I know there are many joomla sifr plugins, but none of them seem to be compatible with the superfish menu. If I can't integrate superfish with sifr, is it possible to make the links images instead? Here's the site I'm working on: http://projects.thatsus.com/angelinascms/ Thanks!
[jQuery] Re: A question for John Resig
On Feb 18, 2:53 pm, pbcomm pbc...@gmail.com wrote: This might be a stupid question, but I have to ask ... What is the reason for not having functions like isString, isNumber, isBoolean, etc? Is it just because that would create extra function calls? The simple reason for me is that typeof tells you the type, it doesn't tell you for certain whether the tested variable is callable or not. Native objects that implement [[call]] must return 'function', however host objects can return any value they like, so: if (typeof foo != 'function') doesn't mean foo isn't callable unless you *know* it is a native object. The same goes for all the other is(whatever) functions. The use of instanceof is not a suitable alternative in a general sense as it doesn't work across frames. -- Rob
[jQuery] Way of code execution?
Hi, I've got following code: var tr; function updateNummbers(typ) { var ret = ; $.ajax({ type: POST, url: DFWebService.asmx/getNummbers, dataType: text, data: typ= + typ, processData: false, error: function(XMLHttpRequest, textStatus, errorThrown) { ajaxError(XMLHttpRequest, textStatus, errorThrown); }, success: function(xml) { ret = $(xml.replace(/lt;/g, ).replace(/gt;/ g, )).find('anzahl').text(); tr = ret; alert(tr); // OK alert(ret); // OK } }); alert(ret); // VALUE } updateNummbers('new'); alert(tr); // NO VALUE it is placed in $(document).ready( function() { I don't know why the value of updated variable tr outside function updateNummbers don't exists. In alert inside this function value is ok, but then I put alert after the function values are not correct. The same situation is for variable ret. Can anyone explain that to me?
[jQuery] $.ajax on succes is not being executed???
So why doesn't my success callback excutes? $(document).ready(function(){ $('.error').hide(); $(.voteBtn).click(function() { var poll = $(inp...@name='poll']:checked).val(); alert(send: +poll); if (poll == 'undefined') { alert(don't post); $(label#poll_error).show(); return false; } var question_id = $(inp...@name='question_id']).val();; var t = $(inp...@name='t']).val(); var dataString = 'poll=' + poll +'question_id='+question_id +'t='+t; alert(send: +dataString); $.ajax({ type: POST, url: poll-process3.php, data: dataString, success: function() { alert(why not ); $(#poll-container).hide(); } });//end ajax });//end click/**/ if ($(#poll-results).length 0 ) { animateResults(); } });//end ready --- all alert are shown except why not, but poll-process3.php is being executed.
[jQuery] Re: load() not loading my dynamic page
I hope I'm wrong. I'm not sure what you are asking though. The page I am loading is just HTML code with a table object in it. The AJAX server response looks something like: table trtd/td/tr /table It has no html tags. Is this necessary? On Feb 19, 12:46 am, tomasz wawrzyniak tw.gene...@gmail.com wrote: That makes no sense - its rather wrong formed html. Did you use Id or Name property to identify webpart? On 2/19/09, Code Daemon ryan.det...@gmail.com wrote: Seems more specifically that Firefox doesn't like table objects being loaded dynamically. I'm assuming the jQuery load() method is ultimately a wrapper for the innerHTML property? Looks like, at the very least I'm going to have to omit all my tables. On Feb 18, 10:56 pm, Code Daemon ryan.det...@gmail.com wrote: It appears that things work fine in IE, just not Firefox. Very strange. On Feb 5, 6:56 am, jQuery Lover ilovejqu...@gmail.com wrote: Maybe it's related to wrong content type being sent by your server !!! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Feb 5, 2009 at 7:42 PM, eagleon antonypei...@gmail.com wrote: I've been experiencing the same thing! I hop we can figure out a workaround... This also applies to the $(document).ready() event... does not work ondynamicpages. On Feb 5, 3:21 am, Code Daemon ryan.det...@gmail.com wrote: But $('#mydiv').load('my/page.html'); works just fine. On Feb 5, 12:16 am, Dean Barker framejoc...@googlemail.com wrote: look at onLoad() http://www.frameJockey.co.uk www.frameJockey.co.uk i...@framejockey.co.uk framejoc...@gmail.com framejoc...@yahoo.com [image: Google Talk:] framejoc...@gmail.com [image: Y! messenger:] frameJockey 2009/2/5 Code Daemon ryan.det...@gmail.com When I use load(), it works fine for staticpagesbut doesn't seem to work for mydynamicpage. This is what I'm doing: $('#mydiv').load('my/page'); FireBug shows that the response is coming back just as it should. Any thoughts? -- Sent from my mobile device
[jQuery] Re: Selector Efficiency?
Hi Josh, are your data ordered? (e.g. MAP_ID is the first li, SITE_ADDRESS the second, ...) If yes you can use a index based approach (from 4.8ms to 0.9ms on IE). var $foo = $(foo); var data = $foo.find(.atr-value); var parcelOutput = 'Parcel ID: ' + $(data[0]).text() + 'br' + 'Address: ' + $(data[1]).text(); Otherwise you can build a hash table of your name - value attributes and du a hash lookup (from 4.8ms to 2.7ms on IE) var $foo = $(foo); var names = $foo.find(.atr-name); var data = $foo.find(.atr-value); var hash = {}; for (var j=0; jnames.length; j++) { hash[$(names[j]).text()] = $(data[j]).text(); } var parcelOutput = 'Parcel ID: ' + hash['MAP_ID'] + 'br' + 'Address: ' + hash['SITE_ADDRESS']; see my examples on the profiling test page: http://jsbin.com/ifico/edit by(e) Stephan 2009/2/18 Josh Rosenthal maric...@gmail.com: So... a question regarding selector efficiency. The following snippet of HTML describes attributes associated with a polygon in an KML. Its basically a table of data, contained as spans in lis in a ul. Given this snippet, what would be the best (fastest) way to return the values of MAP_ID and SITE_ADDRESS foo = h4GISDATA.ASSESSPARNC_POLY_PUBLIC/h4 ul class=textattributes listrongspan class=atr-nameMAP_ID/span:/strong span class=atr-value16-27/span/li listrongspan class=atr-nameSITE_ADDRESS/span:/strong span class=atr-value396 Main St/span/li listrongspan class=atr-nameSITE_OTHER_FIELD/span:/strong span class=atr-valueGrat Data/span/li listrongspan class=atr-nameUSE_CODE/span:/strong span class=atr-value101/span/li listrongspan class=atr-nameTOWN_ID/span:/strong span class=atr-value116/span/li listrongspan class=atr-nameWARREN_GROUP_05_MAP_ID/span:/strong span class=atr-valueM:0016 B: L:0027/span/li listrongspan class=atr-nameACRES/span:/strong span class=atr-value0.67102373655/span/li /ul The following works parcelOutput = 'Parcel ID: ' + jQuery(foo).find('li:contains(MAP_)').not('li:contains(WARREN_GROUP)').children('.atr-value').text() + 'br' + 'Address: ' + jQuery(foo).find('li:contains(SITE_ADDRESS)').children('.atr-value').text(); Is there a better/more efficient way to return these values? Thanks!
[jQuery] Re: load() not loading my dynamic page
show fragment of your code (javascript) that is executed (and doens't work in FF), and oultine fragment of html that declare the div. 2009/2/19 Code Daemon ryan.det...@gmail.com I hope I'm wrong. I'm not sure what you are asking though. The page I am loading is just HTML code with a table object in it. The AJAX server response looks something like: table trtd/td/tr /table It has no html tags. Is this necessary? On Feb 19, 12:46 am, tomasz wawrzyniak tw.gene...@gmail.com wrote: That makes no sense - its rather wrong formed html. Did you use Id or Name property to identify webpart? On 2/19/09, Code Daemon ryan.det...@gmail.com wrote: Seems more specifically that Firefox doesn't like table objects being loaded dynamically. I'm assuming the jQuery load() method is ultimately a wrapper for the innerHTML property? Looks like, at the very least I'm going to have to omit all my tables. On Feb 18, 10:56 pm, Code Daemon ryan.det...@gmail.com wrote: It appears that things work fine in IE, just not Firefox. Very strange. On Feb 5, 6:56 am, jQuery Lover ilovejqu...@gmail.com wrote: Maybe it's related to wrong content type being sent by your server !!! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Feb 5, 2009 at 7:42 PM, eagleon antonypei...@gmail.com wrote: I've been experiencing the same thing! I hop we can figure out a workaround... This also applies to the $(document).ready() event... does not work ondynamicpages. On Feb 5, 3:21 am, Code Daemon ryan.det...@gmail.com wrote: But $('#mydiv').load('my/page.html');works just fine. On Feb 5, 12:16 am, Dean Barker framejoc...@googlemail.com wrote: look at onLoad() http://www.frameJockey.co.uk www.frameJockey.co.uk i...@framejockey.co.uk framejoc...@gmail.com framejoc...@yahoo.com [image: Google Talk:] framejoc...@gmail.com [image: Y! messenger:] frameJockey 2009/2/5 Code Daemon ryan.det...@gmail.com When I use load(), it works fine for staticpagesbut doesn't seem to work for mydynamicpage. This is what I'm doing: $('#mydiv').load('my/page'); FireBug shows that the response is coming back just as it should. Any thoughts? -- Sent from my mobile device
[jQuery] clueTip onclick call from JS and positioning
Hello, Problem: To show a clueTip when the user clicks To show the clueTip at the mouse click position To change dynamically the attr rel I define the div that will contain the html page to put in div id=tip rel=# title=jTip Style! style=display:nonetest/ div $().ready(function() { $('div#tip').cluetip({ width:'300', height:'600', cluetipClass: 'jtip', positionBy: mouse, activation : click, arrows: true, dropShadow: false, //hoverIntent: true, sticky: true, mouseOutClose: false, closePosition: 'title', closeText: 'img src=/images/cross.png alt=close /' }); When the user clicks on a map I call: $(ShowClueTip(response.responseText)); (function() { ShowClueTip= function(response) { $(div#tip).attr(rel, response); $(div#tip).attr(href, response); $(div#tip).show('fast'); $('div#tip').trigger('click'); $(p#test).hide(slow); } })(); The p#test is hidden, it means that the function is correctly called, but the ClueTip is not visible. If I put the rel value into the div declaration, the ClueTip is visible, but the position is not correct. How can I do? Thanks!
[jQuery] Adding methods to Plugins
Hi, I'm trying to write my first plugin and so far have managed to get it working fine including passing options in. What I can't seem to find out is how to create plugin methods eg, Using jQuery UI Draggable, passing an option in: $('.selector').draggable({ opacity: 0.35 }); So this would make the selector draggable with 0.35 opacity. However, UI Draggable also has the 'disable' method: $('.selector').draggable('disable'); Which disables the draggable functionality - this is essentially what I'm after. ie, $('.selector').myplugin('somemethod'); Can anyone please advise/point me in the right direction of how to do this? Thanks, djl
[jQuery] on click on a checkbox, highlight complete table row
Hi, sorry, for this newbie question: input type=checkbox name=paradigm[] value={$value.ver_id} / How can I check if this checkbox is checked or not? And how can I avoid this check for this particular checkbox: input type=checkbox id=paradigm_all / Thanks so much!!
[jQuery] Re: the jquery form plugin and the accents !
If I disable JS then I cannot run my application ! Mike Alsup a écrit : Could you reming me how to disable JS with FF3 ? I will give you a copy of the code later. Does it work correctly if you submit the form with JS disabled? Can you post a link? Preferences | Content | Enable JS
[jQuery] Re: jquery and the accents
typed in : labels, titles, free texts, etc. On 19 fév, 00:48, James james.gp@gmail.com wrote: If you use utf-8 for everything this issue should not occur. Where is the source of your text with accents from? A database? Typed in? On Feb 18, 1:10 pm,phicarregam...@bluewin.ch wrote: But if I set my charset to utf-8 then the other texts or labels with accents won't be correctly displayed ! On 18 fév, 19:54, James james.gp@gmail.com wrote: I've never had any issues with charset and jquery. You should probably set your charset (META) on your page to utf-8. On Feb 18, 8:27 am,phicarregam...@bluewin.ch wrote: [jquery-1.1.3.js] client-side: I have a form with text field and file field. + iso-8859-1 transmission by ajax to the server server-side: I have a var_dump($_POST); First test I enter in one text field the string rené : the dump gives rené Second test I enter in one text field the string rené and in the file field logo.gif : the dump gives rené That means that jquery changes somewhere the charset ? How can I manage that cleanly ?
[jQuery] Re: Jquery Form Plugin issues
Daniel and all, I am also seeing this same behavior. I'm using FF 3.0.6. I have tried various arrangements of the code using all the examples from the plugin's webpage, but it always submits via non-AJAX. Also, if I try to use an options param to ajaxForm rather than a function callback, it will oddly enough trigger the beforeSubmit and success callbacks of the options immediately upon loading the page. Here's my code (with the options param variation): http://pastie.org/393825 -Glenn
[jQuery] [autocomplete] Using autocomplete as a link-chooser
Hello everybody, first of all: this plugin ist really amazing! Good job, Jörn. So now my question: Is it possible to make use of this plugin in combination with linklist? E.g. I got my results from remote, scroll through them with my up- and down-arrows and finally choose one of the suggested items. This item is a normal html-link (a href). Is it possible, by choosing with enter the link is clicked? Thanks for your help! ghost2008
[jQuery] Re: Jquery Form Plugin issues
Nevermind my second point in my last post. I see why it was calling those callbacks immediately. duh. I had parentheses after their names in the options hash! Anyways, I do still have the main problem of not submitting via AJAX.
[jQuery] [validate] plugin maxlength bug with textarea?
When maxlength is set for textarea and the field is validated, the plugin seems to consider line breaks within the textarea as two characters at least in IE and Opera. That is because in IE and Opera, the textarea string received with element.value contains line breaks represented with two characters \r\n. With Firefox, this problem does not occur. As improvement suggestion, could this line in code: var result = $.validator.methods[method].call( this, element.value, element, rule.parameters ); be changed to use jQuery element value: var result = $.validator.methods[method].call( this, $(element).val(), element, rule.parameters ); That $(element).val(), replaces all the \r\n with \n so that a line break results as one character in validation. At least I did not find any option to fix this. Tested with validation plugin 1.5.1. Br. Rami
[jQuery] jQuery Form Plugin
Hi there, I am using jQuery Form Plugin with Matt's Script Formmail, and I simply cannot get it to work. Rather than showing up with the ajax form, it still just default redirects me to a success or error page. I am not jQuery expert, but I was hoping someone can point me in the right direction, basically on submit, rather than redirecting to the default success (or error page), I just wanted this message to appear in the alert. script type=text/javascript // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function $('#myForm').ajaxForm(function() { alert(Thank you for your comment!); }); }); /script form id=myForm action=FormMail.pl method=POST input type=hidden name=recipient value=xxx / input type=hidden name=ar_subject value=Contact Form / input type=hidden name=require value=realname,email / input type=text class=textbox name=realname / input type=text class=textbox name=email / input type=submit class=submit value=CONTACT /form Thanks in advance!
[jQuery] Need help in accorion Menu.
Dear Team, I hope , I am asking a help to the right team... I am new to JQuery and I amusing a accordion menu and have a challenge in opening and closing the panel based on a Flag. On post back I need to check the flag and If flag is true, I need to open it. or else it should be closed(all panel closed- and this is the default view). Kindly help me to get the solution... Or let m know if u are aware of a team who can help me...
[jQuery] jQuery Form Plugin
Hi there, I am using jQuery Form Plugin with Matt's Script Formmail, and I simply cannot get it to work. Rather than showing up with the ajax form, it still just default redirects me to a success or error page. I am not jQuery expert, but I was hoping someone can point me in the right direction, basically on submit, rather than redirecting to the default success (or error page), I just wanted this message to appear in the alert. script type=text/javascript // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function $('#myForm').ajaxForm(function() { alert(Thank you for your comment!); }); }); /script form id=myForm action=FormMail.pl method=POST input type=hidden name=recipient value=xxx / input type=hidden name=ar_subject value=Contact Form / input type=hidden name=require value=realname,email / input type=text class=textbox name=realname / input type=text class=textbox name=email / input type=submit class=submit value=CONTACT /form Thanks in advance!
[jQuery] Re: Execute function in parent window
On Feb 19, 8:47 am, r1u0...@gmail.com r1u0...@gmail.com wrote: So it should be so? Please correct me if I'm wrong: parent = window.open(child); then in child window parent.function(); ??? If so, how can I pass the parent id to new window? You won't need to. The opener object is always accessible from a window opened with window.open();. Regards, Kim
[jQuery] Tooltip hide delay
Is there any way to implement a delay for the hiding of a tooltip after the mouse moves off the element that displayed it? Would be a nice enhancement if not already available.
[jQuery] How to know when body height causes a scrollbar to appear
Hey list, I'm looking for a way to let my application know when the body height has changed to exceed the viewport height. There are quite a few different methods which inject elements in the DOM dynamically, so I'm not able to implement a check for changed body height in each and every one of them. The thing I'm trying to accomplish is making a message bar (which is floating on top of the page, width scaled to the width of the viewport) resize whenever a scrollbar appears. Is there an event that triggers each time the DOM changes? I've been searching the docs and this group, but can't seem to find anything like it (either that, or my google-fu is sub-par). Is there someone that has done something similar? Regards, Kim
[jQuery] Re: the jquery form plugin and the accents !
If I disable JS then I cannot run my application ! Can't you disable it just before submitting the form?
[jQuery] Re: $.ajax on succes is not being executed???
ps poll-process3.php is not being called :( On 19 feb, 10:52, 123gotoandplay wesweatyous...@gmail.com wrote: So why doesn't my success callback excutes? $(document).ready(function(){ $('.error').hide(); $(.voteBtn).click(function() { var poll = $(inp...@name='poll']:checked).val(); alert(send: +poll); if (poll == 'undefined') { alert(don't post); $(label#poll_error).show(); return false; } var question_id = $(inp...@name='question_id']).val();; var t = $(inp...@name='t']).val(); var dataString = 'poll=' + poll +'question_id='+question_id +'t='+t; alert(send: +dataString); $.ajax({ type: POST, url: poll-process3.php, data: dataString, success: function() { alert(why not ); $(#poll-container).hide(); } });//end ajax });//end click/**/ if ($(#poll-results).length 0 ) { animateResults(); }});//end ready --- all alert are shown except why not, but poll-process3.php is being executed.
[jQuery] Re: Jquery Form Plugin issues
I am also seeing this same behavior. I'm using FF 3.0.6. I have tried various arrangements of the code using all the examples from the plugin's webpage, but it always submits via non-AJAX. Seems to work ok for me: http://www.malsup.com/jquery/form/testing/feb19.html Are you including the form plugin script? Does Firebug report any errors?
[jQuery] Re: $.ajax on succes is not being executed???
So why doesn't my success callback excutes? $(document).ready(function(){ $('.error').hide(); $(.voteBtn).click(function() { var poll = $(inp...@name='poll']:checked).val(); alert(send: +poll); if (poll == 'undefined') { alert(don't post); $(label#poll_error).show(); return false; } var question_id = $(inp...@name='question_id']).val();; var t = $(inp...@name='t']).val(); var dataString = 'poll=' + poll +'question_id='+question_id +'t='+t; alert(send: +dataString); $.ajax({ type: POST, url: poll-process3.php, data: dataString, success: function() { alert(why not ); $(#poll-container).hide(); } });//end ajax });//end click/**/ if ($(#poll-results).length 0 ) { animateResults(); }});//end ready --- all alert are shown except why not, but poll-process3.php is being executed. Does Firebug indicate a scripting error? If not, does it show the data being posted to the server? What is the default action of the voteBtn element? Does it cause a page navigation? You should probably return false from that click handler. Also, if you are using jQuery 1.3.x then you should remove the @ in your selectors. It is no longer supported. This: $(inp...@name='t']) should be: $(input[name=t])
[jQuery] Re: [validate] plugin maxlength bug with textarea?
Good call. My fix looks slightly different, but should work just as well. You can get the latest revision here: http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/jquery.validate.js Or wait for the 1.5.2 release. Jörn On Thu, Feb 19, 2009 at 11:43 AM, rami rami.p.salmi...@gmail.com wrote: When maxlength is set for textarea and the field is validated, the plugin seems to consider line breaks within the textarea as two characters at least in IE and Opera. That is because in IE and Opera, the textarea string received with element.value contains line breaks represented with two characters \r\n. With Firefox, this problem does not occur. As improvement suggestion, could this line in code: var result = $.validator.methods[method].call( this, element.value, element, rule.parameters ); be changed to use jQuery element value: var result = $.validator.methods[method].call( this, $(element).val(), element, rule.parameters ); That $(element).val(), replaces all the \r\n with \n so that a line break results as one character in validation. At least I did not find any option to fix this. Tested with validation plugin 1.5.1. Br. Rami
[jQuery] Re: jQuery Form Plugin
right direction, basically on submit, rather than redirecting to the default success (or error page), I just wanted this message to appear in the alert. script type=text/javascript // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function $('#myForm').ajaxForm(function() { alert(Thank you for your comment!); }); }); /script form id=myForm action=FormMail.pl method=POST input type=hidden name=recipient value=xxx / input type=hidden name=ar_subject value=Contact Form / input type=hidden name=require value=realname,email / input type=text class=textbox name=realname / input type=text class=textbox name=email / input type=submit class=submit value=CONTACT /form Thanks in advance! I don't see anything wrong there execpt an extra in the email input. Have you included the form plugin on your page? What you posted works here: http://www.malsup.com/jquery/form/testing/feb19-2.php
[jQuery] Re: Adding methods to Plugins
Which disables the draggable functionality - this is essentially what I'm after. ie, $('.selector').myplugin('somemethod'); Can anyone please advise/point me in the right direction of how to do this? Something like this maybe: $.fn.myplugin = function(option) { this.each(function() { // do something with each matched element switch (option) { case: 'a': case: 'b': case: 'c': } }); return this; // important };
[jQuery] Re: Form Plugin with file upload
Hooray! I'm so happy its fixed!!! Excellent, Susie. So glad to hear it!
[jQuery] Re: Way of code execution?
var tr; function updateNummbers(typ) { var ret = ; $.ajax({ type: POST, url: DFWebService.asmx/getNummbers, dataType: text, data: typ= + typ, processData: false, error: function(XMLHttpRequest, textStatus, errorThrown) { ajaxError(XMLHttpRequest, textStatus, errorThrown); }, success: function(xml) { ret = $(xml.replace(/lt;/g, ).replace(/gt;/ g, )).find('anzahl').text(); tr = ret; alert(tr); // OK alert(ret); // OK } }); alert(ret); // VALUE } updateNummbers('new'); alert(tr); // NO VALUE it is placed in $(document).ready( function() { I don't know why the value of updated variable tr outside function updateNummbers don't exists. In alert inside this function value is ok, but then I put alert after the function values are not correct. The same situation is for variable ret. Can anyone explain that to me? Remember, the 'A' in ajax stands for 'asynchronous'. Your tr and ret variables are not set when you call $.ajax. They are set whenever the server response is received.
[jQuery] Re: [validate] plugin maxlength bug with textarea?
That works. Thank you for very fast answer and fix! Hopefully 1.5.2 comes out soon. Rami. On Feb 19, 1:41 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: Good call. My fix looks slightly different, but should work just as well. You can get the latest revision here:http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/jquery.vali... Or wait for the 1.5.2 release. Jörn On Thu, Feb 19, 2009 at 11:43 AM, rami rami.p.salmi...@gmail.com wrote: When maxlength is set for textarea and the field is validated, the plugin seems to consider line breaks within the textarea as two characters at least in IE and Opera. That is because in IE and Opera, the textarea string received with element.value contains line breaks represented with two characters \r\n. With Firefox, this problem does not occur. As improvement suggestion, could this line in code: var result = $.validator.methods[method].call( this, element.value, element, rule.parameters ); be changed to use jQuery element value: var result = $.validator.methods[method].call( this, $(element).val(), element, rule.parameters ); That $(element).val(), replaces all the \r\n with \n so that a line break results as one character in validation. At least I did not find any option to fix this. Tested with validation plugin 1.5.1. Br. Rami
[jQuery] How to use multiple versions of jQuery
Hi, I've written an article and small bit of support code to aid in the use of multiple versions of jQuery (and possibly other) JS libraries in a page: Docs: https://www.adaptavist.com/display/~mgibson/Using+multiple+versions+of +javascript+libraries Code: http://test3.internal.adaptavist.net/~mgibson/versions/ I'd be interested in feedback on this: * Can you foresee any problems with this technique? * Would it work for any other of the major JS libraries? * Should I put it somewhere on jquery.com? * Would a google.load style version matching algorithm be worthwhile? * Any other suggestions? Regards - Mark Gibson
[jQuery] Re: Define functions before DOM loads
Why not just define the function? function msg() { alert(Hello User); } If you do that, it'll be available when the DOM is loaded ie. $(document).ready() On Thu, Feb 19, 2009 at 1:17 AM, JQueryProgrammer jain.ashis...@gmail.com wrote: Got it. I need to define as (function() { msg = function() { alert(Hello User); } })(); Thats it. On Feb 19, 11:08 am, JQueryProgrammer jain.ashis...@gmail.com wrote: How can we define functions even before the DOM loads fully. I tried like (function() { msg = function() { alert(Hello User); } }); $(function() { msg(); }); This is just an example. But it gives me Object Expected error. Please let me know how to do it.
[jQuery] Re: How to know when body height causes a scrollbar to appear
You could go at it in another way, actually, by forcing a scrollbar to always be present: body { height: 100.1%; } On Thu, Feb 19, 2009 at 2:29 AM, Kim Christensen kim.christen...@gmail.com wrote: Hey list, I'm looking for a way to let my application know when the body height has changed to exceed the viewport height. There are quite a few different methods which inject elements in the DOM dynamically, so I'm not able to implement a check for changed body height in each and every one of them. The thing I'm trying to accomplish is making a message bar (which is floating on top of the page, width scaled to the width of the viewport) resize whenever a scrollbar appears. Is there an event that triggers each time the DOM changes? I've been searching the docs and this group, but can't seem to find anything like it (either that, or my google-fu is sub-par). Is there someone that has done something similar? Regards, Kim
[jQuery] Re: Jquery Form Plugin issues
Weird. Could it be that you are have the $(document).ready call in the head? I currently don't have it set up this way. But I thought from looking at other examples that it didn't matter. On Feb 19, 12:29 pm, Mike Alsup mal...@gmail.com wrote: I am also seeing this same behavior. I'm using FF 3.0.6. I have tried various arrangements of the code using all the examples from the plugin's webpage, but it always submits via non-AJAX. Seems to work ok for me: http://www.malsup.com/jquery/form/testing/feb19.html Are you including the form plugin script? Does Firebug report any errors?
[jQuery] Re: Adding methods to Plugins
Hi Mike, Well, that sort of works, although I need to be able to pass (and within the plugin provide default) options - I can do either but not both so I'm a bit stumped: eg, Method only: (function($){ $.fn.myplugin = function(option) { this.each(function() { switch (option) { case 'a': alert('a'); break; case 'b': alert('b'); break; case 'c': alert('c'); break; } }); return this; }; })(jQuery); So, the code: $('.selector').myplugin('b'); Shows an 'b' is shown in an alert box Options only (function($){ $.fn.myplugin = function(options) { var defaults = { width: 300 }; var options = $.extend(defaults, options); return this.each(function() { $this = $(this); var scrollareabasename = $this.attr('id'); $this.scroll(function() { window.console.log('scroll: ' + scrollareabasename + ' ' + options.width); }); $('body').append('div class=test/div'); }); return this; }; })(jQuery); With this code: $('#selector').myplugin({ width:500 }); Logs the selector id and 500 to the console when the selector is scrolled and appends a div with class of 'test' to the body. Any ideas on how to combine both options and methods in the same plugin code? Thanks, djl On 19 Feb 2009, at 11:56, Mike Alsup wrote: Which disables the draggable functionality - this is essentially what I'm after. ie, $('.selector').myplugin('somemethod'); Can anyone please advise/point me in the right direction of how to do this? Something like this maybe: $.fn.myplugin = function(option) { this.each(function() { // do something with each matched element switch (option) { case: 'a': case: 'b': case: 'c': } }); return this; // important };
[jQuery] JQuery with ASP.NET
Can anyone tell me What is alternate for following JavaScript with asp.net functions using JQuery. pls give example.. - window.open - ScriptManager.StartUpScript - Make JQuery function and call it from code behind. Also how can i get intellisense support for JQuery in vs 2008 without upgrading to sp1. I donwloaded one hotfix Hotfix for Microsoft Visual Studio 2008 – KB946581 ..but it doesnt help.
[jQuery] .height() issue
Hi, i use the following code to set up the height of a div (framework): var GridTitle_OuterHeight = parseInt($(#gridtitle).outerHeight(),10); var Navigation_OuterHeight = parseInt($(#navigation).outerHeight(),10); var FrmBottomBorder = parseInt($(#framework).css(borderBottomWidth), 10); var FrmTopBorder = parseInt($(#framework).css(borderTopWidth), 10); ... ... $(#framework).height(op.height - GridTitle_OuterHeight - FrmTopBorder - FrmBottomBorder - Navigation_OuterHeight); with op.height = 300. when i user an alert() just after all vars but before the $(#framework).height(..) as following: alert(Op height : +op.height + \n\nGridTitle outer height : + GridTitle_OuterHeight + \n\nNavigation height : + Navigation_OuterHeight); it works correctly and returns me the good values. however, the $(#framework).height(...) does not work under IE7, why ? when i wrote it does not work, in fact, it does not setup the height of the Framework div to the correct height, but to the default one :-( any idea ? thx. -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] Re: Adding methods to Plugins
Well, that sort of works, although I need to be able to pass (and within the plugin provide default) options - I can do either but not both so I'm a bit stumped: Oh, I see what you mean now. Try something like this: $.fn.myplugin = function(options) { var defaults = { width: 300 }; if (typeof options == 'string') options = { someDefaultOption: options }; else if ($.isFunction(option)) options = { callback: options }; options = $.extend(defaults, options); ... };
[jQuery] Re: Help validating dynamic form elements
thanx, that didn't work (at least the different variations I tried). I'l keep plugging away at things, it'll come to me sooner or later On Feb 18, 1:39 am, 刘明 charles.li...@gmail.com wrote: i suppose the 13 boxes' IDs are generated in order,so go through all the boxes by id: var pass=0; for(var i=1;i=13;i++){ if($(#mybox+i).val() != ') pass+=1;} if(pass=0) return false; and then, put your code in a function and bind it to the submit event of your form. (i'm also a starter) 2009/2/18 netcomp ra...@netcompulsion.com Hello, I'm a bit new to jQuery. I have a dynamic form which could contain any number of input boxes (from 1 to 13) named attrib1 thru attrib13. I need to ensure at least one of the input boxes gets filled in - there again it can be any of the generated boxes. Don't suppose someone can help get me started? TIA
[jQuery] Re: Jquery Form Plugin issues
Hammering this home, I also tried to point my form to your test.php page, but still no change. I do see your response, but it moves the browser forward to a new page to display it. I also have the exact same versions of jquery and jquery form plugin. Is there some other setting somewhere on our server that may be forcing ajax calls to be disabled? This is driving me bonkers.
[jQuery] Re: How to know when body height causes a scrollbar to appear
Brian, I just found this post: http://www.west-wind.com/Weblog/posts/453942.aspx It might be of some use to you? Cheers, djl On 19 Feb 2009, at 12:53, brian wrote: You could go at it in another way, actually, by forcing a scrollbar to always be present: body { height: 100.1%; } On Thu, Feb 19, 2009 at 2:29 AM, Kim Christensen kim.christen...@gmail.com wrote: Hey list, I'm looking for a way to let my application know when the body height has changed to exceed the viewport height. There are quite a few different methods which inject elements in the DOM dynamically, so I'm not able to implement a check for changed body height in each and every one of them. The thing I'm trying to accomplish is making a message bar (which is floating on top of the page, width scaled to the width of the viewport) resize whenever a scrollbar appears. Is there an event that triggers each time the DOM changes? I've been searching the docs and this group, but can't seem to find anything like it (either that, or my google-fu is sub-par). Is there someone that has done something similar? Regards, Kim
[jQuery] Re: Jquery Form Plugin issues
Ok, I think the problem is related to using XMLHttpRequest in a cross- site situation (which I was, since my API is a different domain than my HTML). I will resolve this using jsonp, or some other method. Sorry for the trouble. Hope this helps others.
[jQuery] Anchor HREF update and delayed navigation
Hi, I am using getJSON() to retrieve some data I want appended to a clicked anchor's href before it navigates. I first tried binding the update function to the anchor's click-event, but while the callback is pending the browser navigates to the original href. I then tried both unbind() and one() in combination with click(); basically, I override the click-event completely with a preventDefault(), and then call the element's click() in the callback. The following example simulates the callback-delay, and updates the href, but the final click() does not force navigation on the anchor as I expected it should; I manually needed to click it again. Does anyone have a solution? Thanks. script $(function(){ $('a').one('click',function(event){ test($(this)); event.preventDefault(); }); }); function test(link) { setTimeout(function(){callback(link,{href:'http://jquery.com'})}, 1000); } function callback(link,json) { link.attr('href',json.href); link.unbind('click'); link.trigger('click'); } /script /head body a href=http://msn.com;test/a /body
[jQuery] Data returned (from a JQuery function) with the $ character cause to error in IE
assume the following code: -- price = $(#field).text(); -- This code cause the following error in IE: object doesn't support this property or method. $(#field).text(); returns a string, like: $21.3. (the data is price). I guess the $ character (of $21.3) make JQuery confused as it thinks this is a function. BUT, when I write something like this: var htmlOut = 'span' + $(#field).text(); + '/span' No error occurs! What may cause this bug in IE to happen? Thanks,Major
[jQuery] Re: Data returned (from a JQuery function) with the $ character cause to error in IE
-- price = $(#field).text(); -- This code cause the following error in IE: object doesn't support this property or method. $(#field).text(); returns a string, like: $21.3. (the data is price). I guess the $ character (of $21.3) make JQuery confused as it thinks this is a function. BUT, when I write something like this: var htmlOut = 'span' + $(#field).text(); + '/span' No error occurs! What may cause this bug in IE to happen? Thanks,Major That doesn't make sense, both statements should execute fine. Can you post a link?
[jQuery] hide/show answer based on question click
I am very new to jquery and just can't wrap my head around this. It is probably something very basic and I apologize in advance. I have a list of questions and answers, the answers showing when a question is clicked the answer with hide/show and the parent div will change class. I have come up with the following but it don't seem to work (it only hides answers.) script type=text/javascript $(document).ready(function(){ $(.question).click(function(){ var $this = $(this); if( $this.prev().is('.qa') ) { $this.next().slideDown(slow); $this.prev().removeClass('qa'); $this.prev().addClass('qa-answer'); } else { $this.next().slideUp(slow); $this.prev().removeClass('qa-answer'); $this.prev().addClass('qa'); } return false; }); }); /script div class=qa span class=questionThis is the question/span span class=answerthis is the answer/span /div div class=qa span class=questionThis is the question/span span class=answerthis is the answer/span /div Also is there a way to loop through all answer classes on the page and hide them? I am looking for accessibility to show all answers if the user doesn't' have javascript enabled. Thank you in advance.
[jQuery] Re: JQuery with ASP.NET
Studio will *not* do intellisense unless you go to SP1, it's absolutely required As for your other questions window.open is still window.open Startup --- $(document).ready() or $(window).load() your third line doesn't make any sense... any JavaScript based function runs on the client after the code behind has done it's thing On Feb 19, 7:40 am, informit informit...@gmail.com wrote: Can anyone tell me What is alternate for following JavaScript with asp.net functions using JQuery. pls give example.. - window.open - ScriptManager.StartUpScript - Make JQuery function and call it from code behind. Also how can i get intellisense support for JQuery in vs 2008 without upgrading to sp1. I donwloaded one hotfix Hotfix for Microsoft Visual Studio 2008 – KB946581 ..but it doesnt help.
[jQuery] code optimizing
hei everybody, i got this little snipped and i am wondering about how to make it more efficient: $('#respond').show(); $('#formComment').hide().addClass('javaCommentForm'); $(#respond).click(function(){ $('.storyBox').animate({opacity: 0.4}); $('#formComment').slideToggle(); $(this).css('visibility', 'hidden') return false; }) $('#closeComment').show().click(function(){ $('.storyBox').animate({opacity: 1}); $('#formComment').slideToggle(); $('#respond').fadeIn().css('visibility', 'visible'); return false; }) should i put $('#formComment') in a var ? does it makes a different? cheers chris!
[jQuery] slideUp strange behavior under IE7
Hi, i have a div which i use to slideUp with jQuery. if under FF3 there is not problem, i met an issue under IE7. for example if i have several divs within this SlideUp div, (and that there is 1 div which is placed with css at the bottom of this SLideUp div) while this div is slidingup, the bottom child div, is not slidinup with the whole content of the sliding div, but it only disappear on the sliding div is hidden... so where could be the problem ? i do not understand as under FF the whole content of this sliding div is sliding up but not under IE7. all divs not align with TOP or BOTTOM parameters (under IE7) are correctly sliding together with sliding div content. thx -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] Re: Superfish - sifr or image replacement?
Thank you! What I need is to replace the top level text links with images, though - not turn the text into images. I was looking into a Sifr module for joomla so the text would still be search engine friendly, but achieve the look of the Trajan Pro font. Any ideas on how to do this? On Feb 19, 3:58 am, Sjeiti sje...@gmail.com wrote: You could use php-gd, like so: [code]?php // Set the content-type //header(Content-type: image/png); $sText = isset($_GET[text])?$_GET[text]:asdf; $sFileName = isset($_GET[file])?$_GET[file]:(style/txtimg_. $sText..png); $iSize = isset($_GET[size])?intVal($_GET[size]):20; if (!file_exists($sFileName)) { $oFont = Superplanet.ttf; $iFsize = $iSize; $iX = 1; $iY = $iFsize+2; $iW = 120; $iH = 44; // create test to find size $oTestImg = imagecreatetruecolor(1, 1); $cBg = imagecolorallocate($oTestImg, 0,0,0); $cFg = imagecolorallocate($oTestImg, 255, 255, 255); imagefill($oTestImg, 0, 0, $cBg); $aPoints = imagettftext($oTestImg, $iFsize, 0, $iX, $iY, $cFg, $oFont, $sText); imagedestroy($oTestImg); $iW = $aPoints[2]+1; // img $oImg = imagecreatetruecolor($iW, $iH); imagesavealpha($oImg, true); $cTrans = imagecolorallocatealpha($oImg, 255, 255, 255, 127); $cRed = imagecolorallocate($oImg, 182,13,62); $cWhite = imagecolorallocate($oImg, 227,215,198); $cBlack = imagecolorallocate($oImg, 0,0,0); imagefill($oImg, 0, 0, $cTrans); $aPos = array(array(-1,-1),array(1,-1),array(-1,1),array(1,1)); // normal foreach ($aPos as $aPs) imagettftext($oImg, $iFsize, 0, $iX+$aPs[0], $iY+$aPs[1], $cWhite, $oFont, $sText); imagettftext($oImg, $iFsize, 0, $iX, $iY, $cRed, $oFont, $sText); // hoover foreach ($aPos as $aPs) imagettftext($oImg, $iFsize, 0, $iX+$aPs[0], $iH/2+$iY+$aPs[1], $cRed, $oFont, $sText); imagettftext($oImg, $iFsize, 0, $iX, $iH/2+$iY, $cWhite, $oFont, $sText); // $sPos = $aPoints[0]./.$aPoints[1]. .$aPoints[2]./.$aPoints [3]; // imagettftext($oImg, 16, 0, $iX, $iH/2+$iY, $cBlack, $oFont, $sPos); // echo $sFileName; imagealphablending( $oImg, true ); imagepng($oImg, $sFileName); imagedestroy($oImg);} list($iW) = getimagesize( $sFileName );// [, array $imageinfo ] ) echo $iW; //imagepng($oImg); //imagedestroy($oImg); ?[/code] cheriana wrote: Hi - I am developing a site in joomla using the superfish drop down menu and would like to be able to replace the main menu links (not the drop downs) with a true type font. I know there are many joomla sifr plugins, but none of them seem to be compatible with the superfish menu. If I can't integrate superfish with sifr, is it possible to make the links images instead? Here's the site I'm working on: http://projects.thatsus.com/angelinascms/ Thanks!
[jQuery] Re: Data returned (from a JQuery function) with the $ character cause to error in IE
Is #field a text input? Perhaps you want .val() instead of .text() ? - Richard On Thu, Feb 19, 2009 at 8:56 AM, major mei...@gmail.com wrote: assume the following code: -- price = $(#field).text(); -- This code cause the following error in IE: object doesn't support this property or method. $(#field).text(); returns a string, like: $21.3. (the data is price). I guess the $ character (of $21.3) make JQuery confused as it thinks this is a function. BUT, when I write something like this: var htmlOut = 'span' + $(#field).text(); + '/span' No error occurs! What may cause this bug in IE to happen? Thanks,Major
[jQuery] Re: How to know when body height causes a scrollbar to appear
I suppose another way around this could be to maybe use a plugin similar to: (function($){ $.fn.elemheight = function(options) { var defaults = { element: 'body', }; var options = $.extend(defaults, options); return this.each(function() { var windowheight = $(window).height(); var elemheight = $(options.element).height(); if (elemheight = windowheight) { alert(options.element + ' height is greater than window height'); // do something here ... } }); return this; }; })(jQuery); You could then chain the plugin onto code that dynamically adds elements eg, $('.somebutton').click(function() { // your code to add elements }).elemheight('body'); On 19 Feb 2009, at 12:53, brian wrote: You could go at it in another way, actually, by forcing a scrollbar to always be present: body { height: 100.1%; } On Thu, Feb 19, 2009 at 2:29 AM, Kim Christensen kim.christen...@gmail.com wrote: Hey list, I'm looking for a way to let my application know when the body height has changed to exceed the viewport height. There are quite a few different methods which inject elements in the DOM dynamically, so I'm not able to implement a check for changed body height in each and every one of them. The thing I'm trying to accomplish is making a message bar (which is floating on top of the page, width scaled to the width of the viewport) resize whenever a scrollbar appears. Is there an event that triggers each time the DOM changes? I've been searching the docs and this group, but can't seem to find anything like it (either that, or my google-fu is sub-par). Is there someone that has done something similar? Regards, Kim
[jQuery] Re: Anchor HREF update and delayed navigation
This seems like it would be a pretty slow user experience. Why don't you just append the data to the link before the user clicks on it. Unless the data are time-sensitive, that is. Otherwise, couldn't you just update all the links with the appropriate data well before any of them are actually used? Anyway, if you want to send a user somewhere, just do location.href = your_href On Thu, Feb 19, 2009 at 8:22 AM, KihOshk goo...@microsopht.com wrote: Hi, I am using getJSON() to retrieve some data I want appended to a clicked anchor's href before it navigates. I first tried binding the update function to the anchor's click-event, but while the callback is pending the browser navigates to the original href. I then tried both unbind() and one() in combination with click(); basically, I override the click-event completely with a preventDefault(), and then call the element's click() in the callback. The following example simulates the callback-delay, and updates the href, but the final click() does not force navigation on the anchor as I expected it should; I manually needed to click it again. Does anyone have a solution? Thanks. script $(function(){ $('a').one('click',function(event){ test($(this)); event.preventDefault(); }); }); function test(link) { setTimeout(function(){callback(link,{href:'http://jquery.com'})}, 1000); } function callback(link,json) { link.attr('href',json.href); link.unbind('click'); link.trigger('click'); } /script /head body a href=http://msn.com;test/a /body
[jQuery] Re: A question for John Resig
I'm curious what the benefit of that would be. Given that the window.undefined property exists and has the undefined value, I'd think they would give the same result. -Mike From: John Resig ...we'll probably switch from foo === undefined to typeof foo === undefined - we'll see
[jQuery] Re: Anchor HREF update and delayed navigation
Hi Brian, Thanks for the quick response. Yes, the data appended to the href is a time-sensative encrypted querystring variable, so the data needs to be generated after the click-event. I was trying to avoid setting the location variable since the anchors that this method will be affecting can be either target=_self or target=_blank. I tried this, but the target assignment isn't respected: function callback(link,json) { location.target=link.attr('target'); location.href=json.href; } In any case it would be useful to delay the redirect of the anchor until an asynchronous process is completed. -John On Feb 19, 10:06 am, brian bally.z...@gmail.com wrote: This seems like it would be a pretty slow user experience. Why don't you just append the data to the link before the user clicks on it. Unless the data are time-sensitive, that is. Otherwise, couldn't you just update all the links with the appropriate data well before any of them are actually used? Anyway, if you want to send a user somewhere, just do location.href = your_href On Thu, Feb 19, 2009 at 8:22 AM, KihOshk goo...@microsopht.com wrote: Hi, I am using getJSON() to retrieve some data I want appended to a clicked anchor's href before it navigates. I first tried binding the update function to the anchor's click-event, but while the callback is pending the browser navigates to the original href. I then tried both unbind() and one() in combination with click(); basically, I override the click-event completely with a preventDefault(), and then call the element's click() in the callback. The following example simulates the callback-delay, and updates the href, but the final click() does not force navigation on the anchor as I expected it should; I manually needed to click it again. Does anyone have a solution? Thanks. script $(function(){ $('a').one('click',function(event){ test($(this)); event.preventDefault(); }); }); function test(link) { setTimeout(function(){callback(link,{href:'http://jquery.com'})}, 1000); } function callback(link,json) { link.attr('href',json.href); link.unbind('click'); link.trigger('click'); } /script /head body a href=http://msn.com;test/a /body
[jQuery] My published plugins are not appearing in the jQuery Plugin list
I've had two of my jQuery plugins published for a while now (more than a year) on teh jQuery site, with backup doumentation and demoes on my own site. http://plugins.jquery.com/project/form-highlight http://plugins.jquery.com/project/Populate However - they don't appear to show up in the plugins lists: http://plugins.jquery.com/project/Plugins/category/20?page=1 (Form Highlight should be here) http://plugins.jquery.com/project/Plugins/category/20?page=2 (Populate should be here) Any ideas? Thanks, Dave
[jQuery] Re: New plugin: simplyScroll
Have added a new complex markup example http://logicbox.net/jquery/simplyscroll/custom.html On Feb 19, 1:13 am, Will Kelly willrke...@gmail.com wrote: Great stuff, let me know how it goes! Will On Feb 18, 11:06 pm, Daniel dcosta...@gmail.com wrote: Wonderful! I plan to use this on the redesign of hodgesfarmequipment.com! Thank you, bookmarked! On Feb 18, 2:41 pm, Will Kelly willrke...@gmail.com wrote: Hi Just released a plugin for some code I've been working on and off for the past few months. It's a simple content scroller that can accept images as well as more complex content and features an 'infinite' scroll mode as well as image data from Flickr. Plug-in:http://logicbox.net/jquery/simplyscroll/ Blog post:http://logicbox.net/blog/simplyscroll-jquery-plugin Would love feedback etc, also would be interested to know how I can detect Safari/Chrome (webkit), now that I can't use $.browser! Cheers Will
[jQuery] Re: hide/show answer based on question click
So I was able to archive my desired effect with the following: script type=text/javascript $(document).ready(function(){ $('.answer').css(display, none); $(.question).click(function(){ var $this = $(this); if( $this.is('.question') ) { $this.children('.answer').slideDown(slow); $this.removeClass('question'); $this.addClass('question-answer'); } else { $this.children('.answer').slideUp(slow); $this.removeClass('question-answer'); $this.addClass('question'); } return false; }); }); /script div class=questionstrongThis is the question/strongbr / span class=answerthis is the answer/span /div Thanks Brian On Thu, Feb 19, 2009 at 9:28 AM, Brian Yanosik byano...@gmail.com wrote: I am very new to jquery and just can't wrap my head around this. It is probably something very basic and I apologize in advance. I have a list of questions and answers, the answers showing when a question is clicked the answer with hide/show and the parent div will change class. I have come up with the following but it don't seem to work (it only hides answers.) script type=text/javascript $(document).ready(function(){ $(.question).click(function(){ var $this = $(this); if( $this.prev().is('.qa') ) { $this.next().slideDown(slow); $this.prev().removeClass('qa'); $this.prev().addClass('qa-answer'); } else { $this.next().slideUp(slow); $this.prev().removeClass('qa-answer'); $this.prev().addClass('qa'); } return false; }); }); /script div class=qa span class=questionThis is the question/span span class=answerthis is the answer/span /div div class=qa span class=questionThis is the question/span span class=answerthis is the answer/span /div Also is there a way to loop through all answer classes on the page and hide them? I am looking for accessibility to show all answers if the user doesn't' have javascript enabled. Thank you in advance.
[jQuery] Re: Superfish - sifr or image replacement?
I've figured it out with my css, for anyone else who may be wondering how to do it the styles are below. style /* applies to just item53 The Menu */ .item53 a *{ display:none } .item53 a,.item53 a:hover{ background: url(http://angelinasofbonitasprings.com/images/nav-menu.jpg);width: 47px;height:17px; } /* un-css all menus */ .parent ul a *{ display:block } .parent ul a,.parent ul a:hover{ background: none;width:47px;height: 17px; } /style On Feb 19, 9:54 am, cheriana cherianagri...@gmail.com wrote: Thank you! What I need is to replace the top level text links with images, though - not turn the text into images. I was looking into a Sifr module for joomla so the text would still be search engine friendly, but achieve the look of the Trajan Pro font. Any ideas on how to do this? On Feb 19, 3:58 am, Sjeiti sje...@gmail.com wrote: You could use php-gd, like so: [code]?php // Set the content-type //header(Content-type: image/png); $sText = isset($_GET[text])?$_GET[text]:asdf; $sFileName = isset($_GET[file])?$_GET[file]:(style/txtimg_. $sText..png); $iSize = isset($_GET[size])?intVal($_GET[size]):20; if (!file_exists($sFileName)) { $oFont = Superplanet.ttf; $iFsize = $iSize; $iX = 1; $iY = $iFsize+2; $iW = 120; $iH = 44; // create test to find size $oTestImg = imagecreatetruecolor(1, 1); $cBg = imagecolorallocate($oTestImg, 0,0,0); $cFg = imagecolorallocate($oTestImg, 255, 255, 255); imagefill($oTestImg, 0, 0, $cBg); $aPoints = imagettftext($oTestImg, $iFsize, 0, $iX, $iY, $cFg, $oFont, $sText); imagedestroy($oTestImg); $iW = $aPoints[2]+1; // img $oImg = imagecreatetruecolor($iW, $iH); imagesavealpha($oImg, true); $cTrans = imagecolorallocatealpha($oImg, 255, 255, 255, 127); $cRed = imagecolorallocate($oImg, 182,13,62); $cWhite = imagecolorallocate($oImg, 227,215,198); $cBlack = imagecolorallocate($oImg, 0,0,0); imagefill($oImg, 0, 0, $cTrans); $aPos = array(array(-1,-1),array(1,-1),array(-1,1),array(1,1)); // normal foreach ($aPos as $aPs) imagettftext($oImg, $iFsize, 0, $iX+$aPs[0], $iY+$aPs[1], $cWhite, $oFont, $sText); imagettftext($oImg, $iFsize, 0, $iX, $iY, $cRed, $oFont, $sText); // hoover foreach ($aPos as $aPs) imagettftext($oImg, $iFsize, 0, $iX+$aPs[0], $iH/2+$iY+$aPs[1], $cRed, $oFont, $sText); imagettftext($oImg, $iFsize, 0, $iX, $iH/2+$iY, $cWhite, $oFont, $sText); // $sPos = $aPoints[0]./.$aPoints[1]. .$aPoints[2]./.$aPoints [3]; // imagettftext($oImg, 16, 0, $iX, $iH/2+$iY, $cBlack, $oFont, $sPos); // echo $sFileName; imagealphablending( $oImg, true ); imagepng($oImg, $sFileName); imagedestroy($oImg);} list($iW) = getimagesize( $sFileName );// [, array $imageinfo ] ) echo $iW; //imagepng($oImg); //imagedestroy($oImg); ?[/code] cheriana wrote: Hi - I am developing a site in joomla using the superfish drop down menu and would like to be able to replace the main menu links (not the drop downs) with a true type font. I know there are many joomla sifr plugins, but none of them seem to be compatible with the superfish menu. If I can't integrate superfish with sifr, is it possible to make the links images instead? Here's the site I'm working on: http://projects.thatsus.com/angelinascms/ Thanks!
[jQuery] Re: Creating callable methods, and binding them to objects' actions.
Missed the colon, the single quotes should be OK; the jQuery docs' example even uses them: $(input[name='newsletter']) On Feb 19, 12:11 am, Ricardo Tomasi ricardob...@gmail.com wrote: I don't think you need the colon in there (nor the single quotes) $(input[name=donation_type]) On Feb 19, 4:04 am, mkmanning michaell...@gmail.com wrote: You shouldn't have to refer to the same object in different ways, $ (input:[name='donation_type']) will work for both getting the value and binding an event. The @ before the attribute name was deprecated as of version 1.2 On Feb 18, 9:51 pm, gberz3 gbe...@gmail.com wrote: Ok, I got it to work using the following: $(#chargetotal).change(updateDonationTotal); $(input:[name='donation_type']).change(updateDonationTotal); I mistakenly posted chargetotal as the radio when it was actually a text field. That said, what is the difference between the following items: var donation_type = $(input:[...@name:donation_type]:checked).val(); $(input:[name='donation_type']).change(updateDonationTotal); It doesn't seem very intuitive to have to refer to the same item in different ways in order to get different results. I should be able to say GET OBJECT where NAME EQUALS regardless of whether I'm looking for its value or to bind to one of its methods. Can someone shed some light on why I must call each of these methods on the input in the different manners? Thanks. On Feb 18, 7:10 pm, mkmanning michaell...@gmail.com wrote: try: $(input:[...@id:chargetotal]).change(updateDonationTotal); On Feb 18, 1:55 pm, gberz3 gbe...@gmail.com wrote: Hi All, I'm having a bit of a problem with selectors and binding in jQuery. Basically I want to do 2 things: 1) create a javascript method callable by name that updates a div 2) bind that method to a set of radio buttons that runs the method on change It seems that none of the examples explicitly cover instances where you roll your own methods. They all assume function(){} which I personally consider messy. That said, I have the following code thus far: script type=text/javascript $(document).ready(function(){ function updateDonationTotal(){ var amount = $('#chargetotal').val(); var multiplier = 0; var total = 0; var donation_type = $(input:[...@name:donation_type]:checked).val (); var message = ; //it's gonna be one of: donation_general, donation_stop_tab, donation_pipe switch(donation_type){ case 'donation_general': {multiplier = 1; break} case 'donation_stop_tab': {multiplier = 500; break} case 'donation_pipe': {multiplier = 100; break} } total = amount * multiplier; message = nbsp; x + multiplier + = + total; $(#donation_total).html(message); console.log(message); }; $(input:[...@id:chargetotal]).change(updateDonationTotal();); }); /script The method 'updateDonationTotal' works fine. However, I receive errors when trying to bind the method in various ways to the radio buttons. I've tried 'bind', 'click', 'change'...all error out. Please advise. Best!
[jQuery] jQuery jCarousel Lite and Image Swap problem
I have tried to use the jCarousel Lite to do the task that I am after on its own, but without any luck. The best way for me to describe what I want is to not tell you what I want and point you to http://htmlstore.co.uk/jqueryproblem/ The carousel works fine, and the swapping of images works fine also, however, when it gets to the point where the carousel goes back to the start there appears to be a break in the code and nothing works. Any ideas?
[jQuery] IE Problems
Hi, I am using 1.6rc6, in firefox everything is absolutely great, but the problems come in Internet Explorer (6 and 7) Firstly the code i'm using to generate the dialog boxes is: function openDialog(title,node,w,h) { $('#'+node).dialog({ width : w, modal : true, height : y, title : title }); $('#'+node).dialog('open'); } In internet explorer however the height option seems to be totally invalid, for example if I pass through a height of 300, it gets a height of around 50, in almost all occasions it takes around 250 off the height, can this be explained anywhere? If I use a height of auto, it does show the form correctly however that is not how I want it to be. The shadow of the dialog box is also causing problems, in Firefox it is all the way around the dialog and looks great (which by the way doesn't expand with the dialog box if using auto for height), however in Internet explorer the top left is in the correct position, but due to padding property not making the box bigger as it does with firefox, the shadow does not show all the way around but only on the left and top edges of the dialog box. One more issue in IE, is in the ui.theme.css the very top css property (.ui-widget) has a font size of 1.1em, if I leave this font size in, the dialog box doesn't show in IE, but does in firefox, if I take it off or change font size to a % or px, it comes up (with all the issues described above). Any help on this would be great as its been causing my problems all day. Thanks Kevin
[jQuery] Jquery 1.6rc6 Dialog Boxes Internet Explorer Bugs
Hi, I'm using JQuery 1.6rc6, and I am attempting to create dialog boxes which I had no trouble with using 1.5 and have no trouble with in Firefox, the problem is when it comes to Internet explorer (6 ro 7), there are 4 main problems these are listed below. Firstly I will give the code i'm using to open the dialog boxes: function openDialog(title,node,x,y) { $('#'+node).dialog({ width : x, modal : true, height : y, title : title }); $('#'+node).dialog('open'); } As I said this works great in firefox, now for the problems in IE. 1. The height doesn't seem to work as it should do, If I set the height to 300, the height seems to be around 50, always knocking around 250 off the height, the only time I can get height working correctly is if I use auto as the height, which I dont want to do (more of auto later). 2. The shadow around the box on IE only covers the left and top parts of the dialog window due to the margin: -8 0 0 -8 property, it also has a padding of 8px all the way around, whcih in firefox expands the shadow box and makes it fit.. this doesn't happen with IE. 3. The scrollbars that the new dialog boxes have on by default aren't in the correct position, the left scrollbar is about 20 to 30px to the left of where it should be and the bottom scrollbar around 10px from the bottom of the dialog. 4. the ui.theme.css file that comes with theme roller as a ui-widget property in at the top whcih specifies a font in 1.1em, if I leave this font size in, the dialog box simply does even appear in ie6 or 7, if i change this to represent percentage or pixels, the box then does appear... very strange With the auto property, I have also noticed in both IE and Firefox, that the shadow doesn't expand with the dialog as it grows inside. If anyone can help me with the 4 first errors that woudl be great (number 4 i have got rid of by simply removing the em on the end of the font, but the others still exist) Thanks Kevin
[jQuery] Re: A question for John Resig
I'm curious what the benefit of that would be. Given that the window.undefined property exists and has the undefined value, I'd think they would give the same result. They give the same results for properties, at least: someObject.undefinedProperty === undefined but not for variables that are undefined (meaning that 'var someUndefinedVar' or 'window.someUndefinedVar' was not used): someUndefinedVar === undefined // error typeof someUndefinedVar === undefiend // works I think it'd be better to be consistent everywhere. --John
[jQuery] Re: IE Problems
Sorry Double Post... ignore this one and look at Jquery 1.6rc6 Dialog Boxes Internet Explorer Bugs Thanks -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of KevinM2k Sent: 19 February 2009 15:11 To: jQuery (English) Subject: [jQuery] IE Problems Hi, I am using 1.6rc6, in firefox everything is absolutely great, but the problems come in Internet Explorer (6 and 7) Firstly the code i'm using to generate the dialog boxes is: function openDialog(title,node,w,h) { $('#'+node).dialog({ width : w, modal : true, height : y, title : title }); $('#'+node).dialog('open'); } In internet explorer however the height option seems to be totally invalid, for example if I pass through a height of 300, it gets a height of around 50, in almost all occasions it takes around 250 off the height, can this be explained anywhere? If I use a height of auto, it does show the form correctly however that is not how I want it to be. The shadow of the dialog box is also causing problems, in Firefox it is all the way around the dialog and looks great (which by the way doesn't expand with the dialog box if using auto for height), however in Internet explorer the top left is in the correct position, but due to padding property not making the box bigger as it does with firefox, the shadow does not show all the way around but only on the left and top edges of the dialog box. One more issue in IE, is in the ui.theme.css the very top css property (.ui-widget) has a font size of 1.1em, if I leave this font size in, the dialog box doesn't show in IE, but does in firefox, if I take it off or change font size to a % or px, it comes up (with all the issues described above). Any help on this would be great as its been causing my problems all day. Thanks Kevin
[jQuery] Re: Adding methods to Plugins
Mike, Many thanks for your reply, although I'm totally confused now ... If I understand correctly; - options is checked for being a string (method) or a function (set of options) - If it's a string (and using 'a', 'b' or 'c' from my previous example) then execute the relevant code depending upon a,b or c. - If it isn't then the plugin code continues as usual with either user-supplied or default options, starting with the line 'options = $.extend(defaults, options);' If so, would doing this effect the 'options' or 'method' code by preventing either being able to run functions within the plugin eg, var someFunction = function(e) { // do something return false; }; Thanks for your help. djl On 19 Feb 2009, at 13:16, Mike Alsup wrote: Well, that sort of works, although I need to be able to pass (and within the plugin provide default) options - I can do either but not both so I'm a bit stumped: Oh, I see what you mean now. Try something like this: $.fn.myplugin = function(options) { var defaults = { width: 300 }; if (typeof options == 'string') options = { someDefaultOption: options }; else if ($.isFunction(option)) options = { callback: options }; options = $.extend(defaults, options); ... };
[jQuery] Re: Jquery 1.6rc6 Dialog Boxes Internet Explorer Bugs
Could you please post this to the jQuery UI list? http://groups.google.com/group/jquery-ui Thanks. - Richard On Thu, Feb 19, 2009 at 10:47 AM, KevinM2k kevin...@googlemail.com wrote: Hi, I'm using JQuery 1.6rc6, and I am attempting to create dialog boxes which I had no trouble with using 1.5 and have no trouble with in Firefox, the problem is when it comes to Internet explorer (6 ro 7), there are 4 main problems these are listed below. Firstly I will give the code i'm using to open the dialog boxes: function openDialog(title,node,x,y) { $('#'+node).dialog({ width : x, modal : true, height : y, title : title }); $('#'+node).dialog('open'); } As I said this works great in firefox, now for the problems in IE. 1. The height doesn't seem to work as it should do, If I set the height to 300, the height seems to be around 50, always knocking around 250 off the height, the only time I can get height working correctly is if I use auto as the height, which I dont want to do (more of auto later). 2. The shadow around the box on IE only covers the left and top parts of the dialog window due to the margin: -8 0 0 -8 property, it also has a padding of 8px all the way around, whcih in firefox expands the shadow box and makes it fit.. this doesn't happen with IE. 3. The scrollbars that the new dialog boxes have on by default aren't in the correct position, the left scrollbar is about 20 to 30px to the left of where it should be and the bottom scrollbar around 10px from the bottom of the dialog. 4. the ui.theme.css file that comes with theme roller as a ui-widget property in at the top whcih specifies a font in 1.1em, if I leave this font size in, the dialog box simply does even appear in ie6 or 7, if i change this to represent percentage or pixels, the box then does appear... very strange With the auto property, I have also noticed in both IE and Firefox, that the shadow doesn't expand with the dialog as it grows inside. If anyone can help me with the 4 first errors that woudl be great (number 4 i have got rid of by simply removing the em on the end of the font, but the others still exist) Thanks Kevin
[jQuery] tech demos
Hey, now that i have a working example of my CMS again, i'd like to share a tech demo with the world, and see other people's work with jQuery too.. Mine is currently up at http://snow-show.info/ It tends to max out a browser with all the visuals ;) Lemme know what you think of it...
[jQuery] Finding values (text,numbers, regexps) in objects (arrays or key/value pairs)
I know that this is not the place to post my question but here it is. If someone knows a better place please do inform. I have an array of objects and I want to retrieve specific elements that match certain criteria, i.e. find value A in an object B. The problem is that I cannot know what is A (text, object, reg exp, array) and what is B (text, object, array). Also, I must assume that B may be an array or a key/value object and that A may be anywhere (including 'children' objects). This is usually the case when I have a JSON response from an external source and want to find something in there but without hard-coding any specific methods or search cases. I think the best way to achieve this is to have a method loop through the objects and arrays that are passed (and found) and call it self until there only two string/number/regexp values to be compared against. What I've done up to now is here http://jsbin.com/ahezi/edit - if you haven't understood what I just said perhaps the example on this page will help. Even tho it works as expected it is quite slow and I have no idea where the problem is. So my question is this: Is there a better way to achieve this result, and if not, how can I make the Find function faster?
[jQuery] Re: Anchor HREF update and delayed navigation
On Thu, Feb 19, 2009 at 10:41 AM, KihOshk goo...@microsopht.com wrote: I was trying to avoid setting the location variable since the anchors that this method will be affecting can be either target=_self or target=_blank. I tried this, but the target assignment isn't respected: function callback(link,json) { location.target=link.attr('target'); location.href=json.href; } If there's a target set, just change the location of that window. Or, create the window first, and then change the location. Keep in mind that the target attribute can be the name of a window, just as the window method accepts a name. Same thing.
[jQuery] Re: Jquery 1.6rc6 Dialog Boxes Internet Explorer Bugs
Will do, Cheers! From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Richard D. Worth Sent: 19 February 2009 16:31 To: jquery-en@googlegroups.com Subject: [jQuery] Re: Jquery 1.6rc6 Dialog Boxes Internet Explorer Bugs Could you please post this to the jQuery UI list? http://groups.google.com/group/jquery-ui Thanks. - Richard On Thu, Feb 19, 2009 at 10:47 AM, KevinM2k kevin...@googlemail.com wrote: Hi, I'm using JQuery 1.6rc6, and I am attempting to create dialog boxes which I had no trouble with using 1.5 and have no trouble with in Firefox, the problem is when it comes to Internet explorer (6 ro 7), there are 4 main problems these are listed below. Firstly I will give the code i'm using to open the dialog boxes: function openDialog(title,node,x,y) { $('#'+node).dialog({ width : x, modal : true, height : y, title : title }); $('#'+node).dialog('open'); } As I said this works great in firefox, now for the problems in IE. 1. The height doesn't seem to work as it should do, If I set the height to 300, the height seems to be around 50, always knocking around 250 off the height, the only time I can get height working correctly is if I use auto as the height, which I dont want to do (more of auto later). 2. The shadow around the box on IE only covers the left and top parts of the dialog window due to the margin: -8 0 0 -8 property, it also has a padding of 8px all the way around, whcih in firefox expands the shadow box and makes it fit.. this doesn't happen with IE. 3. The scrollbars that the new dialog boxes have on by default aren't in the correct position, the left scrollbar is about 20 to 30px to the left of where it should be and the bottom scrollbar around 10px from the bottom of the dialog. 4. the ui.theme.css file that comes with theme roller as a ui-widget property in at the top whcih specifies a font in 1.1em, if I leave this font size in, the dialog box simply does even appear in ie6 or 7, if i change this to represent percentage or pixels, the box then does appear... very strange With the auto property, I have also noticed in both IE and Firefox, that the shadow doesn't expand with the dialog as it grows inside. If anyone can help me with the 4 first errors that woudl be great (number 4 i have got rid of by simply removing the em on the end of the font, but the others still exist) Thanks Kevin
[jQuery] Re: 1.3.1 Bogs down on table parsing
OK, I tried your suggestion, and the performance is about the same as it was using the second revision in 1.3.1. The hovers execute about quarter to a half second after you move your mouse over it. On the plus side, when I am using 1.2.6, it is extremely fast and performance has improved significantly do to your help. Thanks to your input, it is much appreciated. Here is the revised code: function setDetail() { $('.detailShowIcon').hide(); // hide all of the detail show icons $('.detailShowIcon').parent().addClass('arrowHidden').css ({width:'20px', height:'18px'}); // for the arrow detail toggles $('table tbody tr').bind(mouseover,function(event) { var row = getRow(event, 'tr'); // insurance to make sure that we have the row var imageCellDiv = '#arrow-' + $(row).attr('id') + div; //alert($(row).attr('id').match('detail')); if(!$(row).attr('id').match('detail')) { if($(row).attr('class') != 'text2') { $(row).attr('class','text4'); $(imageCellDiv).removeClass('arrowHidden'); } else { $(imageCellDiv).removeClass('arrowShow'); } $(imageCellDiv).addClass('arrowActive'); } }) .bind('mouseout',function(event) { var row = getRow(event, 'tr'); // insurance to make sure that we have the row var imageCellDiv = '#arrow-' + $(row).attr('id') + div; if(!$(row).attr('id').match('detail')) { if($(row).attr('class') != 'text2') { $(row).attr('class','text3'); $(imageCellDiv).removeClass('arrowActive'); $(imageCellDiv).addClass('arrowHidden'); } else { $(imageCellDiv).removeClass('arrowActive'); $(imageCellDiv).addClass('arrowShow'); } } }) .bind('click',function(event) { var td = getRow(event, 'td'); // insurance to make sure that we have the row if($(td).attr('id').match('arrow')) { var row = '#' + $(td).parent('tr').attr('id'); var detailDiv = '#detail-' + $(td).parent('tr').attr('id'); //alert(row); if($(row).attr('class') == 'text2') { $(row).attr('class','text4'); $(detailDiv).hide(); } else { $(row).attr('class','text2'); $(detailDiv).show(); } } setFooter(); // re-calculate the footer possition }); } /** * Gets the element that we want out of an event * @param event The event * @param element The element to isolate * @return */ function getRow(event, element) { var thisRow; var target = $(event.target); if(target.is(element)) { thisRow = target; } else if(target.parents(element).length) { thisRow = target.parents(element + ':first'); } return thisRow; } Again, thanks for your input and time. On Feb 18, 3:32 pm, zenbaida zenba...@gmail.com wrote: Will try it out, thanks! On Feb 18, 1:15 pm, James james.gp@gmail.com wrote: How about doing it this way: $(table tbody tr) .bind(mouseover, function(e) { $(e.target).parent().children(td).addClass(row_on); }) .bind(mouseout, function(e) { $(e.target).parent().children(td).removeClass(row_on); }) .bind(click, function(e) { var target = $(e.target); // td is clicked on if (target.parent().parent().parent().is(table)) { var tr_id = target.parent().attr(id); alert(tr_id); }); I'm fairly sure that would work. I have something similar setup such that when you hover over each row, it'll highlight the row, and un- highlight when you leave the row. It'll highlight the other rows also if you hover over them without the mouse leaving each table. Each row also performs an action when clicked. You can also replace 'bind' with 'live' if you have to eventually add more rows dynamically. Just don't use the .each() for each tr. On Feb 18, 9:30 am, zenbaida zenba...@gmail.com wrote:
[jQuery] Re: Data returned (from a JQuery function) with the $ character cause to error in IE
#field is: span id=field$ 25.00/span On Feb 19, 5:04 pm, Richard D. Worth rdwo...@gmail.com wrote: Is #field a text input? Perhaps you want .val() instead of .text() ? - Richard On Thu, Feb 19, 2009 at 8:56 AM, major mei...@gmail.com wrote: assume the following code: -- price = $(#field).text(); -- This code cause the following error in IE: object doesn't support this property or method. $(#field).text(); returns a string, like: $21.3. (the data is price). I guess the $ character (of $21.3) make JQuery confused as it thinks this is a function. BUT, when I write something like this: var htmlOut = 'span' + $(#field).text(); + '/span' No error occurs! What may cause this bug in IE to happen? Thanks,Major
[jQuery] Superfish Submenus Appear Under Slideshow Pro
We have a page on our site using a Slideshow Pro flash gallery. The main part of the navigation is perfecto but the submenus appear under or behind Slideshow Pro in all browsers. Here is a link to the page that I am having problems with: http://realcoolstore.com/site/work/ I have tried z-index on different elements of the page (navigation, submenus, content, embed and object) with no luck. I have also tried to wmode=transparent and wmode=opaque. Alas, I have failed and turn to some guru's help. Also, in case this is useful... our site uses Expression Engine.
[jQuery] [tooltip] Is there a way to make tooltip recognize modified title attributes?
I am trying to change the tooltip message based on user interaction, but it doesn't look like the jquery tooltip plugin recognizes modified titles. It seems like tooltip caches whatever is on the page during the initial pageload, and I can't figure out how to refresh the information. If I change a title after pageload, I have a weird effect where the jquery tooltip displays the previous message, but the browser also displays the updated title attribute in it's native title display. Keep in mind I am not changing the title attribute while in a hover state. Is there an easy way to either refresh all tooltip messages, or just single out one based on a jquery selector?
[jQuery] Validation problem with versions 1.3 and 1.3.1
Hi, Trying to upgrade from Version 1.2.6 to 1.3/1.3.1, but my validation stopped working. Here's my working code: script src=jQuery/jquery-1.2.6.js type=text/javascript/script script type=text/javascript src=jQuery/jquery.validate.js/ script script src=jQuery/jquery.dump.js type=text/javascript/script script $(document).ready(function() { $(#healthbeat).validate( { messages: { issuemonth: Please enter an Issue Month, issueyear: Please enter an Issue Year, quote: Please enter a Quote, authorquote: Please enter the Author of the Quote, title: Please enter a Title, grab:Please enter a Grab, paragraph1: Please enter text for Paragraph below, paragraph2: Please enter text for Paragraph below, paragraph3: Please enter text for Paragraph below, paragraph4: Please enter text for Paragraph below, paragraph5: Please enter text for Paragraph below, paragraph6: Please enter text for Paragraph below, paragraph7: Please enter text for Paragraph below, paragraph8: Please enter text for Paragraph below, paragraph9: Please enter text for Paragraph below, paragraph10: Please enter text for Paragraph below, paragraph11: Please enter text for Paragraph below, paragraph12: Please enter text for Paragraph below, paragraph13: Please enter text for Paragraph below, paragraph14: Please enter text for Paragraph below, paragraph15: Please enter text for Paragraph below, paragraph16: Please enter text for Paragraph below, paragraph17: Please enter text for Paragraph below, paragraph18: Please enter text for Paragraph below, paragraph19: Please enter text for Paragraph below, paragraph20: Please enter text for Paragraph below, image1: Please enter file name for Image above, image2: Please enter file name for Image above, image3: Please enter file name for Image above, image4: Please enter file name for Image above, image5: Please enter file name for Image above, image6: Please enter file name for Image above, image7: Please enter file name for Image above, image8: Please enter file name for Image above, image9: Please enter file name for Image above, image10: Please enter file name for Image above, image11: Please enter file name for Image above, image12: Please enter file name for Image above, image13: Please enter file name for Image above, image14: Please enter file name for Image above, image15: Please enter file name for Image above, image16: Please enter file name for Image above, image17: Please enter file name for Image above, image18: Please enter file name for Image above, image19: Please enter file name for Image above, image20: Please enter file name for Image above, alttxt1: Please enter Alt Text for Image above, alttxt2: Please enter Alt Text for Image above, alttxt3: Please enter Alt Text for Image above, alttxt4: Please enter Alt Text for Image above, alttxt5: Please enter Alt Text for Image above, alttxt6: Please enter Alt Text for Image above, alttxt7: Please enter Alt Text for Image above, alttxt8: Please enter Alt Text for Image above, alttxt9: Please enter Alt Text for Image above, alttxt10: Please enter Alt Text for Image above, alttxt11: Please enter Alt Text for Image above, alttxt12: Please enter Alt Text for Image above, alttxt13: Please enter Alt Text for Image above, alttxt14: Please enter Alt Text for Image above, alttxt15: Please enter Alt Text for Image above, alttxt16: Please enter Alt Text for Image above, alttxt17: Please enter Alt Text for Image above, alttxt18: Please enter Alt Text for Image above, alttxt19: Please enter Alt Text for Image above, alttxt20: Please enter Alt Text for Image above, List1: Please enter text for List Item above, List2: Please enter text for List Item above, List3: Please enter text for List Item above, List4: Please enter text for List Item above, List5: Please enter text for List Item above, List6: Please enter text for List Item above, List7: Please enter text for List Item above, List8: Please enter text for List Item above, List9: Please enter text for List Item above, List10: Please enter text for List Item above, List11: Please enter text for List Item above, List12: Please enter text for List Item above, List13: Please enter text for List Item above, List14: Please enter text for List Item above, List15: Please enter text for List Item above, List16: Please enter text for List Item above, List17: Please enter text for List Item above, List18: Please enter text for List Item above, List19: Please enter text for List Item above, List20: Please enter text for List Item above, List21: Please enter text for List Item
[jQuery] Re: Data returned (from a JQuery function) with the $ character cause to error in IE
sorry,I don't have a link. If I run a command like: $(#field).text(); or any other JQuery command which returns a string with the $ character. (for example: $ 21.3) How can I tell javascript not to relate the $ in $ 21.3 as a JQuery command? On Feb 19, 4:20 pm, Mike Alsup mal...@gmail.com wrote: -- price= $(#field).text(); -- This code cause the following error in IE: object doesn't support this property or method. $(#field).text(); returns a string, like: $21.3. (the data is price). I guess the $ character (of $21.3) make JQuery confused as it thinks this is a function. BUT, when I write something like this: var htmlOut = 'span' + $(#field).text(); + '/span' No error occurs! What may cause this bug in IE to happen? Thanks,Major That doesn't make sense, both statements should execute fine. Can you post a link?
[jQuery] Re: Minified and Gzip?
On Feb 17, 9:55 pm, Ricardo Tomasi ricardob...@gmail.com wrote: How are you checking it? The 'Net' tab in Firebug should tell you if it's gzipped or not. I just checked firebug: Content-Length: 55774 Content-Type: application/x-javascript What should my apache config look like?
[jQuery] Access remote page using jQuery.ajax
According to the API documentation of jQuery, the jQuery.ajax function is supposed to: Load a remote page using an HTTP request. I've tried running a function with jQuery.ajax: var xmlDocument = 'dev.xml'; $.ajax({ type: POST, url: http://example.com:80/xmlservlet;, processData: false, data: xmlDocument, success: function(msg){ alert( Data Saved: ); } and I keep getting an error Access to restricted URI denied code: 1012 when I run this with Firebug. Googling this error reveals that it may be an issue with cross-domain AJAX requests. Further research indicates it may be a Firefox security issue, since I am running it from my localhost.http://jquery-howto.blogspot.com/2008/12/access-to- restricted-uri-denied-code.html. This article says to fix it, you should run it from an internal webserver, which is what I already have setup from localhost with IIS, PHP, etc. I tried to run this in IE7 too, but didn't get the desired Data Saved alert, and I don't know of a way to debug javascript in IE.
[jQuery] Send a file, receive data and populate form
Hello, I need to build a page with a form to send a file to a server and take the (XML) data sent back from this server and dispatch them to several form fields. How can I do that with jQuery and its Ajax functions ? Thanks a lot G.
[jQuery] Jquery Png Fix
I am testing PNG FIX from http://jquery.andreaseberhard.de/pngFix/index.html plugin, it works great on localhost on my machine Ubuntu/apache/php5. When I upload it to my server it doesnt work at all showing no error, I uploaded all the folder and everything the same. any solutions or experiences?
[jQuery] Re: Howto: Adding a pause button to jcarousel
Great work Jeremy. I am using jcarousel in horizontal alignment mode and I needed a way to pause the auto scrolling when a user hovers over an item; otherwise clicking on an item could be difficult as the item could scroll away before having clicked on it. Based on your code I was able to do this with the code below: jQuery(document).ready(function() { jQuery('#mycarousel').jcarousel({ scroll: 1, auto: 2, wrap: 'last', initCallback: function(jc, state) { if (state == 'init') { /* Pause carousel scrolling when a user mouses overs an item and restart the scrolling when they mouse out. * Written by cormac at finisco dot com 19/2/2009 based on work by Jeremy Mikola: * http://groups.google.com/group/jquery-en/browse_thread/thread/f550b94914d10065 */ jc.startAutoOrig = jc.startAuto; jc.startAuto = function() { if (!jc.paused) { jc.startAutoOrig(); } } jc.pause = function() { jc.paused = true; jc.stopAuto(); }; jc.play = function() { jc.paused = false; jc.startAuto(); }; $('li.jcarousel-item').mouseover(function() { jc.pause(); }); $('li.jcarousel-item').mouseout(function() { jc.play(); }); } jc.play(); } }); });
[jQuery] How to surround All content after a specified HTML attribute H2?
I am trying to look through content in a div and if i find an H2 or whatever attribute the content or HTML that follows it will be encloded in a div with a class. I will do this for every H2 so if i have 3 H2's and some paragraphs after them it will surround all HTML after each of the H2 in a div. So my HTML would look like this... h2some dummy text/h2 pSome Content/p h2some dummy text/h2 pSome Content/p h2some dummy text/h2 pSome Content/p And i want it to do this... h2some dummy text/h2 div class=someclasspSome Content/p/div h2some dummy text/h2 div class=someclasspSome Content/p/div h2some dummy text/h2 div class=someclasspSome Content/p/div Anyone know how to do this and can help me? I am just starting with jquery so any examples would be s appreciated and you would be my hero! :) Thanks in advance
[jQuery] Re: Minified and Gzip?
Here is what I've added to my Apache Config to support mod_deflate of my html, css and js. I just dropped this in at the bottom of my httpd.config. # Create the output filter SetOutputFilter DEFLATE # Netscape 4.x has some problems BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch bMSIE !no-gzip !gzip-only-text/html ## Don't compress for IE5.0 BrowserMatch MSIE 5.0 no-gzip # Don't compress images, flash, PDFs SetEnvIfNoCase Request_URI.(?:gif|jpe?g|png|swf|pdf)$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary Hope that helps... -- Brandon Aaron On Tue, Feb 17, 2009 at 7:00 PM, ScottChiefBaker scott.ba...@gmail.comwrote: How do I setup JQuery to be server Gzipped? Using apache I installed mod_deflate and set it up to serve .js files as gzipped, but it doesn't seem to be working. Does anyone have any example configurations I could steal from? - Scott
[jQuery] Re: Adding methods to Plugins
Many thanks for your reply, although I'm totally confused now ... I was just giving an example of using type-checking on the options argument. The following is a real snippet from the ajaxSubmit fn of the form plugin: if (typeof options == 'function') options = { success: options }; The common usage of the ajaxSubmit fn is to pass an option *object*. But that fn also permits you to pass a callback function by itself. If you do pass a callback then a new options object is created and its success property is assigned to the callback. (footnote: I should be using $.isFunction in that test). But what happens after you do your type checking is up to you. In the case of the ajaxSubmit example, processing continues as normal. If so, would doing this effect the 'options' or 'method' code by preventing either being able to run functions within the plugin eg, var someFunction = function(e) { // do something return false; }; Not sure I understand that last question, but I don't see why someFunction would effect anything. Mike
[jQuery] Re: Creating callable methods, and binding them to objects' actions.
I meant to say they are not required (when the value has no special characters). cheers, - ricardo On Feb 19, 1:02 pm, mkmanning michaell...@gmail.com wrote: Missed the colon, the single quotes should be OK; the jQuery docs' example even uses them: $(input[name='newsletter']) On Feb 19, 12:11 am, Ricardo Tomasi ricardob...@gmail.com wrote: I don't think you need the colon in there (nor the single quotes) $(input[name=donation_type]) On Feb 19, 4:04 am, mkmanning michaell...@gmail.com wrote: You shouldn't have to refer to the same object in different ways, $ (input:[name='donation_type']) will work for both getting the value and binding an event. The @ before the attribute name was deprecated as of version 1.2 On Feb 18, 9:51 pm, gberz3 gbe...@gmail.com wrote: Ok, I got it to work using the following: $(#chargetotal).change(updateDonationTotal); $(input:[name='donation_type']).change(updateDonationTotal); I mistakenly posted chargetotal as the radio when it was actually a text field. That said, what is the difference between the following items: var donation_type = $(input:[...@name:donation_type]:checked).val(); $(input:[name='donation_type']).change(updateDonationTotal); It doesn't seem very intuitive to have to refer to the same item in different ways in order to get different results. I should be able to say GET OBJECT where NAME EQUALS regardless of whether I'm looking for its value or to bind to one of its methods. Can someone shed some light on why I must call each of these methods on the input in the different manners? Thanks. On Feb 18, 7:10 pm, mkmanning michaell...@gmail.com wrote: try: $(input:[...@id:chargetotal]).change(updateDonationTotal); On Feb 18, 1:55 pm, gberz3 gbe...@gmail.com wrote: Hi All, I'm having a bit of a problem with selectors and binding in jQuery. Basically I want to do 2 things: 1) create a javascript method callable by name that updates a div 2) bind that method to a set of radio buttons that runs the method on change It seems that none of the examples explicitly cover instances where you roll your own methods. They all assume function(){} which I personally consider messy. That said, I have the following code thus far: script type=text/javascript $(document).ready(function(){ function updateDonationTotal(){ var amount = $('#chargetotal').val(); var multiplier = 0; var total = 0; var donation_type = $(input:[...@name:donation_type]:checked).val (); var message = ; //it's gonna be one of: donation_general, donation_stop_tab, donation_pipe switch(donation_type){ case 'donation_general': {multiplier = 1; break} case 'donation_stop_tab': {multiplier = 500; break} case 'donation_pipe': {multiplier = 100; break} } total = amount * multiplier; message = nbsp; x + multiplier + = + total; $(#donation_total).html(message); console.log(message); }; $(input:[...@id:chargetotal]).change(updateDonationTotal();); }); /script The method 'updateDonationTotal' works fine. However, I receive errors when trying to bind the method in various ways to the radio buttons. I've tried 'bind', 'click', 'change'...all error out. Please advise. Best!
[jQuery] Re: on click on a checkbox, highlight complete table row
Going for $(input[name^=paradigm]).is(:checked) or $(input [name^=paradigm]).not(:checked) should get you the list of input elements with name attributes starting with paradigm -- because I'm not comfortable with that [] in the name attribute... -- which either are or are not checked. You can then either .each() or .map() across that collection to get the .val() out of the checked (or not checked) elements. Since the checkbox you're trying to avoid doesn't have a name, it shouldn't be selected by either query. If I were in your position, I'd try to add a CSS class or some other custom attribute to all of the checkboxes in the collection that we want to select off of and query for that. But what the subject of your post suggests is that you're looking for... $(document).ready(function() { $(input[type=checkbox]).click(function() { $(this).parents(tr).toggleClass(HighlightClassDefinedByMyCss); }); }); which will result in any checkbox on the page adding (or removing) the HighlightClassDefinedByMyCss from the first TR in its parent chain when it is clicked. In theory. To step things up a notch, consider that this tangentally related code selectedBookmarkTitles = $(input:checked).map(function() { return $ (this).parents(tr).find(.bookmarkTitleLink).text() }).get(); will find every checked checkbox on a page, and then go to their parent table row, dig up whatever has the CSS class bookmarkTitleLink, get the text out of that element, and return that entire list of strings as an array that is being stored in the selectedBookmarkTitles variable. Hope it helps! On Feb 19, 2:43 am, heohni heidi.anselstet...@consultingteam.de wrote: Hi, sorry, for this newbie question: input type=checkbox name=paradigm[] value={$value.ver_id} / How can I check if this checkbox is checked or not? And how can I avoid this check for this particular checkbox: input type=checkbox id=paradigm_all / Thanks so much!!
[jQuery] Re: How to surround All content after a specified HTML attribute H2?
On Thu, Feb 19, 2009 at 9:27 AM, cchun...@gmail.com cchun...@gmail.comwrote: I am trying to look through content in a div and if i find an H2 or whatever attribute the content or HTML that follows it will be encloded in a div with a class. I will do this for every H2 so if i have 3 H2's and some paragraphs after them it will surround all HTML after each of the H2 in a div. This will change the element following all h2 elements in the doc. script $(function() { $('h2').next().wrap('div class=someclass/div'); }); /script If you want it to be just within a certain div, and assuming that div has an id attribute of foo, it would be: script $(function() { $('#foo h2').next().wrap('div class=someclass/div'); }); /script -- 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: Validation problem with versions 1.3 and 1.3.1
Make sure you have the latest version of the validation plug-in also (1.5.1 as of this time). On Feb 19, 6:22 am, winstonc wins...@3cinc.net wrote: Hi, Trying to upgrade from Version 1.2.6 to 1.3/1.3.1, but my validation stopped working. Here's my working code: script src=jQuery/jquery-1.2.6.js type=text/javascript/script script type=text/javascript src=jQuery/jquery.validate.js/ script script src=jQuery/jquery.dump.js type=text/javascript/script script $(document).ready(function() { $(#healthbeat).validate( { messages: { issuemonth: Please enter an Issue Month, issueyear: Please enter an Issue Year, quote: Please enter a Quote, authorquote: Please enter the Author of the Quote, title: Please enter a Title, grab:Please enter a Grab, paragraph1: Please enter text for Paragraph below, paragraph2: Please enter text for Paragraph below, paragraph3: Please enter text for Paragraph below, paragraph4: Please enter text for Paragraph below, paragraph5: Please enter text for Paragraph below, paragraph6: Please enter text for Paragraph below, paragraph7: Please enter text for Paragraph below, paragraph8: Please enter text for Paragraph below, paragraph9: Please enter text for Paragraph below, paragraph10: Please enter text for Paragraph below, paragraph11: Please enter text for Paragraph below, paragraph12: Please enter text for Paragraph below, paragraph13: Please enter text for Paragraph below, paragraph14: Please enter text for Paragraph below, paragraph15: Please enter text for Paragraph below, paragraph16: Please enter text for Paragraph below, paragraph17: Please enter text for Paragraph below, paragraph18: Please enter text for Paragraph below, paragraph19: Please enter text for Paragraph below, paragraph20: Please enter text for Paragraph below, image1: Please enter file name for Image above, image2: Please enter file name for Image above, image3: Please enter file name for Image above, image4: Please enter file name for Image above, image5: Please enter file name for Image above, image6: Please enter file name for Image above, image7: Please enter file name for Image above, image8: Please enter file name for Image above, image9: Please enter file name for Image above, image10: Please enter file name for Image above, image11: Please enter file name for Image above, image12: Please enter file name for Image above, image13: Please enter file name for Image above, image14: Please enter file name for Image above, image15: Please enter file name for Image above, image16: Please enter file name for Image above, image17: Please enter file name for Image above, image18: Please enter file name for Image above, image19: Please enter file name for Image above, image20: Please enter file name for Image above, alttxt1: Please enter Alt Text for Image above, alttxt2: Please enter Alt Text for Image above, alttxt3: Please enter Alt Text for Image above, alttxt4: Please enter Alt Text for Image above, alttxt5: Please enter Alt Text for Image above, alttxt6: Please enter Alt Text for Image above, alttxt7: Please enter Alt Text for Image above, alttxt8: Please enter Alt Text for Image above, alttxt9: Please enter Alt Text for Image above, alttxt10: Please enter Alt Text for Image above, alttxt11: Please enter Alt Text for Image above, alttxt12: Please enter Alt Text for Image above, alttxt13: Please enter Alt Text for Image above, alttxt14: Please enter Alt Text for Image above, alttxt15: Please enter Alt Text for Image above, alttxt16: Please enter Alt Text for Image above, alttxt17: Please enter Alt Text for Image above, alttxt18: Please enter Alt Text for Image above, alttxt19: Please enter Alt Text for Image above, alttxt20: Please enter Alt Text for Image above, List1: Please enter text for List Item above, List2: Please enter text for List Item above, List3: Please enter text for List Item above, List4: Please enter text for List Item above, List5: Please enter text for List Item above, List6: Please enter text for List Item above, List7: Please enter text for List Item above, List8: Please enter text for List Item above, List9: Please enter text for List Item above, List10: Please enter text for List Item above, List11: Please enter text for List Item above, List12: Please enter text for List Item above, List13: Please enter text for List Item above, List14: Please enter text for List Item above, List15: Please enter text for List Item above, List16: Please enter text for List Item above,
[jQuery] Re: How to surround All content after a specified HTML attribute H2?
actually i should clarify... not change, but wrap the elements following h2 elements with the specified HTML. On Thu, Feb 19, 2009 at 10:00 AM, Charlie Griefer charlie.grie...@gmail.com wrote: On Thu, Feb 19, 2009 at 9:27 AM, cchun...@gmail.com cchun...@gmail.comwrote: I am trying to look through content in a div and if i find an H2 or whatever attribute the content or HTML that follows it will be encloded in a div with a class. I will do this for every H2 so if i have 3 H2's and some paragraphs after them it will surround all HTML after each of the H2 in a div. This will change the element following all h2 elements in the doc. script $(function() { $('h2').next().wrap('div class=someclass/div'); }); /script If you want it to be just within a certain div, and assuming that div has an id attribute of foo, it would be: script $(function() { $('#foo h2').next().wrap('div class=someclass/div'); }); /script -- 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. -- 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: Adding methods to Plugins
What I meant by the last question can probably be better explained by looking at this plugin code: http://www.gimiti.com/kltan/demo/jTree/jquery.jtree.1.0.js Take line 55 for example; $(container).find(li).bind(mouseover, getInitial); and then lines 134-140; var getInitial = function(e){ off = $(this).offset(); h = $(this).height(); w = $(this).width(); hover = this; return false; }; Assuming the same getInitial code is included in my plugin and I do the type-checking on the options argument and fork the code accordingly, will the getInitial variable/function be available throughout the plugin? Put another way, I have a requirement to run the same piece of code - it will need to run upon initially calling the plugin and also made available as a method so it can be called when required, therefore I don't want to have to duplicate code I hope this makes sense? I'm a lot clearer on this than I was this morning, so thanks for your responses so far. djl On 19 Feb 2009, at 17:31, Mike Alsup wrote: Many thanks for your reply, although I'm totally confused now ... I was just giving an example of using type-checking on the options argument. The following is a real snippet from the ajaxSubmit fn of the form plugin: if (typeof options == 'function') options = { success: options }; The common usage of the ajaxSubmit fn is to pass an option *object*. But that fn also permits you to pass a callback function by itself. If you do pass a callback then a new options object is created and its success property is assigned to the callback. (footnote: I should be using $.isFunction in that test). But what happens after you do your type checking is up to you. In the case of the ajaxSubmit example, processing continues as normal. If so, would doing this effect the 'options' or 'method' code by preventing either being able to run functions within the plugin eg, var someFunction = function(e) { // do something return false; }; Not sure I understand that last question, but I don't see why someFunction would effect anything. Mike
[jQuery] Cannot Modify Dynamic Content
Basically, I'm trying to create a Form using jQuery. The user selects what kind of field to add and it adds the fields needed, dynamically giving each new field a new name/class by changing each field attribute from _q1 to _q2, etc. Here is the basics of my script: script type=text/javascript var q = 0; function nameup(rep, cnt){ var output = rep; output = output.replace(/Question #1/g, Question #+cnt); output = output.replace(/_q1/g, _q+cnt); return output; } $(document).ready(function() { $(.remove).click(function(){ q = q-1; var kill = $(this).attr(id); alert('ID='+kill); return false; }); var addtext = $('#add_text').html(); $('#add_text').remove(); $(#newtext).click(function(){ q = q+1; $('#theqs').append(nameup(addtext, q)); return false; }); }); /script And here is the HTML: div id=theqs/div input type=button id=newtext value=Add Text Field / div id=add_textdiv class=text_q1 strongText/strongbra class=remove href=REMOVE/a input type=hidden name=qt[] /labelstrongQuestion #1/ strong: input type=text name=fieldquestion_q1 //label labelinput type=checkbox name=fieldrequired_q1 value=required /Required/labelbr / labelHelp Text: input type=text name=fieldhelp_q1 // labelbr / /div/div --- The Add Text Field button works great, but I cannot access the REMOVE links via jQuery. I have it set to alert the ID of the REMOVE link, but it does nothing - though it works with hardcoded REMOVE links. It's like the appended HTML is not available to the DOM at all. What do I need to do to be able to manupulate this dynamically created HTML?
[jQuery] Can’t set CSS using variable
I am trying to dynamically set css with variables I retrieve from what a user types into a textfield. This is the line of code: $(get_elem_hierarchy()).css($(this).data('theCss').theProp, $ (this).data('theCss').theVal); Everything works fine. Both the css property and the css value trace to the console correctly but for whatever reason it won't set it. If I hardcode it works fine. I have tried wrapping quotes around those as well and that doesn't work either so that's not the issue. Am I missing something? I've looked all over and can't find anything that even remotely comes close to discussing this issue so maybe I'm going about this the wrong way. Any help would be greatly appreciated.
[jQuery] Re: Validation problem with versions 1.3 and 1.3.1
Thanks James that fixed it. Next problem that the latest version of the plugin executes the onsubmit when the validation fails. When the validation fails I get an empty window with: form name=healthbeat id=healthbeat action=edit_process_buttons.cfm method=post enctype=multipart/ form-data onsubmit=win=window.open ('about:blank','win','menubar=no,toolbar=no,width=10,height=10,scrollbars=yes'); target=win Version 1.4 of the validation plugin works correctly. Thanks, Winston On Feb 19, 1:20 pm, James james.gp@gmail.com wrote: Make sure you have the latest version of the validation plug-in also (1.5.1 as of this time). On Feb 19, 6:22 am, winstonc wins...@3cinc.net wrote: Hi, Trying to upgrade from Version 1.2.6 to 1.3/1.3.1, but my validation stopped working. Here's my working code: script src=jQuery/jquery-1.2.6.js type=text/javascript/script script type=text/javascript src=jQuery/jquery.validate.js/ script script src=jQuery/jquery.dump.js type=text/javascript/script script $(document).ready(function() { $(#healthbeat).validate( { messages: { issuemonth: Please enter an Issue Month, issueyear: Please enter an Issue Year, quote: Please enter a Quote, authorquote: Please enter the Author of the Quote, title: Please enter a Title, grab:Please enter a Grab, paragraph1: Please enter text for Paragraph below, paragraph2: Please enter text for Paragraph below, paragraph3: Please enter text for Paragraph below, paragraph4: Please enter text for Paragraph below, paragraph5: Please enter text for Paragraph below, paragraph6: Please enter text for Paragraph below, paragraph7: Please enter text for Paragraph below, paragraph8: Please enter text for Paragraph below, paragraph9: Please enter text for Paragraph below, paragraph10: Please enter text for Paragraph below, paragraph11: Please enter text for Paragraph below, paragraph12: Please enter text for Paragraph below, paragraph13: Please enter text for Paragraph below, paragraph14: Please enter text for Paragraph below, paragraph15: Please enter text for Paragraph below, paragraph16: Please enter text for Paragraph below, paragraph17: Please enter text for Paragraph below, paragraph18: Please enter text for Paragraph below, paragraph19: Please enter text for Paragraph below, paragraph20: Please enter text for Paragraph below, image1: Please enter file name for Image above, image2: Please enter file name for Image above, image3: Please enter file name for Image above, image4: Please enter file name for Image above, image5: Please enter file name for Image above, image6: Please enter file name for Image above, image7: Please enter file name for Image above, image8: Please enter file name for Image above, image9: Please enter file name for Image above, image10: Please enter file name for Image above, image11: Please enter file name for Image above, image12: Please enter file name for Image above, image13: Please enter file name for Image above, image14: Please enter file name for Image above, image15: Please enter file name for Image above, image16: Please enter file name for Image above, image17: Please enter file name for Image above, image18: Please enter file name for Image above, image19: Please enter file name for Image above, image20: Please enter file name for Image above, alttxt1: Please enter Alt Text for Image above, alttxt2: Please enter Alt Text for Image above, alttxt3: Please enter Alt Text for Image above, alttxt4: Please enter Alt Text for Image above, alttxt5: Please enter Alt Text for Image above, alttxt6: Please enter Alt Text for Image above, alttxt7: Please enter Alt Text for Image above, alttxt8: Please enter Alt Text for Image above, alttxt9: Please enter Alt Text for Image above, alttxt10: Please enter Alt Text for Image above, alttxt11: Please enter Alt Text for Image above, alttxt12: Please enter Alt Text for Image above, alttxt13: Please enter Alt Text for Image above, alttxt14: Please enter Alt Text for Image above, alttxt15: Please enter Alt Text for Image above, alttxt16: Please enter Alt Text for Image above, alttxt17: Please enter Alt Text for Image above, alttxt18: Please enter Alt Text for Image above, alttxt19: Please enter Alt Text for Image above, alttxt20: Please enter Alt Text for Image above, List1: Please enter text for List Item above, List2: Please enter text for List Item above, List3: Please enter text for List Item above, List4: Please enter text for List Item above,
[jQuery] Re: Validation problem with versions 1.3 and 1.3.1
I think you should remove that onsubmit attribute on the form. What is that suppose to be used for? When you submit a form, and it validates successfully, it'll open a new window and display the next page on there? On Feb 19, 8:54 am, winstonc wins...@3cinc.net wrote: Thanks James that fixed it. Next problem that the latest version of the plugin executes the onsubmit when the validation fails. When the validation fails I get an empty window with: form name=healthbeat id=healthbeat action=edit_process_buttons.cfm method=post enctype=multipart/ form-data onsubmit=win=window.open ('about:blank','win','menubar=no,toolbar=no,width=10,height=10,scrollbars=yes'); target=win Version 1.4 of the validation plugin works correctly. Thanks, Winston On Feb 19, 1:20 pm, James james.gp@gmail.com wrote: Make sure you have the latest version of the validation plug-in also (1.5.1 as of this time). On Feb 19, 6:22 am, winstonc wins...@3cinc.net wrote: Hi, Trying to upgrade from Version 1.2.6 to 1.3/1.3.1, but my validation stopped working. Here's my working code: script src=jQuery/jquery-1.2.6.js type=text/javascript/script script type=text/javascript src=jQuery/jquery.validate.js/ script script src=jQuery/jquery.dump.js type=text/javascript/script script $(document).ready(function() { $(#healthbeat).validate( { messages: { issuemonth: Please enter an Issue Month, issueyear: Please enter an Issue Year, quote: Please enter a Quote, authorquote: Please enter the Author of the Quote, title: Please enter a Title, grab:Please enter a Grab, paragraph1: Please enter text for Paragraph below, paragraph2: Please enter text for Paragraph below, paragraph3: Please enter text for Paragraph below, paragraph4: Please enter text for Paragraph below, paragraph5: Please enter text for Paragraph below, paragraph6: Please enter text for Paragraph below, paragraph7: Please enter text for Paragraph below, paragraph8: Please enter text for Paragraph below, paragraph9: Please enter text for Paragraph below, paragraph10: Please enter text for Paragraph below, paragraph11: Please enter text for Paragraph below, paragraph12: Please enter text for Paragraph below, paragraph13: Please enter text for Paragraph below, paragraph14: Please enter text for Paragraph below, paragraph15: Please enter text for Paragraph below, paragraph16: Please enter text for Paragraph below, paragraph17: Please enter text for Paragraph below, paragraph18: Please enter text for Paragraph below, paragraph19: Please enter text for Paragraph below, paragraph20: Please enter text for Paragraph below, image1: Please enter file name for Image above, image2: Please enter file name for Image above, image3: Please enter file name for Image above, image4: Please enter file name for Image above, image5: Please enter file name for Image above, image6: Please enter file name for Image above, image7: Please enter file name for Image above, image8: Please enter file name for Image above, image9: Please enter file name for Image above, image10: Please enter file name for Image above, image11: Please enter file name for Image above, image12: Please enter file name for Image above, image13: Please enter file name for Image above, image14: Please enter file name for Image above, image15: Please enter file name for Image above, image16: Please enter file name for Image above, image17: Please enter file name for Image above, image18: Please enter file name for Image above, image19: Please enter file name for Image above, image20: Please enter file name for Image above, alttxt1: Please enter Alt Text for Image above, alttxt2: Please enter Alt Text for Image above, alttxt3: Please enter Alt Text for Image above, alttxt4: Please enter Alt Text for Image above, alttxt5: Please enter Alt Text for Image above, alttxt6: Please enter Alt Text for Image above, alttxt7: Please enter Alt Text for Image above, alttxt8: Please enter Alt Text for Image above, alttxt9: Please enter Alt Text for Image above, alttxt10: Please enter Alt Text for Image above, alttxt11: Please enter Alt Text for Image above, alttxt12: Please enter Alt Text for Image above, alttxt13: Please enter Alt Text for Image above, alttxt14: Please enter Alt Text for Image above, alttxt15: Please enter Alt Text for Image above, alttxt16: Please enter Alt Text for Image above, alttxt17: Please enter Alt Text for Image above, alttxt18: Please