[jQuery] Cycle plugin creating links
Hi all, I would like to link each image in the cycle to a specific page. Any ideas on how to do this? I got it to cycle and everything is working fine. I just want it so that the actual image is clickable. Thank you.
[jQuery] jquery.Flash plugin
I was looking at the jquery.flash plugin and it looks like what I need to get the job done but I am not able to figure out how to do it. Here is some sample code from the plugin site $('.custom').flash(null, null, function(htmlOptions){ // do stuff }); Below is the code I tried using script type=text/javascript var strToAdd = 'my text to add' $(document).ready(function(){ $('#flashHere').flash(null, null, function (htmlOptions){ $(.hello).append(strToAdd) }); }); // END DOCUMENT READY /script In the end what I would really like to do is replace one div with one other if flash is not found, this will help me make an iPhone friendly version of a site with a lot of flash video on it. Any suggestions or help would be great!
[jQuery] Re: search list in a div for attribute value
Try this - it may work for you: $(function(){ var srch = [ foo, bar ] ; // make a Regex from the search terms var attr_regex = '('+srch.join('|')+')'; $('#gallery li').each(function(){ if ($(this).attr(title).match(attr_regex)) { $(this).css({background:'#f00'}); } }); }); on 28/08/2009 21:31 tatlar said:: Oops. This sentence: I want to traverse the array, looking at the title attribute, and if it is in the array $search I want the style changed. Should be: I want to traverse the list, looking at the title attribute, and if it is in the array $search I want the style changed. And this: var $title_to_search = value; // pseudo code I know this is junk $gallery.find('li').attr('title',$title).css('background- color','red'); Should be: var $title_to_search = value; // pseudo code I know this is junk $gallery.find('li').attr('title',$title_to_search).css('background- color','red'); On Aug 28, 1:27 pm, tatlar robertlnew...@gmail.com wrote: i think this is a pretty simple question, but i can't seem to figure it out. i have a list in a div: div id=gallery ul li title=foofoo/li li title=barbar/li li title=unicornunicorn/li /ul /div I have an array with values in it: var $search = [ foo, bar ] ; I want to traverse the array, looking at the title attribute, and if it is in the array $search I want the style changed. Note that #gallery has about 450 list items - the one above is abridged for this post. The array $search will at most have 5 items. So, is it faster to do a $.each() on the list items, or do a $.each() on the $search items. I am pretty sure it is faster to do the latter, but I am not sure how to get the title attribute from the list items for the match. Something like? $.each( $search, function(i, value) { var $title_to_search = value; // pseudo code I know this is junk $gallery.find('li').attr('title',$title).css('background- color','red'); }); Can someone refine this for me? Thanks in advance.
[jQuery] Re: Cycle plugin creating links
Several methods: Simplest is put an a tag around each image in your markup. Alternate method- create array of the url's and bind a click handler to images. Index the images to the url array and the window function you want such as open() for a new tab. Will need to modify cursor in CSS for this method var urlArray=['http://www.yahoo.com','http://www.google.com','http://www.ebay.com']; $("#mySlideshow img").click(function() { var imageIndex= $(".pics img").index(this); window.open(urlArray[imageIndex])// to open in same window use window.location.assign(urlArray[imageIndex]) }); quez wrote: Hi all, I would like to link each image in the cycle to a specific page. Any ideas on how to do this? I got it to cycle and everything is working fine. I just want it so that the actual image is clickable. Thank you.
[jQuery] Re: slide one div out left while sliding one in right
A good example of the behavior I want is on the firefox addons home page https://addons.mozilla.org/en-US/firefox/?application=firefox At the top, there is a pane for viewing the content of three items at a time with a back and forward button to scroll through. I need a similar way to slide one item at a time. On Aug 26, 10:16 am, W. Young wayland.yo...@docupak.com wrote: I have a container div with two inner divs. I have one inner div visible taking up 100% of the visible area and another hidden div. I want the visible div to slide to the left while simultaneously sliding the other div in from the right. This works fine except that while the right div is sliding in, it appears below the left div. How can this be done? Here is the code: script type=text/javascript src=js/jQuery/jquery.js/script script type=text/javascript src=js/jQuery/effects.core.js/ script script type=text/javascript src=js/jQuery/effects.slide.js/ script script type=text/javascript $(document).ready(function() { $(#slide).click(function() { $(#leftDiv).hide('slide', { direction: 'left' }, 1000); $(#rightDiv).show('slide', { direction: 'right' }, 1000); return false; }); }); /script div id=container style=height: 100px; div id=leftDiv style=float: left; border: solid 1px black; height: 100px; width: 100%; spansome text to slide out left/span /div div id=rightDiv style=float: left; display: none; border: solid 1px black; height: 100px; width: 100%; spansome text to slide in right/span /div /div div style=clear: both; height: 100px; input id=slide type=button value=Slide / /div
[jQuery] Re: slide one div out left while sliding one in right
there are lots of plugins to do this look for carousel or scroll in a plugin search jCarousel and scrollable are 2 excellent ones that come to mind as well as scrollto W. Young wrote: A good example of the behavior I want is on the firefox addons home page https://addons.mozilla.org/en-US/firefox/?application=firefox At the top, there is a pane for viewing the content of three items at a time with a back and forward button to scroll through. I need a similar way to slide one item at a time. On Aug 26, 10:16am, "W. Young" wayland.yo...@docupak.com wrote: I have a container div with two inner divs. I have one inner div visible taking up 100% of the visible area and another hidden div. I want the visible div to slide to the left while simultaneously sliding the other div in from the right. This works fine except that while the right div is sliding in, it appears below the left div. How can this be done? Here is the code: script type="text/_javascript_" src=""/script script type="text/_javascript_" src=""/ script script type="text/_javascript_" src=""/ script script type="text/_javascript_" $(document).ready(function() { $("#slide").click(function() { $("#leftDiv").hide('slide', { direction: 'left' }, 1000); $("#rightDiv").show('slide', { direction: 'right' }, 1000); return false; }); }); /script div id="container" style="height: 100px; " div id="leftDiv" style="float: left; border: solid 1px black; height: 100px; width: 100%;" spansome text to slide out left/span /div div id="rightDiv" style="float: left; display: none; border: solid 1px black; height: 100px; width: 100%;" spansome text to slide in right/span /div /div div style="clear: both; height: 100px;" input id="slide" type="button" value="Slide" / /div
[jQuery] ajax request form in one page, is it possible ?
Hello, I want to build a form that work on one page only, to subtract the PHP pages for getting the data from all my web forms, I tried to pass the parameters to the same page but it dosent work :( i'll be glad if you can direct me to the solution Thanks
[jQuery] Re: slide one div out left while sliding one in right
You can also try to use animate which is part of jquery core. Look up some examples on the jquery website, there are quite simple. -Anoop On 8/29/09, Charlie charlie...@gmail.com wrote: there are lots of plugins to do this look for carousel or scroll in a plugin search jCarousel and scrollable are 2 excellent ones that come to mind as well as scrollto W. Young wrote: A good example of the behavior I want is on the firefox addons home page https://addons.mozilla.org/en-US/firefox/?application=firefox At the top, there is a pane for viewing the content of three items at a time with a back and forward button to scroll through. I need a similar way to slide one item at a time. On Aug 26, 10:16 am, W. Young wayland.yo...@docupak.com wrote: I have a container div with two inner divs. I have one inner div visible taking up 100% of the visible area and another hidden div. I want the visible div to slide to the left while simultaneously sliding the other div in from the right. This works fine except that while the right div is sliding in, it appears below the left div. How can this be done? Here is the code: script type=text/javascript src=js/jQuery/jquery.js/script script type=text/javascript src=js/jQuery/effects.core.js/ script script type=text/javascript src=js/jQuery/effects.slide.js/ script script type=text/javascript $(document).ready(function() { $(#slide).click(function() { $(#leftDiv).hide('slide', { direction: 'left' }, 1000); $(#rightDiv).show('slide', { direction: 'right' }, 1000); return false; }); }); /script div id=container style=height: 100px; div id=leftDiv style=float: left; border: solid 1px black; height: 100px; width: 100%; spansome text to slide out left/span /div div id=rightDiv style=float: left; display: none; border: solid 1px black; height: 100px; width: 100%; spansome text to slide in right/span /div /div div style=clear: both; height: 100px; input id=slide type=button value=Slide / /div -- Thanks, Anoop
[jQuery] $.ajax() issue
Hi all, I have an issue. I am submitting XML data using ajax call which updates data on server. It works fine in firefox but gave 404 error in IE. The ajax call which i am using is mentioned below : var url = '/' + serviceContext + '/services/content/update/' + structid; alert(nodeData); $.ajax({ url: url, type: 'POST', data: nodeData, contentType: 'application/xml;charset= UTF-8', cache: false, processData: false, dataType: 'xml', success: function(){ changeCounter = 0; $('#messages').text('Changes to metadata updated successfully.'); return false; }, error: function(xhr, textStatus, errorThrown) { $('#messages').text('Error! HTTP Error code ' + xhr.status).addClass('warning'); return false; } }); Here nodeData is a xml which i am sending to server. So i need help to figure out whether this is client-side or server- side issue. This call works fine in firefox and updates data on server but in ie it gave 404 error (and response from server says : ' Could not find resource at '/' + serviceContext + '/services/content/update/' + structid link. ') Thanks to all in advance for providing suggestions.
[jQuery] Re: $.ajax() issue
Have you tried an HTTP monitor like Fiddler (http:// www.getfiddler.com) to see what is going on when the $.ajax request starts? That will help diagnose for sure On Aug 29, 9:46 am, g...@iec abhi.pur...@gmail.com wrote: Hi all, I have an issue. I am submitting XML data using ajax call which updates data on server. It works fine in firefox but gave 404 error in IE. The ajax call which i am using is mentioned below : var url = '/' + serviceContext + '/services/content/update/' + structid; alert(nodeData); $.ajax({ url: url, type: 'POST', data: nodeData, contentType: 'application/xml;charset= UTF-8', cache: false, processData: false, dataType: 'xml', success: function(){ changeCounter = 0; $('#messages').text('Changes to metadata updated successfully.'); return false; }, error: function(xhr, textStatus, errorThrown) { $('#messages').text('Error! HTTP Error code ' + xhr.status).addClass('warning'); return false; } }); Here nodeData is a xml which i am sending to server. So i need help to figure out whether this is client-side or server- side issue. This call works fine in firefox and updates data on server but in ie it gave 404 error (and response from server says : ' Could not find resource at '/' + serviceContext + '/services/content/update/' + structid link. ') Thanks to all in advance for providing suggestions.
[jQuery] Re: $.ajax() issue
Is there any other way to find out the root cause apart from these. On Aug 29, 6:55 pm, MorningZ morni...@gmail.com wrote: Have you tried an HTTP monitor like Fiddler (http://www.getfiddler.com) to see what is going on when the $.ajax request starts? That will help diagnose for sure On Aug 29, 9:46 am, g...@iec abhi.pur...@gmail.com wrote: Hi all, I have an issue. I am submitting XML data using ajax call which updates data on server. It works fine in firefox but gave 404 error in IE. The ajax call which i am using is mentioned below : var url = '/' + serviceContext + '/services/content/update/' + structid; alert(nodeData); $.ajax({ url: url, type: 'POST', data: nodeData, contentType: 'application/xml;charset= UTF-8', cache: false, processData: false, dataType: 'xml', success: function(){ changeCounter = 0; $('#messages').text('Changes to metadata updated successfully.'); return false; }, error: function(xhr, textStatus, errorThrown) { $('#messages').text('Error! HTTP Error code ' + xhr.status).addClass('warning'); return false; } }); Here nodeData is a xml which i am sending to server. So i need help to figure out whether this is client-side or server- side issue. This call works fine in firefox and updates data on server but in ie it gave 404 error (and response from server says : ' Could not find resource at '/' + serviceContext + '/services/content/update/' + structid link. ') Thanks to all in advance for providing suggestions.
[jQuery] Re: $.ajax() issue
I do not understand did you not ask in the original post: So i need help to figure out whether this is client-side or server- side issue Using Fiddler will tell you if it's a client side or server side issue because it will show you EXACTLY what the browser is trying to do something littering your code with alert-s is not going to accomplish... Whatever i suppose good luck solving your issue how you see fit On Aug 29, 10:01 am, g...@iec abhi.pur...@gmail.com wrote: Is there any other way to find out the root cause apart from these. On Aug 29, 6:55 pm, MorningZ morni...@gmail.com wrote: Have you tried an HTTP monitor like Fiddler (http://www.getfiddler.com) to see what is going on when the $.ajax request starts? That will help diagnose for sure On Aug 29, 9:46 am, g...@iec abhi.pur...@gmail.com wrote: Hi all, I have an issue. I am submitting XML data using ajax call which updates data on server. It works fine in firefox but gave 404 error in IE. The ajax call which i am using is mentioned below : var url = '/' + serviceContext + '/services/content/update/' + structid; alert(nodeData); $.ajax({ url: url, type: 'POST', data: nodeData, contentType: 'application/xml;charset= UTF-8', cache: false, processData: false, dataType: 'xml', success: function(){ changeCounter = 0; $('#messages').text('Changes to metadata updated successfully.'); return false; }, error: function(xhr, textStatus, errorThrown) { $('#messages').text('Error! HTTP Error code ' + xhr.status).addClass('warning'); return false; } }); Here nodeData is a xml which i am sending to server. So i need help to figure out whether this is client-side or server- side issue. This call works fine in firefox and updates data on server but in ie it gave 404 error (and response from server says : ' Could not find resource at '/' + serviceContext + '/services/content/update/' + structid link. ') Thanks to all in advance for providing suggestions.
[jQuery] Re: Is there a 'dropdown button' plugin?
I ended up combining the standard ui button with a textbox and a 'search' icon a all in a row, styling it so as to emulate the Firefox appearance (more or less) http://www.gotodon.net/dropbutton/selectbutton.jpg The ui button made for a nicer appearance, as I needed to style other dropdown lists anyway On Aug 28, 11:50 pm, Jack Killpatrick j...@ihwy.com wrote: maybe this? http://www.givainc.com/labs/linkselect_jquery_plugin.htm - Jack donb wrote: That's what I'd call it, anyway. This would be a captioned button with a small arrow you'd click on. That would drop down a list of button captions, changing the caption of the button when it collapses. The upshot is, the button would have variable onclick functionality, dependent upon the current caption of the button. I suppose it would merely result in a different value of the button's 'name=' attribute when the container form is submitted. My goal is to pair something like that with a textbox for searching one of several different fields (the button caption would be 'name', 'phone', 'email' for example, and clicking the button would search for the textbox string in whichever field the button says. I'm pretty sure how I'd make one but if it's already been done, why reinvent. Elsewise, I'm diving in. thanks, Don
[jQuery] JqModal
Using the very basic jqModal example, isn't it supposed to auto size and auto center the modal on the page? I placed a table that was wider than the modal's default settings and it's off the page and does not create scroll bars on the page to see the hidden section of the modal. The default class is .jqmWindow { display: none; position: fixed; top: 17%; left: 50%; margin-left: -300px; width: 600px; background-color: #EEE; color: #333; border: 1px solid black; padding: 12px; } Now, I know I can change the width of the modal but what about the positioning? Thanks Steffan --- T E L 6 0 2 . 7 9 3 . 0 0 1 4 | F A X 6 0 2 . 9 7 1 . 1 6 9 4 Steffan A. Cline stef...@execuchoice.net Phoenix, Az http://www.ExecuChoice.net USA AIM : SteffanC ICQ : 57234309 YAHOO : Steffan_Cline MSN : stef...@hldns.com GOOGLE: Steffan.Cline Lasso Partner Alliance Member ---
[jQuery] tool tip / ajax / image map
Details below, but in a nutshell, here's what I need: Tooltip with text and image... works with an image map... works when the page is ajaxed... allows the hot spot in turn to be ajax in content to another div. Here's the (beta) site that shows what I want, but which only works for one image since the tooltip content is hardcoded in the script: www.blazzi.com/ Click on the red car (center image) in the footer. A page with a larger image and an image map loads in the main content area, thanks to jquery and ajaxify. The larger image hotspots trigger tooltips (the front bumper and headlight). Clicking a hotspot loads links in the right column that go to sites where the parts can be bought. The problem is getting dynamic or simply image-specific tooltip content to display on hot spot mouseover. And not only getting the tooltip to display, but doing so while maintaining the ajax for the hot spot link (so it loads the vendor list in the right column). The beta you see uses this tooltip... http://simplythebest.net/scripts/DHTML_scripts/dhtml_script_95.html ...and the tooltip content (image and text) is hard coded into it. I tried putting the tooltip script in the page that loads the image/image map, but it only works if the script is in the surrounding document. Next I tried this jquery tooltip... http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery ...which at least provides for having the image and text parameters in the href. I edited the script to tie the jquery to the area tag of the image map, instead of to the a tag it was written for. Even though the tooltip uses rel for the image parameter, and rel is not a parameter of the area tag, it works. Well, at least it works when you load the page itself. But I ran into the same problem as before, in that the tooltip does not work when the content is ajaxed into the div, whether or not the scripts are in the loaded page or the surrounding page. Even had this approach worked, I am not sure how I would have preserved the ajax-ability of the hot spot links. The ajaxify jquery needs class=ajaxify, while the tooltip needs class=screenshot. Does anyone know if there is a way to accomplish everthing I need? Tooltip with text and image... works with an image map... works when the page is ajaxed... allows the hot spot in turn to be ajax in content to another div. -- View this message in context: http://www.nabble.com/tool-tip---ajax---image-map-tp25204162s27240p25204162.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: I really hope this isn't a dumb syntax error
Thanks to both of you for trying to help me. I had a little bit better luck trying to nest accordions within a list instead of using treeview because it was simply not working for me. Though I'm stuck in a few places with accordion, at least it's working to some degree. On Aug 17, 1:55 pm, James james.gp@gmail.com wrote: Are you adding the jQuery library again on your ajax call? Having the jQuery library twice on the page may cause issues. On Aug 17, 4:13 am, Stephan Beal sgb...@googlemail.com wrote: On Aug 15, 11:38 pm,n4rc1ssus5n4rc1s...@gmail.com wrote: Webpage error details Message: Object doesn't support this property or method Man, oh, man, MSIE is useless. i STRONGLY recommend trying this in Firefox with Firebug enabled, because it will show you exactly what property is the problem here. Line: 257713399 *not sure why the line is so insanely high but whatever* This happens when packing multiple JS files into one, but line 257M is obviously wrong. Unless you've really got several GB of JS code coming over the wire, which i highly doubt). Char: 2 Code: 0 URI:http://localhost/greekware8/ like the subject says I hope this isn't some really stupid mess up in my part but this should've worked in a day's time of work. Install firebug (in Firefox), then enable the break on all errors option in the Scripts tag, then reload the page. It will point you right to where the problem is. It sounds to me (just guessing) that it's either a syntax error in your code or you're trying to use code which requires a separate plugin which isn't yet loaded.- Hide quoted text - - Show quoted text -
[jQuery] Re: tool tip / ajax / image map
Even had this approach worked, I am not sure how I would have preserved the ajax-ability of the hot spot links. The ajaxify jquery needs class=ajaxify, while the tooltip needs class=screenshot. This isn't an issue; you can always have a space-separated list of class names: class=ajaxify screenshot Does anyone know if there is a way to accomplish everthing I need? Tooltip with text and image... works with an image map... works when the page is ajaxed... allows the hot spot in turn to be ajax in content to another div. It sounds like that last is your real issue. Remember that when you run something when the document is loaded, it runs only on what's already in the DOM. So whether you use $(document).ready() or window.onload, if your code is modifiying the DOM or hooking events into it, that code has finished running before your code is Ajax'd into the page. There are several good approaches to this, including calling your method again on a successful Ajax call, or using the livequery plugin, or using live events [2]. Good luck, -- Scott [1] http://docs.jquery.com/Plugins/livequery [2] http://docs.jquery.com/Events/live
[jQuery] Hover only innermost matching element
I need to highlight and work with the innermost of several hovered items. My markup is for now nested lists, although that may change, and if the user hovers over one several layers deep, only that one should be highlighted. I have code that is working for my initial case, with a demo here: http://jsbin.com/ipova (code: http://jsbin.com/ipova/edit) My full interface will have something substantially more than the CSS generated id on the left, but I think this gets the point across. I would probably also add in hoverIntent to stop some annoying flashing... I'm reasonably happy with this code, although if I were to want to distribute it as a real plug-in, it would still take some work, as I reuse events in an inappropriate manner. But I want to know if there are better tools already out there to do the same thing. Has anyone created or seen something better than my implementation (and maybe found a better name for it!?) This is the relevant code for a method that can be used in place of hover: $.fn.hoverOne = function(fnOver, fnOut) { var currentElt = false; var $jqObject = this; $(this).hover(function(event) { if (currentElt) fnOut.call(currentElt, event); fnOver.call(this, event); currentElt = this; }, function(event) { fnOut.call(this, event); if ($.inArray(event.relatedTarget, $jqObject) -1) { fnOver.call(event.relatedTarget, event); currentElt = event.relatedTarget; } else { currentElt = false; } }); } Any suggestions, pointers? Thanks, -- Scott Sauyet
[jQuery] Re: tool tip / ajax / image map
Thanks, Scott, for the reply. The space separated class info is great! Actually, the hot spots in the beta do carry the ajaxify behavior, loading their links in the right hand column. And I just discovered they work even if the page that holds the image and the image map does not reference any of the necessary scripts. So that's the good news. And along with your space-separated list tip I'm making progress. But I still need to get a tooltip that works when the page containing the image and the image map is ajax-ed in... Thoughts? Scott Sauyet-2 wrote: Even had this approach worked, I am not sure how I would have preserved the ajax-ability of the hot spot links. The ajaxify jquery needs class=ajaxify, while the tooltip needs class=screenshot. This isn't an issue; you can always have a space-separated list of class names: class=ajaxify screenshot Does anyone know if there is a way to accomplish everthing I need? Tooltip with text and image... works with an image map... works when the page is ajaxed... allows the hot spot in turn to be ajax in content to another div. It sounds like that last is your real issue. Remember that when you run something when the document is loaded, it runs only on what's already in the DOM. So whether you use $(document).ready() or window.onload, if your code is modifiying the DOM or hooking events into it, that code has finished running before your code is Ajax'd into the page. There are several good approaches to this, including calling your method again on a successful Ajax call, or using the livequery plugin, or using live events [2]. Good luck, -- Scott [1] http://docs.jquery.com/Plugins/livequery [2] http://docs.jquery.com/Events/live -- View this message in context: http://www.nabble.com/tool-tip---ajax---image-map-tp25204162s27240p25205493.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] jquery validate
Hello, I am using jquery validate on one of my pages with a submit handler, Can anyone let me know how I can specifiy which layer should contain the error messages?. Here is the code I want to change: $(document).ready(function(){ jQuery(function() { var v = jQuery(#PropertyForm).validate({ submitHandler: function(form) { $.ajaxSetup({dataType: html}) $.get('submit.php',{URLLINK:$('#name').val(),rand:Math.random() }, function(datanew) {$('#jim').append(datanew); }); return false; } }); }); }); Here is code I use on other pages to show the messages in the container: script type=text/javascript $(document).ready(function(){ var containerRegistration = $('div.containerRegistration'); var validator = $(#PropertyForm).validate({ errorContainer: containerRegistration, errorLabelContainer: $(ol, containerRegistration), wrapper: 'li', meta: validate } ); }); /script Can anyone help me with the syntax for putting the container into the first block of code? Thanks James
[jQuery] Re: ajax request form in one page, is it possible ?
I understand that ive to use - X-Requested-With then I did search a bit about that and I found this code, $.ajaxSetup({ headers: {X-Requested-With:Ajax} }); but I still don't understand how should I send the parameters to the same file and get them in the server side (PHP) I hot to get answer, thanks!
[jQuery] JSON data manipulation
Hello guys. My question has actually more to do with jqPlot ( graph library for jQuery ), but I'm still asking it here, because it concerns json data manipulation through jquery. I'm not a javascript nor JQuery programmer, I'm just in a learning process. So my question. To plot something through jqPlot the syntax should be: plot = $.jqplot('chart', [line1, line2, line3], { ... } With line1, line2 and line3 as array variables! My current JSON data is: [{Name:series1,Serie:[[1,4],[2,25],[3,7],[4,14]]}, {Name:series2,Serie:[[1,13],[2,5],[3,7],[4,20]]}] And in my .js file I've put this: $.getJSON('/Graph/HearthRateDataJSON', , function(data) { $.each(data, function(entryindex, entry) { Plot(entry['Serie'], entry['Name']); }); }); Problem now is that the graph will only plot the 'last' serie, because the graph itself needs all data at once! And not like I did going through each JSON record and plot the line. So any thoughts on how to use the $.each to put all data in one variable to get jqPlot to plot all series? Thanks Glenn
[jQuery] Re: JqModal
Stephan,For positioning adjust margin-left to be half of your new width. For example if you set your width to 800px, then the entry for margin-left should be: magrin-left:-400px; Regards, Lyubov On Sat, Aug 29, 2009 at 12:11 PM, Steffan A. Cline stef...@hldns.comwrote: Using the very basic jqModal example, isn't it supposed to auto size and auto center the modal on the page? I placed a table that was wider than the modal's default settings and it's off the page and does not create scroll bars on the page to see the hidden section of the modal. The default class is .jqmWindow { display: none; position: fixed; top: 17%; left: 50%; margin-left: -300px; width: 600px; background-color: #EEE; color: #333; border: 1px solid black; padding: 12px; } Now, I know I can change the width of the modal but what about the positioning? Thanks Steffan --- T E L 6 0 2 . 7 9 3 . 0 0 1 4 | F A X 6 0 2 . 9 7 1 . 1 6 9 4 Steffan A. Cline stef...@execuchoice.net Phoenix, Az http://www.ExecuChoice.net USA AIM : SteffanC ICQ : 57234309 YAHOO : Steffan_Cline MSN : stef...@hldns.com GOOGLE: Steffan.Cline Lasso Partner Alliance Member ---
[jQuery] Re: Too much recursion
I think you should try just passing the function name as the second parameter, instead of adding () after it. () will cause the function to execute right away. So: function visibleFadeIn() { jQuery('#visible').fadeIn(2000, visibleFadeOut); } function visibleFadeOut() { jQuery('#visible').fadeOut(2000, visibleFadeIn); } // Starts the loop visibleFadeIn(); On Aug 27, 11:16 pm, FCCS brard.pie...@gmail.com wrote: Hello, I'm trying to build a simple fadeIn - fadeOut loop on a div, but I get an infinite recursion the way I do it : // + Code function visibleFadeIn() { jQuery('#visible').fadeIn(2000, visibleFadeOut()); } function visibleFadeOut() { jQuery('#visible').fadeOut(2000, visibleFadeIn()); } // Starts the loop visibleFadeIn(); // - Code There must be another way to deal with this, does someone have a suggestion ? Thank you very much, FCCS
[jQuery] [Form Plugin] - Bug in version 2.28 at line 61 (lack semicolon)
Hi. Today I was trying compress the jQuery Form Plugin V 2.28 (http:// malsup.com/jquery/form/) with JavaScriptPacker (http:// dean.edwards.name/packer/) but I get an error in Firefox 3.5: missing ; before statement. I revised the code and I can see that lack the semicolon at end of line 61: url = url || window.location.href || '' I corrected this and can compress the js correctly. Best Regards, Pablo Santa Fe - Argentina http://www.infosoft.com.ar
[jQuery] Re: event-binding to dynamically created elements... (JSP vs JS problem......)
yes I know they are two different things, I do know both JSP and JavaScript, so I do know the difference; I would like to know why what works in JSP doesn't work in JavaScript.. again: this works in JSP: % for (int i = 1; i 5; i++) { % $('#image%=i%').bind('mouseover',function(event) { $('#image%=i%').addClass('dim'); }); % } % but the same thing, in JavaScript, doesn't work: for (i = 1; i 5; i++) { $('#thumb' + i).bind('mouseover',function(event) { $('#thumb' + i).addClass('dim'); }); } in JavaScript this code is applied ONLY when i=5, in JSP it applies to all four elements processed in the array and works as expected ok, to make it easier, forget the comparison to JSP... why does above JavaScript code not work?? I create four elements dynamically, but event-binding does not work for any of the four elements... thank you... On Aug 28, 6:56 pm, James james.gp@gmail.com wrote: I have difficulties understanding what you're trying to achieve. As someone mentioned, Java is to Javascript as Ham is to Hamster. They're two different beasts. For the 'elem+1' situation, you can do: this['elem'+1] = '...'; to dynamically create variables. But usually you don't have to resort to doing something like that if you code things properly. On Aug 28, 12:44 pm, kali maya778...@yahoo.com wrote: hi, I have a problem with binding events to dynamically-generated elements; specif. problem is something I'm trying to do with JavaScript doesn't work but it works if I do it inJSP: (and can we PLEASE get ability to display CODE in this forum in NON-PROPORTIONAL FONT???) JSP, event-binding works: % for (int i = 1; i 5; i++) { % var elem%=i% = $('a id=link%=i%img id=image%=i % //a'); $('#image%=i%').bind('mouseover',function(event) { $('#image%=i%').addClass('dim'); }); } JavaScript, event-binding does not work: --- for (i = 1; i 5; i++) { var elem = $('a id=link%=i%img id=image%=i% / /a'); $('#thumb' + i).bind('mouseover',function(event) { $('#thumb' + i).addClass('dim'); }); } (also: this declaration doesn't work in JS: var elem+i = $('a id=link%=i%img id=image%=i% //a'); ^^ 'elem+i' returns a syntax error; why does this declaration 'var elem %=i%' work inJSPbut equivalent does not in JS? urls (JSPand JS) are here: http://www.mayacove.com/dev/jquery/events/test_event_dyn.htmlhttp://w... thank you very much..
[jQuery] Re: Form got submitted when I hit enter on select the value in autocomplete box
Any help on this? On Mon, Aug 24, 2009 at 11:14 PM, pankaj sharmapankaj1...@gmail.com wrote: Hi All, In my application,there are several autocomplte field is available. When I type pank and then it list out the several matching in the autocomplete field and select one and then hit the enter then it submitted the entire form, which will cause the error message. Because there are several more mandatory field are there, which i need to fill up. I was trying to restrict in this way, but i believe this is the wrong way. The following will disable enter-to-submit for the entire form. $(#myForm).bind(keypress, function(event) { if(event.keyCode == 13) { return false; } }); Please help me how to resolve this issue in Jquery autocomplete plugin, so that the should not sumbit on hitting enter in autocomplete text box. I am new to this forum, please let me know if you need any more info on this? Thanks
[jQuery] IE6 script error? Superfish
Hi, I am having a hard time getting the dropdown nav under about us to work in IE6 on this site: http://www.mccauleycelin.com/index.php It seems to work it every browser except IE6 (big shocker). Every time I load the page in IE6, I get a script error that points to the initialization script in the header. Am I missing something simple here? I'm pretty sure the CSS is correct.
[jQuery] Cycle slide #1
Hi everyone, This question probably is easy, probably is not :). Is there a way to apply an entry effect to Slideshow? Like the first image in the index make it zoom and on page load the first image would appear with zoom before everything? Thanks!
[jQuery] Re: IE6 script error? Superfish
path to superfish.js isn't working, opens an html page. Can tell on main page, no delay on hiding of sub menus. Right now all you have is a css menu with no script Bryan D. wrote: Hi, I am having a hard time getting the dropdown nav under "about us" to work in IE6 on this site: http://www.mccauleycelin.com/index.php It seems to work it every browser except IE6 (big shocker). Every time I load the page in IE6, I get a script error that points to the initialization script in the header. Am I missing something simple here? I'm pretty sure the CSS is correct.
[jQuery] Re: IE6 script error? Superfish
Yep. That was it, I didn't have the .js files pathed correctly. Duh. thanks for the help. On Aug 29, 6:21 pm, Charlie charlie...@gmail.com wrote: path to superfish.js isn't working, opens an html page. Can tell on main page, no delay on hiding of sub menus. Right now all you have is a css menu with no script Bryan D. wrote:Hi, I am having a hard time getting the dropdown nav under about us to work in IE6 on this site:http://www.mccauleycelin.com/index.phpIt seems to work it every browser except IE6 (big shocker). Every time I load the page in IE6, I get a script error that points to the initialization script in the header. Am I missing something simple here? I'm pretty sure the CSS is correct.
[jQuery] Re: Cycle plugin creating links
I would like to link each image in the cycle to a specific page. Any ideas on how to do this? I got it to cycle and everything is working fine. I just want it so that the actual image is clickable. Here's an example: http://www.malsup.com/jquery/cycle/anchor.html
[jQuery] JSON error: missing } after property list
Why does this JSON generate the error missing } after property list in Firebug? What's missing? {newitem: div id='iid_27' class='round-block' div class='left' Test Title 10 /div div class='right' ulliTest Caption 10/li/ uldiv class='drag-handle'drag to reorder/div /div /div } Guessing the error lies outside this code block but not sure how to track down the problem.
[jQuery] Re: JSON error: missing } after property list
Is what you posted the actual JSON you're using? It has line breaks in the middle of the string, which can't be correct - but would probably trigger a different error. If the line breaks are removed, it's valid JSON which you can test at: http://www.jsonlint.com/ It would be hard for anyone to help you with just the information given here. Can you post a link to a test page? -Mike From: twitchy Why does this JSON generate the error missing } after property list in Firebug? What's missing? {newitem: div id='iid_27' class='round-block' div class='left' Test Title 10 /div div class='right' ulliTest Caption 10/li/ uldiv class='drag-handle'drag to reorder/div /div /div } Guessing the error lies outside this code block but not sure how to track down the problem.
[jQuery] Re: Cycle slide #1
An example is available here for those looking the same thing: http://malsup.com/jquery/cycle/fade-in-first.html Just use jQuery UI scale effect or any other for that matter.
[jQuery] Re: jquery.Flash plugin
Got the above working with slightly different code. Also realized my non flash content had to be displayed then my flash content would be displayed only if flash was present. My code is below. I do not recommend this method since I will have duplicate information on my site and it may interfere with the SEO rankings. In my header I have this -- script type=text/javascript $(document).ready(function(){ $.ajaxSettings.cache = false; //This is for IE. // uncomment the alert to actually see the content go from non flash to flash. //alert('Once clicked you will see the flash version of the site!') $('#flashHere').flash(null, null, function (htmlOptions){ $.get('my_flash.html',{},function(data){ $('.hello').html(data); }); }); }); // END DOCUMENT READY /script my_flash.html is a page with all my flash stuff on it that will remove my content in the div with an ID of flashHere found in the body of my site In my body I have the following div -- div id=flashHere class=entry hello I am non flash content and I am seen by all!br Once flash is noticed my flash replace stuff goes here! Not a bad idea. Too bad I am not very smart and did not realize this sooner. /div Hope this helps out other people. John
[jQuery] Re: event-binding to dynamically created elements... (JSP vs JS problem......)
You can't call jQuery from JSP code, only from JavaScript. Your JSP code *generates* JavaScript code, which is what actually calls jQuery. In your JSP code, the loop is run in JSP, and it generates a separate block of JavaScript code each time through the loop. Here is the actual JavaScript code it generates: $('#image1').bind('mouseover',function(event) { $('#image1').addClass('dim'); }); $('#image2').bind('mouseover',function(event) { $('#image2').addClass('dim'); }); $('#image3').bind('mouseover',function(event) { $('#image3').addClass('dim'); }); $('#image4').bind('mouseover',function(event) { $('#image4').addClass('dim'); }); You can see why that code works as expected, since each of the four blocks is completely self-contained and references the element ID you want it to use. The JavaScript code is a different story: for (i = 1; i 5; i++) { $('#thumb' + i).bind('mouseover',function(event) { $('#thumb' + i).addClass('dim'); }); } Now you're running the loop *in JavaScript*. When you call .bind() each time through the loop, the variable i has the value you expect, 1 through 4 as you go through the loop. When this loop terminates, i has the value 5. Much later, when you move the mouse over one of your elements, the event callback function is called. What is the value of i now? 5. There's only a single variable called i, and it only contains one value at a time, and when the loop is finished that value is 5. Here are a couple of ways to fix it. One is to use a closure: for (i = 1; i 5; i++) setThumbMouseover( i ); function setThumbMouseover( i ) { $('#thumb' + i).bind('mouseover',function(event) { $('#thumb' + i).addClass('dim'); }); } This code is almost identical to the original, but by calling a function each time through the loop, those function calls each have their own local variable named i. The value of each of those variables is preserved when the event handler is called later. Note that the name i inside the function is unrelated to the name i outside it. The code would work the same like this: for (i = 1; i 5; i++) setThumbMouseover( i ); function setThumbMouseover( n ) { $('#thumb' + n).bind('mouseover',function(event) { $('#thumb' + n).addClass('dim'); }); } Either way, this is a great general purpose solution for a lot of similar problems. In this particular case, you also have the option of using a simpler approach. In the event callback, this is a reference to the specific element receiving the event. So you can code it like so: for (i = 1; i 5; i++) { $('#thumb' + i).bind('mouseover',function(event) { $(this).addClass('dim'); }); } Now there is no longer a reference to the i variable in the event callback, so you avoid the problem completely. -Mike From: kali yes I know they are two different things, I do know both JSP and JavaScript, so I do know the difference; I would like to know why what works in JSP doesn't work in JavaScript.. again: this works in JSP: % for (int i = 1; i 5; i++) { % $('#image%=i%').bind('mouseover',function(event) { $('#image%=i%').addClass('dim'); }); % } % but the same thing, in JavaScript, doesn't work: for (i = 1; i 5; i++) { $('#thumb' + i).bind('mouseover',function(event) { $('#thumb' + i).addClass('dim'); }); } in JavaScript this code is applied ONLY when i=5, in JSP it applies to all four elements processed in the array and works as expected ok, to make it easier, forget the comparison to JSP... why does above JavaScript code not work?? I create four elements dynamically, but event-binding does not work for any of the four elements... thank you... On Aug 28, 6:56 pm, James james.gp@gmail.com wrote: I have difficulties understanding what you're trying to achieve. As someone mentioned, Java is to Javascript as Ham is to Hamster. They're two different beasts. For the 'elem+1' situation, you can do: this['elem'+1] = '...'; to dynamically create variables. But usually you don't have to resort to doing something like that if you code things properly. On Aug 28, 12:44 pm, kali maya778...@yahoo.com wrote: hi, I have a problem with binding events to dynamically-generated elements; specif. problem is something I'm trying to do with JavaScript doesn't work but it works if I do it inJSP: (and can we PLEASE get ability to display CODE in this forum in NON-PROPORTIONAL FONT???) JSP, event-binding works: % for (int i = 1; i 5; i++) { % var elem%=i% = $('a id=link%=i%img id=image%=i % //a'); $('#image%=i%').bind('mouseover',function(event) { $('#image%=i%').addClass('dim'); }); } JavaScript,